Node.js Vulnerability in Experimental Permission Model - CVE-2024-36137
Summary
UBUNTU-CVE-2024-36137: A vulnerability has been identified in Node.js, affecting users of the experimental permission model when the --allow-fs-write flag is used. Affects nodejs versions < 20.16.0+dfsg-1ubuntu1. Fixed in 20.16.0+dfsg-1ubuntu1. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
Node.js is a popular open-source runtime environment that allows developers to execute JavaScript code server-side. It is widely used for building scalable network applications. The package in question, 'nodejs', provides the core functionality of Node.js, including APIs for file system operations, networking, and more. This vulnerability affects users who utilize the experimental permission model with the --allow-fs-write flag, which is designed to enhance security by controlling file system access.
Vulnerability Detail
A vulnerability has been identified in Node.js related to its experimental permission model. When the --allow-fs-write flag is used, the permission model does not operate on file descriptors. This allows operations such as fs.fchown or fs.fchmod to exploit a 'read-only' file descriptor to change the owner and permissions of a file. This could lead to unauthorized access or modification of files, posing a significant security risk to applications relying on this feature.
How To Fix
Minimum fixed version
20.16.0+dfsg-1ubuntu1
This is the first release that contains the fix.
sudo apt-get install --only-upgrade nodejs
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, users can avoid using the --allow-fs-write flag in their Node.js applications until they can update to the patched version.
Conclusion
The vulnerability CVE-2024-36137 in Node.js poses a significant risk to applications using the experimental permission model with the --allow-fs-write flag. It is crucial for users to update to the patched version to mitigate this risk. Additionally, utilizing tools like Vulert can help monitor for such vulnerabilities in real-time.
See every vulnerability recorded for nodejs →
FAQ
CVE-2024-36137 is a vulnerability in Node.js that affects the experimental permission model when the --allow-fs-write flag is used.
This vulnerability can allow unauthorized changes to file ownership and permissions, potentially compromising the security of your application.
As a temporary measure, refrain from using the --allow-fs-write flag until you can update to the patched version.
You can find detailed information about CVE-2024-36137 in the official Ubuntu security notices or on the CVE database.
You can use Vulert, which monitors and alerts in real-time for open-source vulnerabilities using just a manifest file like package-lock.json.
Related vulnerabilities
Recent vulnerabilities recorded for nodejs.