You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: scripts/ralph/prd.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1992,7 +1992,7 @@
1992
1992
"Tests pass"
1993
1993
],
1994
1994
"priority": 118,
1995
-
"passes": false,
1995
+
"passes": true,
1996
1996
"notes": "Audit H6 — HIGH. permissions.ts:228-234, node/driver.ts:241-278. Permission checks validate the original URL but fetch follows redirects by default. A URL that 302-redirects to http://169.254.169.254/ passes the check."
- NodeExecutionDriver split into 5 modules in src/node/: isolate-bootstrap.ts (types+utilities), module-resolver.ts, esm-compiler.ts, bridge-setup.ts, execution-lifecycle.ts; facade is execution-driver.ts (<300 lines)
107
107
- Source policy tests (isolate-runtime-injection-policy, bridge-registry-policy) read specific source files by path — update them when moving code between files
108
108
- esmModuleCache has a sibling esmModuleReverseCache (Map<ivm.Module, string>) for O(1) module→path lookup — both must be updated together and cleared together in execution.ts
109
+
- Network adapter SSRF: isPrivateIp() + assertNotPrivateHost() in driver.ts; fetch uses redirect:'manual' with per-hop re-validation; httpRequest has pre-flight check only (no auto-redirect); data:/blob: URLs skip SSRF check
- Mock command executor pattern (createCapturingExecutor) captures spawn args/env without needing real child processes — useful for bridge-level security tests
1498
1499
- filterEnv in permissions.ts is permission-based filtering; dangerous env var stripping is a separate concern applied at the bridge boundary
1499
1500
---
1501
+
1502
+
## 2026-03-18 - US-110
1503
+
- What was implemented: SSRF protection for network adapter — blocks requests to private/reserved IP ranges and re-validates redirect targets
1504
+
- Files changed:
1505
+
- packages/secure-exec-node/src/driver.ts — added isPrivateIp(), assertNotPrivateHost(), MAX_REDIRECTS; modified fetch() to use redirect:'manual' with re-validation; modified httpRequest() with pre-flight IP check
- packages/secure-exec/tests/runtime-driver/node/ssrf-protection.test.ts — new test file with 37 tests
1509
+
- **Learnings for future iterations:**
1510
+
- isPrivateIp must handle IPv4-mapped IPv6 (::ffff:a.b.c.d) by stripping the prefix before checking
1511
+
- assertNotPrivateHost must skip non-network URL schemes (data:, blob:) — existing test suite uses data: URLs
1512
+
- fetch redirect following uses redirect:'manual' and manually follows up to 20 hops, re-validating each target URL against the private IP blocklist
1513
+
- httpRequest (node http module) doesn't follow redirects by default, so only pre-flight check needed
1514
+
- DNS rebinding is documented as a known limitation — would require pinning resolved IPs to the connection, not possible with native fetch
1515
+
- 5 pre-existing test failures in index.test.ts (http.Agent, upgrade, server termination) are NOT caused by SSRF changes — they fail identically on the pre-SSRF commit
0 commit comments