Skip to content
Path traversal Disclosed report Advanced CVE-2024-21891

Multiple permission model bypasses due to improper path traversal sequence sanitization

Node.js's experimental permission model relied on built-in path normalisation utilities that could be overridden by user code, allowing path traversal to bypass filesystem restrictions.

xion Follow

Originally disclosed on HackerOne

High 7.9 View original
  • Triaged in under an hour
  • Fixed in 3 months
  • Disclosed after 3 months

Summary by the program

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.

The original report as published on HackerOne, by xion. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the permission model trusted built-in path normalisation functions that are mutable at runtime, so user code could replace them and feed unnormalised traversal sequences to filesystem checks.

Impact

An attacker who can run code in a Node.js process using the experimental permission model could bypass filesystem permissions via path traversal.

What the attacker needed

Node.js 20 or 21; experimental permission model enabled; ability to run code in the process

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

Node.js has an optional, experimental feature that tries to limit which files a program can touch. The check for 'is this path allowed?' used helper functions that a program could replace with its own version. By swapping those helpers, a malicious program could sneak past the file restrictions.

What is Path traversal?

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.

More by xion

View all

1 more disclosed report, best first.

More from Node.js

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Path traversal and file inclusion

The lesson behind this report.

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.