nanoid vulnerabilities

A tiny (117 bytes), secure URL-friendly unique string ID generator

Registry
npm
Latest
6.0.2
License
MIT

5 known advisories

The latest version, 6.0.2, is not affected by any of them. Projects on older versions may be.

Update to the latest version:npm install nanoid@6.0.2

Is your project on an affected nanoid?

Private repo? Upload its lockfile instead, or connect GitHub to check every repo.

Look after several JavaScript apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie

Security advisories for nanoid

  • HighCVE-2026-73086GHSA-xwg4-73v4-xw9w1 Sept 2026

    nanoid: Integer Overflow or Wraparound

    Affected
    <3.3.12 · >=4.0.0 <5.1.11
    Fixed in
    3.3.12, 5.1.11
  • HighCVE-2026-67214GHSA-28wg-ghj8-5hjv29 Jul 2026

    nanoid: non-secure generators can loop indefinitely with negative size

    Affected
    <3.3.16 · >=4.0.0 <5.1.16
    Fixed in
    3.3.16, 5.1.16
  • HighCVE-2026-67213GHSA-2v37-7h3g-55p829 Jul 2026

    nanoid: custom generators can loop indefinitely when size is zero

    Affected
    <3.3.18 · >=4.0.0 <5.1.6
    Fixed in
    3.3.18, 5.1.6
  • MediumCVE-2024-55565GHSA-mwcw-c2x4-8c559 Dec 2024

    Predictable results in nanoid generation when given non-integer values

    Affected
    >=4.0.0 <5.0.9 · <3.3.8
    Fixed in
    3.3.8, 5.0.9
  • MediumCVE-2021-23566GHSA-qrpm-p2h7-hrv221 Jan 2022

    Exposure of Sensitive Information to an Unauthorized Actor in nanoid

    Affected
    >=3.0.0 <3.1.31
    Fixed in
    3.1.31

Is your nanoid version vulnerable?

Which of your client projects still run an old nanoid?

NPMscan reads the package-lock.json, yarn.lock and pnpm-lock.yaml in every GitHub repo you pick and checks each installed version against these advisories, including the packages your packages pull in. Each finding comes with the command that fixes it.

Other npm packages

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily. Package details from the npm registry.