{"id":"CVE-2026-41988","aliases":["CVE-2026-41988","GHSA-w5hq-g745-h8pq"],"related":["CVE-2026-41907"],"kind":"vulnerability","state":"published","title":"uuid: Missing buffer bounds check in v3/v5/v6 when buf is provided","summary":"uuid before 14.0.0 can make unexpected writes when external output buffers are used, and the UUID version is 3, 5, or 6. In particular, UUID version 4, which is very commonly used, is unaffected by this issue.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"uuid before 14.0.0 can make unexpected writes when external output buffers are used, and the UUID version is 3, 5, or 6. In particular, UUID version 4, which is very commonly used, is unaffected by this issue.","source":"cvelist"},{"lang":"en","text":"### 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`","format":"markdown","source":"ghsa"},{"lang":"es","text":"uuid anterior a 14.0.0 puede realizar escrituras inesperadas cuando se utilizan búferes de salida externos y la versión de UUID es 3, 5 o 6. En particular, la versión 4 de UUID, que es muy utilizada, no se ve afectada por este problema.","source":"nvd"}],"published":"2026-04-22T20:53:24.000Z","modified":"2026-10-26T21:10:00.170Z","severity":{"scorer":"mitre","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:C/C:N/I:L/A:N","score":3.2,"rating":"LOW"},"severities":[{"scorer":"mitre","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:C/C:N/I:L/A:N","score":3.2,"rating":"LOW"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","score":7.5,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:N","score":2.5,"rating":"LOW"}],"cwes":["CWE-670","CWE-787","CWE-1285"],"affected":[{"ranges":[{"type":"semver","introduced":"0","fixed":"14.0.0","status":"affected"}],"vendor":"uuidjs","product":"uuid","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"11.1.1"}],"ecosystem":"npm","package":"uuid","purl":"pkg:npm/uuid","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"12.0.0","status":"affected","fixed":"12.0.1"}],"ecosystem":"npm","package":"uuid","purl":"pkg:npm/uuid","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"13.0.0","status":"affected","fixed":"13.0.1"}],"ecosystem":"npm","package":"uuid","purl":"pkg:npm/uuid","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"11.1.1"},{"status":"affected","version":"12.0.0"},{"status":"affected","version":"13.0.0"}],"vendor":"uuidjs","product":"uuid","cpe":"cpe:2.3:a:uuidjs:uuid:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/uuidjs/uuid/security/advisories/GHSA-w5hq-g745-h8pq","tags":["exploit","vendor-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/uuidjs/uuid/commit/3d2c5b0342f0fcb52a5ac681c3d47c13e7444b34","tags":["patch","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-41907","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/uuidjs/uuid/commit/32389c887c9e75f90442ee4cc95bbab0c4e8346e","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/uuidjs/uuid/commit/3d61d6ac1f782cf6b1dd8661c60f11722cd49a0d","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/uuidjs/uuid/commit/9d27ddf7046ce496ef39569ff84d948eeff9cb2a","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/uuidjs/uuid","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/uuidjs/uuid/releases/tag/v11.1.1","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/uuidjs/uuid/releases/tag/v12.0.1","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/uuidjs/uuid/releases/tag/v13.0.1","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/uuidjs/uuid/releases/tag/v14.0.0","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"mitre","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-04-23T14:48:49.689Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-41988","url":"https://www.cve.org/CVERecord?id=CVE-2026-41988","licence":"CVE Terms of Use","modified":"2026-04-23T16:22:56.684Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-w5hq-g745-h8pq","url":"https://github.com/advisories/GHSA-w5hq-g745-h8pq","licence":"CC-BY-4.0","modified":"2026-09-10T03:51:03.663Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-41988","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-41988","licence":"Public domain","modified":"2026-10-26T21:10:00.170Z"}],"updatedAt":"2026-11-25T22:59:19.379Z","epss":{"score":0.00188,"percentile":0.08858,"date":"2026-12-01T12:00:22.000Z"}}