-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
area:runtime-nodeArea: Node runtime bridgeArea: Node runtime bridgebugSomething isn't workingSomething isn't workingpriority:p2Priority P2 (medium)Priority P2 (medium)
Milestone
Description
Summary
NodeBridge filters environment variables to a safe allowlist, but OptimizedNodeBridge passes the full process.env into Python subprocesses. This can unintentionally leak secrets and makes behavior inconsistent between runtime modes.
Failure mode
- Users switch from NodeBridge to OptimizedNodeBridge and unintentionally expose env vars (API keys, tokens) to the Python process.
- Behavior diverges: NodeBridge hides non-allowed vars, OptimizedNodeBridge does not.
Evidence
src/runtime/node.tsbuildsenvfrom an allowlist andTYWRAP_prefix.src/runtime/optimized-node.tsuses{ ...process.env, ...this.options.env }.
Proposed fix
- Reuse the NodeBridge env filtering logic in OptimizedNodeBridge.
- Allow explicit opt-in to pass through all env vars if needed.
Acceptance criteria
- OptimizedNodeBridge defaults to a safe env allowlist consistent with NodeBridge.
- Provide a documented override for full env inheritance.
- Add tests verifying that non-allowed vars are filtered by default.
Metadata
Metadata
Assignees
Labels
area:runtime-nodeArea: Node runtime bridgeArea: Node runtime bridgebugSomething isn't workingSomething isn't workingpriority:p2Priority P2 (medium)Priority P2 (medium)