# CVE-2024-22018: Information disclosure in Node

> Attackers can bypass file read restrictions to retrieve metadata from unauthorized files when using the experimental permission model in Node.js.

- **Severity:** Low 2.9 (`CVSS:3.0/AV:L/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 10 Jul 2024
- **Updated:** 30 Apr 2025
- **Also known as:** ALPINE-CVE-2024-22018, AZL-43213, BELL-CVE-2024-22018, BIT-node-2024-22018, BIT-node-min-2024-22018, CLEANSTART-2026-SI30910, CLEANSTART-2026-XQ13634, DEBIAN-CVE-2024-22018, GHSA-9xvm-xmw3-2hm2, UBUNTU-CVE-2024-22018

## What is CVE-2024-22018?

CVE-2024-22018 is a low-severity vulnerability in NodeJS Node, published on 10 Jul 2024. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

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.

## Which versions are affected by CVE-2024-22018?

2 open source packages ship an affected version, including node and node-min.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `node` | Bitnami | From 20.0.0 | 20.15.1, 22.4.1 |
| `node-min` | Bitnami | From 20.0.0 | 20.18.1, 22.12.0 |

## How do I fix CVE-2024-22018?

Upgrade node to a fixed version for your release line: 20.15.1 or 22.4.1.

## Is CVE-2024-22018 being exploited?

There is no known exploitation of CVE-2024-22018 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-22018 and fix it if it is affected.

What it is: CVE-2024-22018 is a low-severity vulnerability in NodeJS Node, published on 10 Jul 2024. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2024-22018 in the wild and no public exploit code.

Affected packages and fixed versions:
- node (Bitnami): affected from 20.0.0; fixed in 20.15.1, 22.4.1
- node-min (Bitnami): affected from 20.0.0; fixed in 20.18.1, 22.12.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-22018/ (Markdown: https://insights.sbomify.com/CVE-2024-22018/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-22018
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-22018
- OSV: https://osv.dev/vulnerability/CVE-2024-22018

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-22018/
Summaries are generated and may contain mistakes; the official description above is the record.
