Skip to content
Access control Disclosed report Intermediate CVE-2026-21715

Permission Model Bypass in realpathSync.native Allows File Existence Disclosure

The Node.js Permission Model did not apply read-permission checks to fs.realpathSync.native(), unlike comparable filesystem functions. Code running under --permission with restricted --allow-fs-read could therefore check whether files exist, resolve symlink targets and enumerate paths outside the permitted directories.

stif Follow

Originally disclosed on HackerOne

  • Triaged in 8 days
  • Fixed in 3 months
  • Disclosed after 3 months

Summary by the program

A flaw in Node.js Permission Model filesystem enforcement leaves fs.realpathSync.native() without the required read permission checks, while all comparable filesystem functions correctly enforce them.

As a result, code running under --permission with restricted --allow-fs-read can still use fs.realpathSync.native() to check file existence, resolve symlink targets, and enumerate filesystem paths outside of permitted directories.

This vulnerability affects 20.x, 22.x, 24.x, and 25.x processes using the Permission Model where --allow-fs-read is intentionally restricted.

The original report as published on HackerOne, by stif. 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 native implementation of realpathSync bypassed the permission-model read check that the JavaScript-level filesystem wrappers apply.

Impact

Code running under the Permission Model with a restricted read allow-list could disclose file existence, symlink targets and directory paths outside the permitted directories.

What the attacker needed

Node.js run with --permission; Restricted --allow-fs-read list; Ability to run code in that 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 'permission model' that lets you run a program with only certain folders readable. One function that resolves a path to its real location skipped that check, so a program that was supposed to be locked down could still find out which files exist elsewhere on the machine. That is information leakage rather than reading file contents.

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 stif

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.

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.