Tuesday June 20 2023 Security Releases

Rafael Gonzaga

(Update 20-June-2023) Security releases available

Updates are now available for all supported Node.js release lines for the following issues.

OpenSSL Security updates

This security release includes the following OpenSSL security updates

Impacts:

  • All versions of the 20.x, 18.x, and 16.x release lines.

c-ares Security updates

This security release includes c-ares security updates as outlined in the recent advisories:

Impacts:

  • All versions of the 20.x, 18.x, and 16.x release lines.

mainModule.proto bypass experimental policy mechanism (High) (CVE-2023-30581)

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: 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.

Thank you, to Axel Chong for reporting this vulnerability and thank you Rafael Gonzaga for fixing it.

Path traversal bypass in experimental permission model (High) (CVE-2023-30584)

A vulnerability has been discovered in Node.js version 20, specifically within the experimental permission model. This flaw relates to improper handling of path traversal bypass when verifying file permissions.

This vulnerability affects all users using the experimental permission model in Node.js 20.

Please note that at the time this CVE was issued, the permission model is an experimental feature of Node.js.

Thank you, to Axel Chong for reporting this vulnerability and thank you Rafael Gonzaga for fixing it.

Inspector protocol bypass the experimental permission model (High) (CVE-2023-30587)

A vulnerability in Node.js version 20 allows for bypassing restrictions set by the --experimental-permission flag using the built-in inspector module (node:inspector).

By exploiting the Worker class's ability to create an "internal worker" with the kIsInternal Symbol, attackers can modify the isInternal value when an inspector is attached within the Worker constructor before initializing a new WorkerImpl.

This vulnerability exclusively affects Node.js users employing the permission model mechanism in Node.js 20.

Please note that at the time this CVE was issued, the permission model is an experimental feature of Node.js.

Thank you, to mattaustin for reporting this vulnerability and thank you Rafael Gonzaga for fixing it.

fs.watchFile bypass in experimental permission model (Medium) (CVE-2023-30582)

A vulnerability has been identified in Node.js version 20, affecting users of the experimental permission model when the --allow-fs-read flag is used with a non-* argument.

This flaw arises from an inadequate permission model that fails to restrict file watching through the fs.watchFile API. As a result, malicious actors can monitor files that they do not have explicit read access to.

This vulnerability affects all users using the experimental permission model in Node.js 20.

Please note that at the time this CVE was issued, the permission model is an experimental feature of Node.js.

Thanks to Colin Ihrig for reporting this vulnerability and to Rafael Gonzaga for fixing it.

fs.openAsBlob bypass in experimental permission model (Medium) (CVE-2023-30583)

fs.openAsBlob() can bypass the experimental permission model when using the file system read restriction with the --allow-fs-read flag in Node.js 20. This flaw arises from a missing check in the fs.openAsBlob() API.

This vulnerability affects all users using the experimental permission model in Node.js 20.

Thanks to Colin Ihrig for reporting this vulnerability and to Rafael Gonzaga for fixing it.

Please note that at the time this CVE was issued, the permission model is an experimental feature of Node.js.

Privilege escalation via Malicious Registry Key manipulation during Node.js installer repair process (Medium) (CVE-2023-30585)

A vulnerability has been identified in the Node.js (.msi version) installation process, specifically affecting Windows users who install Node.js using the .msi installer. This vulnerability emerges during the repair operation, where the "msiexec.exe" process, running under the NT AUTHORITY\SYSTEM context, attempts to read the %USERPROFILE% environment variable from the current user's registry.

The issue arises when the path referenced by the %USERPROFILE% environment variable does not exist. In such cases, the "msiexec.exe" process attempts to create the specified path in an unsafe manner, potentially leading to the creation of arbitrary folders in arbitrary locations.

The severity of this vulnerability is heightened by the fact that the %USERPROFILE% environment variable in the Windows registry can be modified by standard (or "non-privileged") users. Consequently, unprivileged actors, including malicious entities or trojans, can manipulate the environment variable key to deceive the privileged "msiexec.exe" process. This manipulation can result in the creation of folders in unintended and potentially malicious locations.

