CVE-2023-32006: Permissions policies can impersonate other modules in using module.constructor.createRequire()
Node.js could allow a remote attacker to bypass security restrictions, caused by the use of module.constructor.createRequire(). By sending a specially crafted request, an attacker could exploit this vulnerability to bypass the permission policy mechanism.
Other sources
The use of module.constructor.createRequire() can bypass the policy mechanism and require modules outside of the policy.json definition for a given module. This vulnerability affects all users using the experimental policy mechanism in all active release lines: 16.x, 18.x, and, 20.x. Please note that at the time this CVE was issued, the policy is an experimental feature of Node.js.
— Ubuntu
The use of module.constructor.createRequire() can bypass the policy mechanism and require modules outside of the policy.json definition for a given module.
— Node.Js
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
ubuntu/nodejsto a version that resolves this vulnerability.Fixed in 12.22.9~dfsg-1ubuntu3.6 - Upgrade
Upgrade
ubuntu/nodejsto a version that resolves this vulnerability.Fixed in 18.13.0+dfsg1-1ubuntu2.3 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 16.20.2Fixed in 18.17.1Fixed in 20.5.1 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 16.20.2 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 18.17.1 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 20.5.1 - Upgrade
Upgrade
debian/nodejsto a version that resolves this vulnerability.Fixed in 18.20.4+dfsg-1~deb12u2Fixed in 18.20.4+dfsg-1~deb12u3Fixed in 20.19.2+dfsg-1+deb13u2Fixed in 20.19.2+dfsg-1+deb13u3Fixed in 24.21.0+dfsg+~cs24.13.4-1Fixed in 24.22.2+dfsg+~cs24.19.2-1
Event History
Parent advisories
This vulnerability appears in the following advisories.
Frequently Asked Questions
What is CVE-2023-32006?
CVE-2023-32006 refers to a vulnerability that allows the bypassing of the policy mechanism in Node.js, potentially allowing modules to be required outside of the defined policy.
Who is affected by CVE-2023-32006?
This vulnerability affects all users of Node.js who are using the experimental policy mechanism in versions 16.x, 18.x, and 20.x.
What is the severity of CVE-2023-32006?
CVE-2023-32006 has a severity rating of 8.8 (high).
How can CVE-2023-32006 be exploited?
CVE-2023-32006 can be exploited by utilizing the `module.constructor.createRequire()` function to require modules that are not defined in the policy.json file.
Are there any references for CVE-2023-32006?
Yes, you can find more information about CVE-2023-32006 at the following references: [Link1](https://hackerone.com/reports/2043807), [Link2](https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/JQPELKG2LVTADSB7ME73AV4DXQK47PWK/), [Link3](https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/PBOZE2QZIBLFFTYWYN23FGKN6HULZ6HX/)