Permissions policies can be bypassed via Module._load.
The experimental policy mechanism in Node.js could be bypassed by using Module._load() to require modules that were not permitted by the policy.json file. An attacker who can run code in a policy-restricted context could load and execute modules outside the intended allowlist.
Originally disclosed on HackerOne
- Triaged in 33 hours
- Fixed in 4 months
- Disclosed after 4 months
Summary by the program
The use of Module._load() can bypass the policy mechanism and require modules outside of the policy.json definition for a given module.
This vulnerability affects all users using the experimental policy mechanism in all active release lines: 16.x, 18.x and, 20.x.
Please note that at the time this CVE was issued, the policy 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
A user relying on the experimental policy to restrict module loading could have that restriction bypassed, allowing modules outside the policy to be required.
What the attacker needed
Experimental policy feature enabled; ability to run code in that context
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 called a policy that is meant to limit which modules a program is allowed to load, like a guest list for a party. This report says that a built-in function, Module._load(), could be used to sneak in modules that are not on the guest list. That means the restriction could be avoided by someone who can already run code in that environment.
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.