Vulnerabilities in pkg:npm/uuid

PACKAGE
Advisory Identifier: GHSA-w5hq-g745-h8pq
Advisory Summary

CVE-2026-41907 is a MODERATE (CVSS 7.5) missing buffer bounds check vulnerability (CWE-787: Out-of-bounds Write) affecting uuid libraries in the npm ecosystem. The issue involves missing buffer bounds check in v3/v5/v6 when buf is provided. Remediation is available by upgrading affected packages to version 11.1.1, 12.0.1, 13.0.1.

2 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/uuid

2 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/uuid. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-w5hq-g745-h8pq CVE-2026-41907 MODERATE uuid: Missing buffer bounds check in v3/v5/v6 when buf is provided
GHSA-qmq6-f8pr-cx5x - LOW Duplicate Advisory: uuid: Missing buffer bounds check in v3/v5/v6 when buf is provided

CVE-2026-41907 at a Glance

CVE Identifier CVE-2026-41907
GHSA Identifier GHSA-w5hq-g745-h8pq
Severity MODERATE
CVSS v3.1 Base Score 7.5
CWE Classification CWE-787: Out-of-bounds Write
Affected Product uuid
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2026-41907

To remediate this vulnerability, upgrade all affected uuid dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

uuid fixed: 11.1.1
npm install uuid@11.1.1
uuid fixed: 12.0.1
npm install uuid@12.0.1
uuid fixed: 13.0.1
npm install uuid@13.0.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls uuid

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-41907, inspect your project dependencies using npm:

npm ls uuid

Analyze the terminal output to locate any version of uuid in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 11.1.1), your application is affected.

