CVE-2024-36137: fs.fchown/fchmod bypasses permission model
A vulnerability has been identified in Node.js, affecting users of the experimental permission model when the --allow-fs-write flag is used.
Node.js Permission Model do not operate on file descriptors, however, operations such as fs.fchown or fs.fchmod can use a "read-only" file descriptor to change the owner and permissions of a file.
This vulnerability affects all users using the experimental permission model in Node.js 20 and Node.js 21.
Please note that at the time this CVE was issued, the permission model is an experimental feature of Node.js.
Other sources
A vulnerability has been identified in Node.js, affecting users of the experimental permission model when the --allow-fs-write flag is used.
Node.js Permission Model do not operate on file descriptors, however, operations such as fs.fchown or fs.fchmod can use a "read-only" file descriptor to change the owner and permissions of a file.
Please note that at the time this CVE was issued, the permission model is an experimental feature of Node.js.
— Node.Js
A vulnerability has been identified in Node.js, affecting users of the experimental permission model when the --allow-fs-write flag is used.
Node.js Permission Model do not operate on file descriptors, however, operations such as fs.fchown or fs.fchmod can use a "read-only" file descriptor to change the owner and permissions of a file.
This vulnerability affects all users using the experimental permission model in Node.js 20 and Node.js 22.
— Red Hat
Node.js could allow a remote attacker to bypass security restrictions, caused by an error when the --allow-fs-write flag is used. An attacker could exploit this vulnerability using a "read-only" file descriptor to change the owner and permissions of a file.
— IBM
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 20.15.1Fixed in 22.4.1 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 20.15.1 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 22.4.1 - Upgrade
Upgrade
alpine/nodejsto a version that resolves this vulnerability.Fixed in 20.15.1-r0 - Upgrade
Upgrade
debian/nodejsto a version that resolves this vulnerability.Fixed in 20.15.1+dfsg-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 the severity of CVE-2024-36137?
CVE-2024-36137 has been classified as a high severity vulnerability affecting the Node.js experimental permission model.
How do I fix CVE-2024-36137?
To mitigate CVE-2024-36137, avoid using the --allow-fs-write flag with the experimental permission model in Node.js.
Who is affected by CVE-2024-36137?
CVE-2024-36137 affects users of IBM Planning Analytics versions up to 2.1 and 2.0 that utilize Node.js.
What are the implications of CVE-2024-36137?
The implications of CVE-2024-36137 include potential unauthorized changes to file ownership and permissions through the affected Node.js functionalities.
Is there a workaround for CVE-2024-36137?
A temporary workaround for CVE-2024-36137 is to refrain from using experimental features with file write permissions until a patch is available.