CVE-2024-21891 Path traversal in Node

High 7.9 Published Updated

Attackers can bypass filesystem permission models via path traversal by overwriting internal path normalization functions in Node.js.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2024-21891?

CVE-2024-21891 is a high-severity path traversal vulnerability in Nodejs Node.js, published on 20 Feb 2024. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

Official description

Node.js depends on multiple built-in utility functions to normalize paths provided to node:fs functions, which can be overwitten with user-defined implementations leading to filesystem permission model bypass through path traversal attack. 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.

Weakness: CWE-22

Which versions are affected by CVE-2024-21891?

2 open source packages ship an affected version, including node and node-min. It affects 1 product.

PackageAffectedFixed in
node BitnamiFrom 20.0.020.11.1, 21.6.2
node-min BitnamiFrom 20.0.020.11.1, 21.6.2

Products include Nodejs Node.js.

How do I fix CVE-2024-21891?

Upgrade node to a fixed version for your release line: 20.11.1 or 21.6.2.

Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.

Is CVE-2024-21891 being exploited?

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

All Nodejs Node.js vulnerabilities

Sources

Also known as AZL-35046, BELL-CVE-2024-21891, BIT-node-2024-21891, BIT-node-min-2024-21891, GHSA-4rwx-mrf5-wx33.

Is CVE-2024-21891 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free