# uuid library missing buffer bounds check in v3/v5/v6

Source: https://junglewise.ai/threats/uuid-library-missing-buffer-bounds-check-in-v3-v5-v6-e298efbd  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-04-23. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

Severity: low · CVSS 3.1 · Published 2026-04-23

The uuid JavaScript library fails to validate buffer boundaries when writing UUIDs to caller-provided buffers in v3(), v5(), and v6() methods. An application using these methods with untrusted offsets or small buffers could experience silent partial writes, producing malformed or truncated UUIDs without error. In systems where buffer sizes or offsets are controlled by end users, this can lead to data corruption or unexpected application behavior.

Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is This vulnerability exploited in the wild?** No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.

**How severe is This vulnerability?** Low severity, with a CVSS score of 3.1, published 23 April 2026.

**Which products and versions are affected?** uuid (npm) SEMVER:introduced=0,fixed=14.0.0.

**Is there a fix for This vulnerability?** Yes. uuid (npm): upgrade to 14.0.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is This vulnerability attacked?** It is attacked with local access.

**Am I affected?** Check whether you run uuid (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- uuid (npm): upgrade to 14.0.0 or later

  ```sh
  npm install uuid@14.0.0
  ```


## Technical details

The v3(), v5(), and v6() API methods in uuid accept external output buffers with custom offsets but do not validate that the buffer has sufficient space for a 16-byte UUID write. The vulnerable code in src/v35.ts and src/v6.ts directly writes buf[offset + i] without range checking, unlike the v1(), v4(), and v7() methods which explicitly throw RangeError on invalid bounds. An attacker who controls the buffer size or offset parameter can trigger silent partial writes into the provided buffer. The fix requires adding a bounds check: if (offset &lt; 0 || offset + 16 &gt; buf.length) throw new RangeError(...). Patched versions are 11.1.1, 12.0.1, and 13.0.1.

## Affected products

- uuid uuid before 11.1.1, 12.0.0, 13.0.0

## Timeline

- 2026-04-19: disclosed
- 2026-04-23: patched: Versions 11.1.1, 12.0.1, 13.0.1 released

## References

- [https://github.com/uuidjs/uuid/security/advisories/GHSA-w5hq-g745-h8pq](https://github.com/uuidjs/uuid/security/advisories/GHSA-w5hq-g745-h8pq)

## Related threats

- [uuidjs uuid out-of-bounds write in v3, v5, and v6 functions](https://junglewise.ai/threats/cve-2026-41907-uuidjs-uuid-out-of-bounds-write-in-v3-v5-and-v6-functions)
