CVE-2024-22018
Low · 2.9CVSS
2.9
EPSS
0.5%
Published
Jul 10, 2024
CISA due date
—
Cloudanix analysis
A flaw in Node.js's test permission system lets attackers see details about files they are not supposed to access.
- Exploitation
- Local Privilege
- Attacker needs
- Local User
- Complexity
- High
- Impact
- Data Exposure
- Component
- Application
- Class
- Authorization Bypass
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
The experimental permission model fails to enforce read restrictions on fs.lstat, allowing retrieval of file metadata (size, timestamps, permissions) for paths outside the explicitly allowed set when --allow-fs-read is active.
Why it matters to the business
Attackers can enumerate file existence, sizes, and modification times on protected paths, enabling reconnaissance that may support targeted follow-on attacks or information leakage without triggering read denials.
How an attack unfolds
An attacker runs or supplies code to a Node.js process started with the experimental permission model and --allow-fs-read; the code calls fs.lstat on arbitrary paths that were never granted read access, bypassing the intended restriction and receiving stat results.
How to fix it
Disable the experimental permission model in production Node.js 20/21 deployments or remove the --allow-fs-read flag; monitor Node.js release notes for a fix in subsequent versions and upgrade once available.
How to confirm the fix worked
Audit application startup flags and permission configuration; attempt fs.lstat calls against paths outside the allow list in a test environment and confirm that metadata is no longer returned.
Typical attack path
- Start or compromise a Node.js process using the experimental permission model with --allow-fs-read
- Identify or guess paths outside the permitted read set
- Invoke fs.lstat (or equivalent) on those paths
- Receive and inspect returned file metadata
How to detect it
Search process command lines and configuration for the experimental permission model and --allow-fs-read flags; review application source and dependency code for direct or indirect fs.lstat usage against untrusted paths.
What your security team should do
- Do not enable the experimental permission model on production systems until the authorization gap is resolved
- Replace --allow-fs-read usage with stricter process isolation or container-level controls
- Review any Node.js 20/21 services for permission-model usage and schedule upgrades once patched releases ship
The record
A vulnerability has been identified in Node.js, affecting users of the experimental permission model when the --allow-fs-read flag is used. This flaw arises from an inadequate permission model that fails to restrict file stats through the fs.lstat API. As a result, malicious actors can retrieve stats from files that they do not have explicit read access to. 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.
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 | kibana-7.17 | 0 | 7.17.22-r0 |
| Chainguard | nodejs-20 | 0 | 20.15.1-r0 |
| Chainguard | nodejs-20-doc | 0 | 20.15.1-r0 |
| Chainguard | nodejs-21-doc | 0 | 21.7.3-r13 |
| Chainguard | nodejs-22 | 0 | 22.4.1-r0 |
| Chainguard | nodejs-22-doc | 0 | 22.4.1-r0 |
| 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: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 |
| Ubuntu:Pro:22.04:LTS | nodejs | 0 | No fix |
| Wolfi | nodejs-20 | 0 | 20.15.1-r0 |
| Wolfi | nodejs-20-doc | 0 | 20.15.1-r0 |
| Wolfi | nodejs-21-doc | 0 | 21.7.3-r13 |
| Wolfi | nodejs-22 | 0 | 22.4.1-r0 |
| Wolfi | nodejs-22-doc | 0 | 22.4.1-r0 |
| 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-36137 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