{"id":"UBUNTU-CVE-2021-23566","details":"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.","modified":"2026-05-20T16:04:48.899577617Z","published":"2022-01-14T20:15:00Z","upstream":["CVE-2021-23566"],"references":[{"type":"REPORT","url":"https://ubuntu.com/security/CVE-2021-23566"},{"type":"REPORT","url":"https://github.com/ai/nanoid/pull/328"},{"type":"REPORT","url":"https://snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-2332550"},{"type":"REPORT","url":"https://gist.github.com/artalar/bc6d1eb9a3477d15d2772e876169a444"},{"type":"REPORT","url":"https://snyk.io/vuln/SNYK-JS-NANOID-2332193"},{"type":"REPORT","url":"https://github.com/ai/nanoid/commit/2b7bd9332bc49b6330c7ddb08e5c661833db2575"},{"type":"REPORT","url":"https://www.cve.org/CVERecord?id=CVE-2021-23566"}],"affected":[{"package":{"name":"node-mocha","ecosystem":"Ubuntu:16.04:LTS","purl":"pkg:deb/ubuntu/node-mocha?arch=source&distro=xenial"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.20.1-1","1.20.1-2"],"ecosystem_specific":{"binaries":[{"binary_version":"1.20.1-2","binary_name":"libjs-mocha"},{"binary_version":"1.20.1-2","binary_name":"mocha"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-23566.json"}},{"package":{"name":"node-mocha","ecosystem":"Ubuntu:18.04:LTS","purl":"pkg:deb/ubuntu/node-mocha?arch=source&distro=bionic"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.20.1-7"],"ecosystem_specific":{"binaries":[{"binary_name":"libjs-mocha","binary_version":"1.20.1-7"},{"binary_version":"1.20.1-7","binary_name":"mocha"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-23566.json"}},{"package":{"name":"node-mocha","ecosystem":"Ubuntu:20.04:LTS","purl":"pkg:deb/ubuntu/node-mocha?arch=source&distro=focal"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["4.1.0+ds3-5","7.0.1+ds1-2"],"ecosystem_specific":{"binaries":[{"binary_name":"mocha","binary_version":"7.0.1+ds1-2"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-23566.json"}},{"package":{"name":"node-postcss","ecosystem":"Ubuntu:20.04:LTS","purl":"pkg:deb/ubuntu/node-postcss?arch=source&distro=focal"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["6.0.23-1","6.0.23-3"],"ecosystem_specific":{"binaries":[{"binary_name":"node-postcss","binary_version":"6.0.23-3"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-23566.json"}},{"package":{"name":"node-mocha","ecosystem":"Ubuntu:22.04:LTS","purl":"pkg:deb/ubuntu/node-mocha?arch=source&distro=jammy"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["8.2.1+ds1+~cs29.4.27-3","9.1.3+ds1+~cs31.2.38-1","9.2.0+ds1+~cs28.3.8-1","9.2.1+ds1+~cs28.3.8-1"],"ecosystem_specific":{"binaries":[{"binary_version":"9.2.1+ds1+~cs28.3.8-1","binary_name":"mocha"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-23566.json"}},{"package":{"name":"node-postcss","ecosystem":"Ubuntu:22.04:LTS","purl":"pkg:deb/ubuntu/node-postcss?arch=source&distro=jammy"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["8.2.1+~cs5.3.23-8","8.4.5+~cs7.1.51-2","8.4.6+~cs7.3.21-1"],"ecosystem_specific":{"binaries":[{"binary_name":"node-postcss","binary_version":"8.4.6+~cs7.3.21-1"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-23566.json"}},{"package":{"name":"node-mocha","ecosystem":"Ubuntu:24.04:LTS","purl":"pkg:deb/ubuntu/node-mocha?arch=source&distro=noble"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["10.2.0+ds1+~cs29.5.1-1","10.4.0+ds1+~cs33.1.8-1"],"ecosystem_specific":{"binaries":[{"binary_version":"10.4.0+ds1+~cs33.1.8-1","binary_name":"mocha"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-23566.json"}},{"package":{"name":"node-postcss","ecosystem":"Ubuntu:24.04:LTS","purl":"pkg:deb/ubuntu/node-postcss?arch=source&distro=noble"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["8.4.20+~cs8.0.23-1","8.4.31+~cs8.0.26-1"],"ecosystem_specific":{"binaries":[{"binary_name":"node-postcss","binary_version":"8.4.31+~cs8.0.26-1"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-23566.json"}},{"package":{"name":"node-mocha","ecosystem":"Ubuntu:25.10","purl":"pkg:deb/ubuntu/node-mocha?arch=source&distro=questing"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["10.7.2+ds1+~cs33.1.11-2"],"ecosystem_specific":{"binaries":[{"binary_name":"mocha","binary_version":"10.7.2+ds1+~cs33.1.11-2"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-23566.json"}},{"package":{"name":"node-postcss","ecosystem":"Ubuntu:25.10","purl":"pkg:deb/ubuntu/node-postcss?arch=source&distro=questing"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["8.4.49+~cs9.2.32-1","8.5.6+~cs9.3.28-1"],"ecosystem_specific":{"binaries":[{"binary_name":"node-postcss","binary_version":"8.5.6+~cs9.3.28-1"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-23566.json"}},{"package":{"name":"node-mocha","ecosystem":"Ubuntu:26.04:LTS","purl":"pkg:deb/ubuntu/node-mocha?arch=source&distro=resolute"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["10.7.2+ds1+~cs33.1.11-2","11.7.2+ds1+~cs36.3.14-2build1","11.7.5+ds1+~cs36.3.14-2"],"ecosystem_specific":{"binaries":[{"binary_name":"mocha","binary_version":"11.7.5+ds1+~cs36.3.14-2"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-23566.json"}},{"package":{"name":"node-postcss","ecosystem":"Ubuntu:26.04:LTS","purl":"pkg:deb/ubuntu/node-postcss?arch=source&distro=resolute"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["8.5.6+~cs9.3.28-1","8.5.8+~cs9.3.30-1"],"ecosystem_specific":{"binaries":[{"binary_name":"node-postcss","binary_version":"8.5.8+~cs9.3.30-1"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-23566.json"}}],"schema_version":"1.7.5","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N"},{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N"},{"type":"Ubuntu","score":"medium"}]}