Path traversal through path stored in Uint8Array
Node.js's experimental permission model failed to block path traversal when a path was supplied as a non-Buffer Uint8Array, unlike strings and Buffers. An attacker could bypass the permission model to access files outside the allowed paths.
- Triaged in under an hour
- Fixed in 3 days
- Disclosed after 3 days
Summary by the program
Various node:fs functions allow specifying paths as either strings or Uint8Array objects. In Node.js environments, the Buffer class extends the Uint8Array class. Node.js prevents path traversal through strings (see CVE-2023-30584) and Buffer objects (see CVE-2023-32004), but not through non-Buffer Uint8Array objects.
This is distinct from CVE-2023-32004 (report 2038134), which only referred to Buffer objects. However, the vulnerability follows the same pattern using Uint8Array instead of Buffer.
Impacts:
This vulnerability affects all users using the experimental permission model in Node.js 20.
Please note that at the time this CVE is issued, the permission model is an experimental feature of Node.js.
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
This vulnerability affects all users using the experimental permission model in Node.js 20, allowing them to bypass file access restrictions.
What the attacker needed
Node.js 20 with experimental permission model enabled
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 restricts which files a program can access. This report found that if you give a file path as a certain type of binary data (a Uint8Array that is not a Buffer), the restriction can be bypassed, letting you reach files you should not. The issue only affects users who have turned on this experimental permission model.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.