(CVE-2023-32004) Permission model bypass by specifying a path traversal sequence in a Buffer
Node.js 20's experimental permission model failed to properly handle Buffers passed to file system APIs, so a path traversal sequence inside a Buffer could slip past the permission check. An attacker able to run code under the permission model could therefore reach files the model was meant to restrict.
- Triaged in 44 hours
- Fixed in 29 days
- Paid in 29 days
- Disclosed after 59 days
Summary by the program
###Permission model bypass by specifying a path traversal sequence in a Buffer (HIGH)(CVE-2023-32004)
A vulnerability has been discovered in Node.js version 20, specifically within the experimental permission model. This flaw relates to improper handling of Buffers in file system APIs causing a traversal path to bypass when verifying file permissions.
Please note that at the time this CVE was issued, the permission model is an experimental feature of Node.js.
Impacts:
This vulnerability affects all users using the experimental permission model in Node.js 20.
The report
https://hackerone.com/reports/2038134
Also, patch was provided in the report and matched https://github.com/nodejs/node/commit/1f64147eb607f82060e08884f993597774c69280 (excluding tests).
Impact
see reports.
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
Impact
Users of the experimental permission model in Node.js 20 could have file permission restrictions bypassed, though the feature was experimental at the time.
What the attacker needed
Node.js 20 with the permission model enabled; ability to run code under that model
The fix
A patch was provided in the report and matched an upstream commit.
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 may read or write. The check looked at the path as normal text but not when the path was supplied as raw bytes (a Buffer), so a path containing '..' steps could sneak past the check. That means code running under these limits could still get to files it should not.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.