It is important to note that this vulnerability is specific to Windows users who install Node.js using the .msi installer. Users who opt for other installation methods are not affected by this particular issue. This affects all active Node.js versions: v16, v18, and, v20.

Thank you, to @sim0nsecurity for reporting this vulnerability and thank you Tobias Nießen for fixing it.

OpenSSL engines can be used to bypass the permission model (Medium) (CVE-2023-30586)

Node.js 20 allows loading arbitrary OpenSSL engines when the experimental permission model is enabled, which can bypass and/or disable the permission model.

The crypto.setEngine() API can be used to bypass the permission model when called with a compatible OpenSSL engine. The OpenSSL engine can, for example, disable the permission model in the host process by manipulating the process's stack memory to locate the permission model Permission::enabled_ in the host process's heap memory.

This vulnerability affects all users using the experimental permission model in Node.js 20.

Please note that at the time this CVE was issued, the permission model is an experimental feature of Node.js.

Thanks to Tobias Nießen for reporting this vulnerability and fixing it.

Process interuption due to invalid Public Key information in x509 certificates (Medium) (CVE-2023-30588)

When an invalid public key is used to create an x509 certificate using the crypto.X509Certificate() API a non-expect termination occurs making it susceptible to DoS attacks when the attacker could force interruptions of application processing, as the process terminates when accessing public key info of provided certificates from user code. The current context of the users will be gone, and that will cause a DoS scenario.

This vulnerability affects all active Node.js versions v16, v18, and, v20.

Thank you, to Marc Schönefeld for reporting this vulnerability and thank you Tobias Nießen for fixing it.

HTTP Request Smuggling via Empty headers separated by CR (Medium) (CVE-2023-30589)

The llhttp parser in the http module in Node.js does not strictly use the CRLF sequence to delimit HTTP requests. This can lead to HTTP Request Smuggling (HRS).

The CR character (without LF) is sufficient to delimit HTTP header fields in the llhttp parser. According to RFC7230 section 3, only the CRLF sequence should delimit each header-field.

This vulnerability impacts all Node.js active versions: v16, v18, and, v20.

Thank you, to Yadhu Krishna M(Team bi0s & CRED Security team) for reporting this vulnerability and thank you Paolo Insogna for fixing it.

DiffieHellman do not generate keys after setting a private key (Medium) (CVE-2023-30590)

The generateKeys() API function returned from crypto.createDiffieHellman() only generates missing (or outdated) keys, that is, it only generates a private key if none has been set yet.

However, the documentation says this API call: "Generates private and public Diffie-Hellman key values".

The documented behavior is different from the actual behavior, and this difference could easily lead to security issues in applications that use these APIs as the DiffieHellman may be used as the basis for application-level security.

Please note that this is a documentation change an the vulnerability has been classified under CWE-1068 - Inconsistency Between Implementation and Documented Design. This change applies to all Node.js active versions: v16, v18, and, v20.

Thanks to Ben Smyth for reporting this vulnerability and to Tobias Nießen for fixing it.

Downloads & release details

Summary

The Node.js project will release new versions of the 16.x, 18.x and 20.x releases lines on or shortly after, Tuesday June 20 2023 in order to address:

Impact

The 20.x release line of Node.js is vulnerable to 7 medium severity issues, and 3 high severity issues.

The 18.x release line of Node.js is vulnerable to 4 medium severity issues, and 1 high severity issues.

The 16.x release line of Node.js is vulnerable to 4 medium severity issues, and 1 high severity issues.

All the active release lines will be patched with the OpenSSL security update and c-ares security update.

Release timing

Releases will be available on, or shortly after, Tuesday June 20 2023.

Contact and future updates

The current Node.js security policy can be found at https://nodejs.org/security/. Please follow the process outlined in https://github.com/nodejs/node/security/policy if you wish to report a vulnerability in Node.js.

Subscribe to the low-volume announcement-only nodejs-sec mailing list at https://groups.google.com/forum/#!forum/nodejs-sec to stay up to date on security vulnerabilities and security-related releases of Node.js and the projects maintained in the nodejs GitHub organization.