Open actionable advisories and recorded vendor fixes. This public package view has no inventory attached and cannot establish whether your deployment is affected. A vendor fix never resolves your finding; verify your installed version and the source guidance.
Open advisories
5 actionable advisories, newest first. Withdrawn advisories and news are excluded. Coverage is partial.
An integer overflow in nanoid(size) permanently corrupts the process-wide CSPRNG pool, causing all subsequent ID generation to return the deterministic string "uuuuuuuuuuuuuuuuuuuuu". Any application that passes user-influenced values to the size parameter loses all randomness guarantees for session tokens, CSRF tokens, and unique identifiers until process restart. Details nanoid() at index.js:101 coerces the size parameter with size |= 0, which converts it to a signed 32-bit integer. When size = 2^31 (e.g., 2147483648), this wraps to -2147483648. The negative value is passed to fillPool() (index.js:15): Neither branch triggers, so the pool is never refreshed. poolOffset becomes ~-2.1 billion. Subsequent nanoid() calls execute: pool[negativeindex] returns undefined. undefined & 63 evaluates to 0. urlAlphabet[0] is 'u'. Every ID becomes "uuuuuuuuuuuuuuuuuuuuu". The corruption is persistent — it affects all subsequent calls in the process until ~100 million calls eventually…
Recommended action: Upgrade to 5.1.11 or 3.3.12 by release line, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.
nanoid (Nano ID) before 5.1.16 contains an infinite loop in the customAlphabet and nanoid functions of its non-secure module (nanoid/non-secure). When these functions are given a negative size, the loop counter is decremented from a negative value and never reaches its termination condition, spinning indefinitely and hanging the calling thread. An application that passes an unvalidated, attacker-controlled negative size to these functions is exposed to a denial-of-service condition.
Recommended action: Upgrade to 5.1.16 or 3.3.16 by release line, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.
nanoid (Nano ID) before 5.1.6 contains an infinite loop in the customAlphabet and customRandom functions. When these functions are configured with a size of 0, the internal generation loop never satisfies its exit condition and spins indefinitely, hanging the calling thread. An application that passes an unvalidated, attacker-controlled size of 0 to these functions is exposed to a denial-of-service condition.
Recommended action: Upgrade to 5.1.6 or 3.3.18 by release line, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.
When nanoid is called with a fractional value, there were a number of undesirable effects: 1. in browser and non-secure, the code infinite loops on while (size--) 2. in node, the value of poolOffset becomes fractional, causing calls to nanoid to return zeroes until the pool is next filled 3. if the first call in node is a fractional argument, the initial buffer allocation fails with an error Version 3.3.8 and 5.0.9 are fixed.
Recommended action: Upgrade to 5.0.9 or 3.3.8 by release line, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.
The package nanoid from 3.0.0, before 3.1.31, are vulnerable to Information Exposure via the valueOf() function which allows to reproduce the last id generated.
Recommended action: Upgrade to 3.1.31 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.