Skip to content
Access control Disclosed report Intermediate CVE-2024-22018

fs.lstat bypasses permission model

The experimental Node.js permission model did not restrict the fs.lstat API when the --allow-fs-read flag was used. An attacker with code execution could retrieve file metadata for files they were not granted read access to.

haxatron1 Follow

Originally disclosed on HackerOne

  • Triaged in 12 hours
  • Fixed in 10 months
  • Disclosed after 10 months

Summary by the program

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 22.

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 haxatron1. 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's read restriction was enforced only on file-content APIs and not on the metadata-returning fs.lstat call.

Impact

An attacker could retrieve stats from files they do not have explicit read access to, though only when the experimental permission model is enabled.

What the attacker needed

Experimental permission model enabled; --allow-fs-read flag in use; ability to run code in Node.js

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 experimental feature that lets you limit which files a program can read. A function that returns information about a file, rather than its contents, was not covered by that limit. So a program could still learn details about files it was not supposed to touch.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More by haxatron1

View all

30 more disclosed reports, 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.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.