Advisory Database
  • Advisories
  • Dependency Scanning
  1. npm
  2. ›
  3. nanoid
  4. ›
  5. CVE-2021-23566

CVE-2021-23566: Exposure of Sensitive Information to an Unauthorized Actor in nanoid

January 21, 2022 (updated November 4, 2025)

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.

References

  • gist.github.com/artalar/bc6d1eb9a3477d15d2772e876169a444
  • github.com/advisories/GHSA-qrpm-p2h7-hrv2
  • github.com/ai/nanoid
  • github.com/ai/nanoid/commit/2b7bd9332bc49b6330c7ddb08e5c661833db2575
  • github.com/ai/nanoid/pull/328
  • lists.debian.org/debian-lts-announce/2024/12/msg00025.html
  • lists.debian.org/debian-lts-announce/2025/01/msg00006.html
  • nvd.nist.gov/vuln/detail/CVE-2021-23566
  • snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-2332550
  • snyk.io/vuln/SNYK-JS-NANOID-2332193

Code Behaviors & Features

Detect and mitigate CVE-2021-23566 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 3.0.0 before 3.1.31

Fixed versions

  • 3.1.31

Solution

Upgrade to version 3.1.31 or above.

Impact 4 MEDIUM

CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N

Learn more about CVSS

Weakness

  • CWE-200: Exposure of Sensitive Information to an Unauthorized Actor
  • CWE-704: Incorrect Type Conversion or Cast

Source file

npm/nanoid/CVE-2021-23566.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sun, 07 Dec 2025 12:18:38 +0000.