-
-
Notifications
You must be signed in to change notification settings - Fork 37.4k
Runtime Permission Dropping (process.permission.drop() #62223
Copy link
Copy link
Closed
Labels
feature requestIssues requesting new Node.js features.Issues requesting new Node.js features.permissionIssues and PRs related to the Permission Model.Issues and PRs related to the Permission Model.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.Issues and PRs marked stale due to inactivity and scheduled for automatic closure.
Description
Activity
Metadata
Metadata
Assignees
Labels
feature requestIssues requesting new Node.js features.Issues requesting new Node.js features.permissionIssues and PRs related to the Permission Model.Issues and PRs related to the Permission Model.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.Issues and PRs marked stale due to inactivity and scheduled for automatic closure.
Type
Projects
- StatusShow more project fieldsAwaiting Triage
What is the problem this feature will solve?
The current Permission Model (
--allow-fs-read,--allow-fs-write,--allow-child-process,--allow-worker,--experimental-permission) is all-or-nothing at startup. You declare the full set of permissions when launching the process, and they remain fixed for its entire lifetime.This makes it impossible to implement a common and well-established security pattern: start with the permissions you need for initialization, then drop the ones you no longer need before entering the main event loop.
Real-world Node.js applications routinely need broad permissions at startup (reading config files, loading TLS certificates, binding to privileged ports, spawning setup workers) but then operate in a much narrower scope for the rest of their lifetime. Today, there is no way to tighten the permission boundary after initialization.
What is the feature you are proposing to solve the problem?
A
drop()call removes the specified permission from the internal allow-list. It cannot be reversed throughprocess.permissionor any other Node.js API. This narrows the set of resources reachable through standard Node.js APIs (fs,child_process,net, etc.), which is where path traversal and similar attacks operate.As with the rest of the Permission Model,
drop()is not a hard process-level security boundary. It does not protect against malicious code with arbitrary V8 access that bypasses Node.js APIs entirely (see Security model).What alternatives have you considered?
No response