Improper handling of wildcards in --allow-fs-read and --allow-fs-write
The Node.js permission model's documentation did not state that wildcards in file path permissions must only be used as the last character. An attacker could exploit this by specifying a wildcard pattern that unintentionally grants access to more files than intended, such as accessing all files in a directory instead of just those matching a suffix.
- Triaged in 47 hours
- Fixed in 3 months
- Disclosed after 3 months
Summary by the program
The Node.js Permission Model does not clarify in the documentation that wildcards should be only used as the last character of a file path. For example:
--allow-fs-read=/home/node/.ssh/*.pub
will ignore pub and give access to everything after .ssh/.
This misleading documentation affects all users using the experimental permission model in Node.js 20 and Node.js 21.
Please note that at the time this CVE was 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
Root cause
Likely the path matching ignores characters after the wildcard, and the documentation failed to warn that wildcards must be placed only at the end.
Impact
Users of the experimental permission model in Node.js 20 and 21 could inadvertently grant broader file system access than intended, potentially exposing sensitive files.
What the attacker needed
Node.js 20 or 21 with permission model enabled; Use of --allow-fs-read or --allow-fs-write with wildcard
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 restrict which files a program can read or write. You specify allowed paths, and you can use a wildcard (like *) to match multiple files. The documentation didn't explain that the wildcard must be at the very end of the path; if you put it in the middle, the system ignores everything after it and allows access to all files in that folder, which is more than you intended.
What is Misconfiguration?
Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.