MediumGHSA-qrpm-p2h7-hrv2CVE-2021-23566
Exposure of Sensitive Information to an Unauthorized Actor in nanoid
Published 21 Jan 2022 · Updated 4 Nov 2025
Affected package
nanoidnpm
- Affected
- >=3.0.0 <3.1.31
- Fixed in
- 3.1.31
Update to the fixed version for your release line, for example:
npm install nanoid@3.1.31Details
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.
Is GHSA-qrpm-p2h7-hrv2 in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected nanoid, and gives you the command that fixes it.
References
- Advisorynvd.nist.gov/vuln/detail/CVE-2021-23566
- Linkgithub.com/ai/nanoid/pull/328
- Linkgithub.com/ai/nanoid/commit/2b7bd9332bc49b6330c7ddb08e5c661833db2575
- Linkgist.github.com/artalar/bc6d1eb9a3477d15d2772e876169a444
- Packagegithub.com/ai/nanoid
- Linklists.debian.org/debian-lts-announce/2024/12/msg00025.html
- Linklists.debian.org/debian-lts-announce/2025/01/msg00006.html
- Linksnyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-2332550
- Linksnyk.io/vuln/SNYK-JS-NANOID-2332193
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.