{"answers":{"affected":"2 open source packages ship an affected version, including nanoid. It affects 1 product.","exploited":"There is no known exploitation of CVE-2021-23566 in the wild and no public exploit code.","fix":"Upgrade nanoid to 3.1.31 or later.","what":"CVE-2021-23566 is a medium-severity vulnerability in nanoid, published on 14 Jan 2022. It can only be exploited from the same machine or local network, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2021-23566 and fix it if it is affected.\n\nWhat it is: CVE-2021-23566 is a medium-severity vulnerability in nanoid, published on 14 Jan 2022. It can only be exploited from the same machine or local network, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2021-23566 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- nanoid (npm): affected from 3.0.0; fixed in 3.1.31\n- nanoid (npm): affected from 3.0.0; fixed in 3.1.31\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2021-23566/ (Markdown: https://insights.sbomify.com/CVE-2021-23566/index.md)","id":"CVE-2021-23566","markdown":"https://insights.sbomify.com/CVE-2021-23566/index.md","name":"CVE-2021-23566","record":{"aliases":["DEBIAN-CVE-2021-23566","GHSA-qrpm-p2h7-hrv2","UBUNTU-CVE-2021-23566"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["data_read"],"network_reachable":"adjacent_or_local","non_default_config":false,"product_category":"JavaScript ID generator","requires_auth":"none","summary":"Attackers can reproduce the last generated ID via the valueOf function, leading to information exposure in applications using the nanoid library.","user_interaction":"not_required","vuln_class":"information_disclosure"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"snyk","cpe":[{"product":"nanoid","vendor":"nanoid_project"}],"cvss":{"score":4,"severity":"medium","source":"cna","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N/E:P","version":"3.1"},"cwes":[{"id":"CWE-704","name":"Incorrect Type Conversion or Cast"}],"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.","ecosystems":["npm"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"Information Exposure","id":"CVE-2021-23566","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"npm","product":null,"products":[],"type":"information_disclosure","year":"2021"},"n_packages":2,"n_references":5,"next":{"headline":"Denial of Service (DoS)","id":"CVE-2021-23567"},"packages":[{"ecosystem":"npm","fixed":["3.1.31"],"introduced":["3.0.0"],"last_affected":[],"package":"nanoid","purl":null,"source":"GHSA-qrpm-p2h7-hrv2"},{"ecosystem":"npm","fixed":["3.1.31"],"introduced":["3.0.0"],"last_affected":[],"package":"nanoid","purl":"pkg:npm/nanoid","source":"GHSA-qrpm-p2h7-hrv2"}],"prev":{"headline":"Arbitrary File Upload","id":"CVE-2021-23562"},"products":["nanoid"],"published":"2022-01-14","related":[{"cvss_score":8.2,"headline":"nanoid before 5.1.6 Infinite Loop via Zero Size in customAlphabet and customRandom","id":"CVE-2026-67213","kev_date_added":null,"published":"2026-07-29"},{"cvss_score":8.2,"headline":"nanoid Infinite Loop via Negative Size in non-secure module","id":"CVE-2026-67214","kev_date_added":null,"published":"2026-07-29"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":"PUBLISHED","updated":"2025-11-03","vendors":["n/a"]},"summary":"Attackers can reproduce the last generated ID via the valueOf function, leading to information exposure in applications using the nanoid library.","url":"https://insights.sbomify.com/CVE-2021-23566/"}