Note: The npm ls uuid command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-787: Out-of-bounds Write, where the product writes data past the end, or before the beginning, of the intended buffer. In uuid, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary The `v3()`, `v5()`, and `v6()` [API methods](https://github.com/uuidjs/uuid#api-summary) (not `uuid` release versions) accept external output buffers but do not reject out-of-range writes (small `buf` or large `offset`). By contrast, `v4()`, `v1()`, and `v7()` API methods explicitly throw `RangeError` on invalid bounds. This inconsistency allows **silent partial writes** into caller-provided buffers. ### Affected code - `src/v35.ts` (`v3()`/`v5()` path) writes `buf[offset + i]` without bounds validation. - `src/v6.ts` writes `buf[offset + i]` without bounds validation. ### Reproducible PoC ```bash cd /home/StrawHat/uuid npm ci npm run build node --input-type=module -e " import {v4,v5,v6} from './dist-node/index.js'; const ns='6ba7b810-9dad-11d1-80b4-00c04fd430c8'; for (const [name,fn] of [ ['v4()',()=>v4({},new Uint8Array(8),4)], ['v5()',()=>v5('x',ns,new Uint8Array(8),4)], ['v6()',()=>v6({},new Uint8Array(8),4)], ]) { try { fn(); console.log(name,'NO_THROW'); } catch(e){ console.log(name,'THREW',e.name); } }" ``` Observed: - `v4() THREW RangeError` - `v5() NO_THROW` - `v6() NO_THROW` Example partial overwrite evidence captured during audit: ```text same true buf [ 170, 170, 170, 170, 75, 224, 100, 63 ] v6 [ 187, 187, 187, 187, 31, 19, 185, 64 ] ``` ### Security impact - **Primary**: integrity/robustness issue (silent partial output). - If an application assumes full UUID writes into preallocated buffers, this can produce malformed/truncated/partially stale identifiers without error. - In systems where caller-controlled offsets/buffer sizes are exposed indirectly, this may become a security-relevant logic flaw. ### Suggested fix Add the same guard used by `v4()`/`v1()`/`v7()`: ```ts if (offset < 0 || offset + 16 > buf.length) { throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); } ``` Apply to: - `src/v35.ts` (covers `v3()` and `v5()`) - `src/v6.ts`

CVE-2026-41907 Affected uuid Versions

3 component(s)
Fixed Versions:
11.1.112.0.113.0.1
Product / Package Ecosystem Affected Versions Fixed Version
uuid
npm
< 11.1.1
11.1.1
uuid
npm
≥ 12.0.0
< 12.0.1
12.0.1
uuid
npm
≥ 13.0.0
< 13.0.1
13.0.1

References

Frequently Asked Questions

What is CVE-2026-41907?
CVE-2026-41907 is a security vulnerability in uuid involving Missing buffer bounds check in v3/v5/v6 when buf is provided under CWE-787: Out-of-bounds Write.
Which uuid versions are affected?
Affected versions include releases prior to 11.1.1, 12.0.1, 13.0.1 across affected packages: uuid.
What version fixes CVE-2026-41907?
Upgrading to 11.1.1, 12.0.1, 13.0.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is uuid affected?
Yes, uuid is affected in releases prior to 11.1.1, 12.0.1, 13.0.1. Upgrade your dependency to 11.1.1, 12.0.1, 13.0.1 or later.
What is the CVSS score of CVE-2026-41907?
CVE-2026-41907 has a CVSS v3.1 base score of 7.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N.
What CWE is associated with CVE-2026-41907?
CVE-2026-41907 is classified under CWE-787: Out-of-bounds Write (The product writes data past the end, or before the beginning, of the intended buffer.).
How can I check npm dependencies for CVE-2026-41907?
Run the dependency tree command: 'npm ls uuid'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-w5hq-g745-h8pq",
  "modified" : "2026-05-21T18:25:56Z",
  "published" : "2026-04-22T20:53:24Z",
  "aliases" : [ "CVE-2026-41907" ],
  "summary" : "uuid: Missing buffer bounds check in v3/v5/v6 when buf is provided",
  "details" : "### Summary\n\nThe `v3()`, `v5()`, and `v6()` [API methods](https://github.com/uuidjs/uuid#api-summary) (not `uuid` release versions) accept external output buffers but do not reject out-of-range writes (small `buf` or large `offset`).  \nBy contrast, `v4()`, `v1()`, and `v7()` API methods explicitly throw `RangeError` on invalid bounds.\n\nThis inconsistency allows **silent partial writes** into caller-provided buffers.\n\n\n### Affected code\n\n- `src/v35.ts` (`v3()`/`v5()` path) writes `buf[offset + i]` without bounds validation.\n- `src/v6.ts` writes `buf[offset + i]` without bounds validation.\n\n### Reproducible PoC\n\n```bash\ncd /home/StrawHat/uuid\nnpm ci\nnpm run build\n\nnode --input-type=module -e \"\nimport {v4,v5,v6} from './dist-node/index.js';\nconst ns='6ba7b810-9dad-11d1-80b4-00c04fd430c8';\nfor (const [name,fn] of [\n  ['v4()',()=>v4({},new Uint8Array(8),4)],\n  ['v5()',()=>v5('x',ns,new Uint8Array(8),4)],\n  ['v6()',()=>v6({},new Uint8Array(8),4)],\n]) {\n  try { fn(); console.log(name,'NO_THROW'); }\n  catch(e){ console.log(name,'THREW',e.name); }\n}\"\n```\n\nObserved:\n\n- `v4() THREW RangeError`\n- `v5() NO_THROW`\n- `v6() NO_THROW`\n\nExample partial overwrite evidence captured during audit:\n\n```text\nsame true buf [\n  170, 170, 170, 170,\n   75, 224, 100,  63\n]\nv6 [\n  187, 187, 187, 187,\n   31,  19, 185,  64\n]\n```\n\n### Security impact\n\n- **Primary**: integrity/robustness issue (silent partial output).\n- If an application assumes full UUID writes into preallocated buffers, this can produce malformed/truncated/partially stale identifiers without error.\n- In systems where caller-controlled offsets/buffer sizes are exposed indirectly, this may become a security-relevant logic flaw.\n\n### Suggested fix\n\nAdd the same guard used by `v4()`/`v1()`/`v7()`:\n\n```ts\nif (offset < 0 || offset + 16 > buf.length) {\n  throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);\n}\n```\n\nApply to:\n\n- `src/v35.ts` (covers `v3()` and `v5()`)\n- `src/v6.ts`",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "uuid"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "11.1.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "uuid"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "12.0.0"
      }, {
        "fixed" : "12.0.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "uuid"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "13.0.0"
      }, {
        "fixed" : "13.0.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/uuidjs/uuid/security/advisories/GHSA-w5hq-g745-h8pq"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-41907"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/uuidjs/uuid/commit/32389c887c9e75f90442ee4cc95bbab0c4e8346e"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/uuidjs/uuid/commit/3d2c5b0342f0fcb52a5ac681c3d47c13e7444b34"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/uuidjs/uuid/commit/3d61d6ac1f782cf6b1dd8661c60f11722cd49a0d"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/uuidjs/uuid/commit/9d27ddf7046ce496ef39569ff84d948eeff9cb2a"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/uuidjs/uuid"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/uuidjs/uuid/releases/tag/v11.1.1"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/uuidjs/uuid/releases/tag/v12.0.1"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/uuidjs/uuid/releases/tag/v13.0.1"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/uuidjs/uuid/releases/tag/v14.0.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1285", "CWE-787" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-22T20:53:24Z",
    "nvd_published_at" : "2026-04-24T19:17:14Z"
  }
}