CVE-2023-32006: Permissions policies can impersonate other modules in using module.constructor.createRequire()

Published Aug 9, 2023
·
Updated

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

12 affected componentsFixes available
ubuntu/nodejs<12.22.9~dfsg-1ubuntu3.6
12.22.9~dfsg-1ubuntu3.6
ubuntu/nodejs<18.13.0+dfsg1-1ubuntu2.3
18.13.0+dfsg1-1ubuntu2.3
Nodejs Node.js>=16.0.0<=16.20.1
Nodejs Node.js>=18.0.0<=18.17.0
Nodejs Node.js>=20.0.0<=20.5.0
Fedoraproject Fedora=37
Fedoraproject Fedora=38
Node.js Node.js>=16.0.0<16.20.2, >=18.0.0<18.17.1, >=20.0.0<20.5.1
16.20.218.17.120.5.1
Node.js Node.js>=16.0.0<16.20.2
16.20.2
Node.js Node.js>=18.0.0<18.17.1
18.17.1
Node.js Node.js>=20.0.0<20.5.1
20.5.1
debian/nodejs
18.20.4+dfsg-1~deb12u218.20.4+dfsg-1~deb12u320.19.2+dfsg-1+deb13u220.19.2+dfsg-1+deb13u324.21.0+dfsg+~cs24.13.4-124.22.2+dfsg+~cs24.19.2-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade ubuntu/nodejs to a version that resolves this vulnerability.

    Fixed in 12.22.9~dfsg-1ubuntu3.6
  2. Upgrade

    Upgrade ubuntu/nodejs to a version that resolves this vulnerability.

    Fixed in 18.13.0+dfsg1-1ubuntu2.3
  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
  4. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 16.20.2
  5. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 18.17.1
  6. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 20.5.1
  7. Upgrade

    Upgrade debian/nodejs to 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

Aug 9, 2023
CVE Published
via Node.js·02:30 PM
Data Sourced
via Node.js·02:30 PM
DescriptionSeverityAffected Software
Aug 10, 2023
Data Sourced
via Red Hat·10:04 AM
DescriptionSeverityAffected Software
Aug 15, 2023
CVE Published
via MITRE·03:10 PM
Data Sourced
via MITRE·03:10 PM
Description
Data Sourced
via NVD·04:15 PM
DescriptionSeverityWeaknessAffected Software
Dec 13, 2023
Data Sourced
via IBM·12:00 AM
DescriptionSeverityAffected Software

Frequently Asked Questions

1

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.

2

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.

3

What is the severity of CVE-2023-32006?

CVE-2023-32006 has a severity rating of 8.8 (high).

4

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.

5

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/)

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203