Vulnerability · Published Jan 14, 2022 · Assigned by snyk
CVE-2021-23566Information Exposure
Medium 4.0
In plain English
A medium-severity security flaw in nanoid. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.4% (higher than 38% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Severity (CVSS 3.1)4.0Medium
Exploit odds (30 days)0.4%top 61.6% of all CVEs
Exploited in the wildNo reportsnot in CISA KEV
Attack toolingNoneno public tooling known
Official description
The package nanoid from 3.0.0 and before 3.1.31 are vulnerable to Information Exposure via the valueOf() function which allows to reproduce the last id generated.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | node-mocha | 9.1.4+ds1+~cs28.2.8-1 | DEBIAN-CVE-2021-23566 |
| Debian:13 | node-mocha | 9.1.4+ds1+~cs28.2.8-1 | DEBIAN-CVE-2021-23566 |
| Debian:14 | node-mocha | 9.1.4+ds1+~cs28.2.8-1 | DEBIAN-CVE-2021-23566 |
| Debian:12 | node-postcss | 8.4.5+~cs7.1.51-1 | DEBIAN-CVE-2021-23566 |
| Debian:13 | node-postcss | 8.4.5+~cs7.1.51-1 | DEBIAN-CVE-2021-23566 |
| Debian:14 | node-postcss | 8.4.5+~cs7.1.51-1 | DEBIAN-CVE-2021-23566 |
| Ubuntu:22.04:LTS | node-mocha | no fix listed | UBUNTU-CVE-2021-23566 |
| Ubuntu:24.04:LTS | node-mocha | no fix listed | UBUNTU-CVE-2021-23566 |
| Ubuntu:25.10 | node-mocha | no fix listed | UBUNTU-CVE-2021-23566 |
| Ubuntu:26.04:LTS | node-mocha | no fix listed | UBUNTU-CVE-2021-23566 |
| Ubuntu:26.10 | node-mocha | no fix listed | UBUNTU-CVE-2021-23566 |
| Ubuntu:22.04:LTS | node-postcss | no fix listed | UBUNTU-CVE-2021-23566 |
| Ubuntu:24.04:LTS | node-postcss | no fix listed | UBUNTU-CVE-2021-23566 |
| Ubuntu:25.10 | node-postcss | no fix listed | UBUNTU-CVE-2021-23566 |
| Ubuntu:26.04:LTS | node-postcss | no fix listed | UBUNTU-CVE-2021-23566 |
| Ubuntu:26.10 | node-postcss | no fix listed | UBUNTU-CVE-2021-23566 |
| npm | nanoid | 3.1.31 | GHSA-qrpm-p2h7-hrv2 |
Affected products (as reported)
References
- https://snyk.io/vuln/SNYK-JS-NANOID-2332193 x_refsource_MISC
- https://snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-2332550 x_refsource_MISC
- https://gist.github.com/artalar/bc6d1eb9a3477d15d2772e876169a444 x_refsource_MISC
- https://github.com/ai/nanoid/commit/2b7bd9332bc49b6330c7ddb08e5c661833db2575 x_refsource_MISC
- https://github.com/ai/nanoid/pull/328 x_refsource_MISC
- https://lists.debian.org/debian-lts-announce/2025/01/msg00006.html
- https://lists.debian.org/debian-lts-announce/2024/12/msg00025.html