CVE-2024-36137
Low · 3.3CVSS
3.3
EPSS
0.4%
Published
Sep 7, 2024
CISA due date
—
Cloudanix analysis
A file access control feature fails to block certain permission changes, so users who should only be able to read files can still alter who owns them or what they can do.
- Exploitation
- Local Privilege
- Attacker needs
- Low Privilege
- Complexity
- Low
- Impact
- Data Tampering
- Component
- Application
- Class
- Authorization Bypass
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
The experimental permission model in Node.js does not enforce restrictions on file descriptor operations; when --allow-fs-write is used, calls such as fs.fchown and fs.fchmod on a read-only file descriptor can still alter file ownership and permissions.
Why it matters to the business
Limited write access intended by the permission model can be bypassed, allowing unauthorized changes to file metadata that may enable further system modifications or access escalation.
How an attack unfolds
An attacker obtains a read-only file descriptor through allowed operations, then invokes fs.fchown or fs.fchmod on that descriptor to modify ownership or permissions of the underlying file, bypassing the permission model's intended restrictions.
How to fix it
Upgrade Node.js to a version that enforces permission checks on file descriptor operations; apply the equivalent fixes listed for affected packages where applicable.
How to confirm the fix worked
Confirm the installed Node.js version includes permission model enforcement on file descriptors; test that fs.fchown and fs.fchmod on read-only descriptors are denied under --allow-fs-write.
Typical attack path
- Obtain a file descriptor via permitted read-only operations under the --allow-fs-write flag
- Call fs.fchown or fs.fchmod using the read-only descriptor
- Modify file ownership or permissions without explicit write authorization
- Leverage altered permissions for subsequent unauthorized actions
How to detect it
Review application and system logs for unexpected fs.fchown or fs.fchmod calls on descriptors opened with limited permissions; inspect file metadata changes that occur without corresponding write operations in audit trails.
What your security team should do
- Disable the experimental permission model until fixed versions are deployed if feasible
- Audit all uses of --allow-fs-write and restrict to minimal necessary paths
- Monitor for unexpected changes to file ownership or permissions in protected directories
- Plan upgrade to a patched Node.js release at the earliest maintenance window
The record
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.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| AlmaLinux:8 | nodejs | 0 | 1:20.16.0-1.module_el8.10.0+3882+e12e42db |
| AlmaLinux:8 | nodejs-devel | 0 | 1:20.16.0-1.module_el8.10.0+3882+e12e42db |
| AlmaLinux:8 | nodejs-docs | 0 | 1:20.16.0-1.module_el8.10.0+3882+e12e42db |
| AlmaLinux:8 | nodejs-full-i18n | 0 | 1:20.16.0-1.module_el8.10.0+3882+e12e42db |
| AlmaLinux:8 | nodejs-nodemon | 0 | 3.0.1-1.module_el8.9.0+3731+490e3ce5 |
| AlmaLinux:8 | nodejs-packaging | 0 | 2021.06-4.module_el8.9.0+3775+d8460d35 |
| AlmaLinux:8 | nodejs-packaging-bundler | 0 | 2021.06-4.module_el8.9.0+3775+d8460d35 |
| AlmaLinux:8 | npm | 0 | 1:10.8.1-1.20.16.0.1.module_el8.10.0+3882+e12e42db |
| AlmaLinux:9 | nodejs | 0 | 1:20.16.0-1.module_el9.4.0+107+dbd477e4 |
| AlmaLinux:9 | nodejs-devel | 0 | 1:20.16.0-1.module_el9.4.0+107+dbd477e4 |
| AlmaLinux:9 | nodejs-docs | 0 | 1:20.16.0-1.module_el9.4.0+107+dbd477e4 |
| AlmaLinux:9 | nodejs-full-i18n | 0 | 1:20.16.0-1.module_el9.4.0+107+dbd477e4 |
| AlmaLinux:9 | nodejs-nodemon | 0 | 3.0.1-1.module_el9.3.0+47+c33bc288 |
| AlmaLinux:9 | nodejs-packaging | 0 | 2021.06-4.module_el9.3.0+88+29afeaa2 |
| AlmaLinux:9 | nodejs-packaging-bundler | 0 | 2021.06-4.module_el9.3.0+88+29afeaa2 |
| AlmaLinux:9 | npm | 0 | 1:10.8.1-1.20.16.0.1.module_el9.4.0+107+dbd477e4 |
| Alpine:v3.19 | nodejs | 0 | 20.15.1-r0 |
| Alpine:v3.20 | nodejs | 0 | 20.15.1-r0 |
| Alpine:v3.21 | nodejs | 0 | 20.15.1-r0 |
| Alpine:v3.22 | nodejs | 0 | 20.15.1-r0 |
| Bitnami | node | 20.0.0 | 20.15.1 |
| Bitnami | node-min | 20.0.0 | 20.15.1 |
| Bitnami | node-min | 20.0.0 | 20.18.1 |
| Chainguard | nodejs-21-doc | 0 | 21.7.3-r13 |
| Debian:13 | nodejs | 0 | 20.15.1+dfsg-1 |
| Mageia:9 | nodejs | 0 | 22.6.0-1.mga9 |
| Mageia:9 | yarnpkg | 0 | 1.22.22-0.10.8.2.1.mga9 |
| Red Hat:enterprise_linux:8::appstream | nodejs | 0 | 1:20.16.0-1.module+el8.10.0+22203+a88c8310 |
| Red Hat:enterprise_linux:8::appstream | nodejs-debuginfo | 0 | 1:20.16.0-1.module+el8.10.0+22203+a88c8310 |
| Red Hat:enterprise_linux:8::appstream | nodejs-debugsource | 0 | 1:20.16.0-1.module+el8.10.0+22203+a88c8310 |
| Red Hat:enterprise_linux:8::appstream | nodejs-devel | 0 | 1:20.16.0-1.module+el8.10.0+22203+a88c8310 |
| Red Hat:enterprise_linux:8::appstream | nodejs-docs | 0 | 1:20.16.0-1.module+el8.10.0+22203+a88c8310 |
| Red Hat:enterprise_linux:8::appstream | nodejs-full-i18n | 0 | 1:20.16.0-1.module+el8.10.0+22203+a88c8310 |
| Red Hat:enterprise_linux:8::appstream | nodejs-nodemon | 0 | 0:3.0.1-1.module+el8.9.0+20473+c4e3d824 |
| Red Hat:enterprise_linux:8::appstream | nodejs-packaging | 0 | 0:2021.06-4.module+el8.9.0+19519+e25b965a |
| Red Hat:enterprise_linux:8::appstream | nodejs-packaging-bundler | 0 | 0:2021.06-4.module+el8.9.0+19519+e25b965a |
| Red Hat:enterprise_linux:8::appstream | npm | 0 | 1:10.8.1-1.20.16.0.1.module+el8.10.0+22203+a88c8310 |
| Red Hat:enterprise_linux:9::appstream | nodejs | 0 | 1:20.16.0-1.module+el9.4.0+22197+9e60f127 |
| Red Hat:enterprise_linux:9::appstream | nodejs-debuginfo | 0 | 1:20.16.0-1.module+el9.4.0+22197+9e60f127 |
| Red Hat:enterprise_linux:9::appstream | nodejs-debugsource | 0 | 1:20.16.0-1.module+el9.4.0+22197+9e60f127 |
| Red Hat:enterprise_linux:9::appstream | nodejs-devel | 0 | 1:20.16.0-1.module+el9.4.0+22197+9e60f127 |
| Red Hat:enterprise_linux:9::appstream | nodejs-docs | 0 | 1:20.16.0-1.module+el9.4.0+22197+9e60f127 |
| Red Hat:enterprise_linux:9::appstream | nodejs-full-i18n | 0 | 1:20.16.0-1.module+el9.4.0+22197+9e60f127 |
| Red Hat:enterprise_linux:9::appstream | nodejs-nodemon | 0 | 0:3.0.1-1.module+el9.3.0.z+20478+84a9f781 |
| Red Hat:enterprise_linux:9::appstream | nodejs-packaging | 0 | 0:2021.06-4.module+el9.3.0+19518+63aad52d |
| Red Hat:enterprise_linux:9::appstream | nodejs-packaging-bundler | 0 | 0:2021.06-4.module+el9.3.0+19518+63aad52d |
| Red Hat:enterprise_linux:9::appstream | npm | 0 | 1:10.8.1-1.20.16.0.1.module+el9.4.0+22197+9e60f127 |
| Rocky Linux:8 | nodejs | 0 | 1:20.16.0-1.module+el8.10.0+1856+4cdb8df5 |
| Rocky Linux:8 | nodejs-nodemon | 0 | 0:3.0.1-1.module+el8.10.0+1666+930e28e8 |
| Rocky Linux:8 | nodejs-packaging | 0 | 0:2021.06-4.module+el8.10.0+1667+4a788d89 |
| Rocky Linux:9 | nodejs | 0 | 1:20.16.0-1.module+el9.4.0+25495+f51dca35 |
| Rocky Linux:9 | nodejs-nodemon | 0 | 0:3.0.1-1.module+el9.4.0+25495+f51dca35 |
| Rocky Linux:9 | nodejs-nodemon | 0 | 0:3.0.1-1.module+el9.6.0+32322+a8b1fd01 |
| Rocky Linux:9 | nodejs-packaging | 0 | 0:2021.06-4.module+el9.4.0+25495+f51dca35 |
| Rocky Linux:9 | nodejs-packaging | 0 | 0:2021.06-4.module+el9.5.0+31770+0da7192d |
| SUSE:Linux Enterprise Module for Web and Scripting 15 SP5 | nodejs20 | 0 | 20.15.1-150500.11.12.2 |
| SUSE:Linux Enterprise Module for Web and Scripting 15 SP6 | nodejs20 | 0 | 20.15.1-150600.3.3.2 |
| Ubuntu:20.04:LTS | nodejs | 0 | No fix |
| Ubuntu:22.04:LTS | nodejs | 0 | No fix |
| Ubuntu:24.04:LTS | nodejs | 0 | No fix |
| Ubuntu:24.10 | nodejs | 0 | No fix |
| Ubuntu:25.04 | nodejs | 0 | 20.16.0+dfsg-1ubuntu1 |
| Ubuntu:Pro:14.04:LTS | nodejs | 0 | No fix |
| Ubuntu:Pro:16.04:LTS | nodejs | 0 | No fix |
| Ubuntu:Pro:18.04:LTS | nodejs | 0 | No fix |
| Wolfi | nodejs-21-doc | 0 | 21.7.3-r13 |
| openSUSE:Leap 15.5 | nodejs20 | 0 | 20.15.1-150500.11.12.2 |
| openSUSE:Leap 15.6 | nodejs20 | 0 | 20.15.1-150600.3.3.2 |
| openSUSE:Tumbleweed | nodejs20 | 0 | 20.15.1-1.1 |
| openSUSE:Tumbleweed | nodejs22 | 0 | 22.10.0-1.1 |
| openSUSE:Tumbleweed | nodejs24 | 0 | 24.11.1-2.1 |
| openSUSE:Tumbleweed | nodejs26 | 0 | 26.3.1-1.1 |
Related vulnerabilities
- CVE-2025-6965 There exists a vulnerability in SQLite versions before 3.50.2 where the number of… Also affects nodejs
- CVE-2025-23085 A memory leak could occur when a remote peer abruptly closes the socket without sending a… Also affects nodejs
- CVE-2025-23083 With the aid of the diagnostics_channel utility, an event can be hooked into whenever a… Also affects nodejs
- CVE-2025-22150 Undici is an HTTP/1.1 client. Also affects nodejs
- CVE-2023-39333 Maliciously crafted export names in an imported WebAssembly module can inject JavaScript… Also affects nodejs
- CVE-2023-46809 Node.js versions which bundle an unpatched version of OpenSSL or run against a… Also affects nodejs
- CVE-2024-22018 A vulnerability has been identified in Node.js, affecting users of the experimental… Also affects nodejs
- CVE-2024-22020 A security flaw in Node.js allows a bypass of network import restrictions. Also affects nodejs