Executive brief
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.
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 < 0 || offset + 16 > 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