Permission Model bypass with fs.realpathSync
The Node.js Permission Model did not apply read-permission checks to fs.realpathSync(), so code running under --permission with restricted --allow-fs-read could still resolve paths and check file existence outside the allowed directories. This was an incomplete fix of an earlier CVE that only covered the native variant of the same function.
- Triaged in 57 days
- Fixed in 4 months
- Disclosed after 4 months
Summary by the program
A flaw in Node.js Permission Model filesystem enforcement leaves fs.realpathSync() without the required read permission checks. This is an incomplete fix of CVE-2026-21715, which only covered fs.realpathSync.native().
As a result, code running under --permission with restricted --allow-fs-read can still use fs.realpathSync() to check file existence, resolve symlink targets, and enumerate filesystem paths outside of permitted directories.
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 check was added only to the native realpath implementation, leaving the JavaScript-level fs.realpathSync() path unguarded.
Impact
Code under the Permission Model with restricted read access could check file existence, resolve symlink targets and enumerate paths outside 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 mode that lets you run code with only certain files and folders allowed, so untrusted code cannot read everything on the machine. One function that turns a path into its real, symlink-free form was left out of that check, so restricted code could still ask the system whether files exist and where links point. That leaks information about the filesystem even though reading file contents was blocked.
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.