CVE-2023-30581: mainModule.proto bypass experimental policy mechanism
A vulnerability has been discovered in Node.js, where the use of proto in process.mainModule.proto.require() can bypass the policy mechanism and require modules outside of the policy.json definition.
Other sources
Node.js could allow a remote attacker to bypass security restrictions, caused by the use of proto in process.mainModule.proto.require(). By sending a specially crafted request, an attacker could exploit this vulnerability to bypass experimental policy mechanism.
— IBM
The use of proto in process.mainModule.proto.require() can bypass the policy mechanism and require modules outside of the policy.json definition. This vulnerability affects all users using the experimental policy mechanism in all active release lines: v16, v18 and, v20.
Please note that at the time this CVE was issued, the policy is an experimental feature of Node.js
— MITRE
The use of proto in process.mainModule.proto.require() can bypass the policy mechanism and require modules outside of the policy.json definition.
Please note that at the time this CVE was issued, the policy is an experimental feature of Node.js.
— Node.Js
The use of proto in process.mainModule.proto.require() can bypass the policy mechanism and require modules outside of the policy.json definition.
References: https://nodejs.org/en/blog/vulnerability/june-2023-security-releases
— Red Hat
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
redhat/nodejsto a version that resolves this vulnerability.Fixed in 18-9020020230717125503.rhel9 - Upgrade
Upgrade
redhat/nodejsto a version that resolves this vulnerability.Fixed in 1:16.20.1-1.el9_2 - Upgrade
Upgrade
redhat/nodejsto a version that resolves this vulnerability.Fixed in 1:16.20.2-1.el9_0 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 16.20.1Fixed in 18.16.1Fixed in 20.3.1 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 16.20.1 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 18.16.1 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 20.3.1 - Upgrade
Upgrade
debian/nodejsto a version that resolves this vulnerability.Fixed in 18.19.0+dfsg-6~deb12u1Fixed in 18.13.0+dfsg1-1.1
Event History
Parent advisories
This vulnerability appears in the following advisories.
Frequently Asked Questions
What is CVE-2023-30581?
CVE-2023-30581 is a vulnerability that allows the use of __proto__ to bypass the policy mechanism in Node.js.
What is the severity of CVE-2023-30581?
The severity of CVE-2023-30581 is high with a score of 7.5.
What software is affected by CVE-2023-30581?
Node.js versions 16, 18, and 20 are affected by CVE-2023-30581.
How can CVE-2023-30581 be exploited?
CVE-2023-30581 can be exploited by using __proto__ in process.mainModule.__proto__.require() to require modules outside of the policy.json definition.
How can I fix CVE-2023-30581?
To fix CVE-2023-30581, it is recommended to update to the latest version of Node.js or apply the appropriate patches provided by the vendor.