Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
📦
📦 npm
Not in CISA KEV
MEDIUM severity

CVE-2021-23566 — nanoid

MEDIUMFix: ai/nanoid@2b7bd93

CVE-2021-23566 is a medium-severity (CVSS 5.5) CWE-704 vulnerability in nanoid. 4 public exploit references exist, so weaponization risk is real. A fix is available for nanoid — see the affected versions and patch details below.

Exposure of Sensitive Information to an Unauthorized Actor in nanoid

Also known asGHSA-qrpm-p2h7-hrv2
Published
Updated
Affected
1 pkg
Patched
1 / 1
Exploits
4 known
Exploitation data as of Oct 10, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

EPSS Exploitation Probability

via FIRST.org ↗
0.4%probability of exploitation in next 30 days
Lower Risk0.00%
Lower risk than most CVEs36th percentile — riskier than 36% of all scored CVEsHighest risk
0.00%0.31%0.63%0.94%0.0%0.4%Apr 26Aug 26Oct 26

Probability of exploitation in the next 30 days, from FIRST.org EPSS.

How urgent is this, really

CVE-2021-23566 by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.

Where this sits among everything scored

Of 385,386 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Counts from FIRST.org, log-scaled.

Real-World Exposure

1 pkg affected

How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.

18Kother npm packages depend on this — each one inherits the vulnerability until it's patched upstream
nanoidnpm
272.3Mdownloads / week

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

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
📦npmnanoid≥ 3.0.0&&< 3.1.313.1.31npm install nanoid@3.1.31

Affected Products

1 product · 1 configurations
Application
nanoidnanoid_project
≥ 3.0.0 && < 3.1.31
range
Exploits & PoCs
4

Research use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for nanoid, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update nanoid to 3.1.31 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2021-23566 is resolved across your whole dependency graph.

  3. Workarounds

    Assume what was exposed is already known: rotate any credential, token or key that the affected component could return, restrict the endpoint to callers that genuinely need it, and strip sensitive fields from responses and error output at the boundary rather than relying on the client not to read them.

Fixing This On Your OS

If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.

Red HatModerate
ProductFixed inAdvisory
Red Hat OpenShift Container Platform 4.11openshift4/ose-thanos-rhel8:v4.11.0-202208020235.p0.gf08da2d.assembly.streamRHSA-2022:5069
Red Hat OpenShift Data Foundation 4.11 on RHEL8odf4/mcg-core-rhel8:v4.11.0-30RHSA-2022:6156

Frequently Asked Questions

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.
O3 Security · Impact-Aware SCA

Is CVE-2021-23566 in your dependencies?

Find it across npm, including transitive dependencies.

CVE-2021-23566: nanoid Info Disclosure — Fixed in 3.1.31