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
@@ -2071,7 +2071,7 @@
2071
2071
"Tests pass"
2072
2072
],
2073
2073
"priority": 123,
2074
-
"passes": false,
2074
+
"passes": true,
2075
2075
"notes": "Audit M3 — MEDIUM (partial gap from US-132). US-132 isolates caches across warm executions but does not prevent poisoning within a single execution. bridge-initial-globals.ts:22 exposes mutable _moduleCache and require.cache."
- BUFFER_CONSTANTS/BUFFER_MAX_LENGTH are still used elsewhere in process.ts (global Buffer setup) — don't remove them
1567
1567
- Multiple sandbox escape tests reference process.binding() as a sentinel for "real bindings" — when changing binding behavior, grep all test files for `process.binding` calls
1568
1568
---
1569
+
1570
+
## 2026-03-18 - US-119-B
1571
+
- What was implemented: Blocked module cache poisoning within a single execution by wrapping the internal `_moduleCache` object in a read-only Proxy
1572
+
- Changes:
1573
+
- `require-setup.ts`: Captured internal cache reference, replaced all internal `_moduleCache[` writes with `__internalModuleCache[`, created read-only Proxy (rejects set/delete/defineProperty), assigned to `require.cache` and `_moduleCache` global, updated `Module._cache` references
1574
+
- `global-exposure.ts`: Changed `_moduleCache` classification from `mutable-runtime-state` to `hardened` so `applyCustomGlobalExposurePolicy` locks the property as non-writable/non-configurable after bridge setup
1575
+
- `bridge-hardening.test.ts`: Added 5 tests covering require.cache set/delete rejection, normal require caching, `_moduleCache` global protection, and `Module._cache` protection
- `applyCustomGlobalExposurePolicy` runs AFTER `setupRequire` — any property made `configurable: false` in require-setup.ts will cause the policy to fail when it tries to re-apply. Use `configurable: true` and let the policy finalize it.
1583
+
- The bridge setup order is: globalExposureHelpers → bridge-initial-globals → bridge bundle (module.ts) → bridge attach → timing mitigation → require-setup. Module.ts evaluates BEFORE require-setup, so Module._cache captures the raw cache object and must be explicitly updated.
1584
+
- Internal require system writes need a captured local reference (`__internalModuleCache`) since the globalThis property gets replaced with a Proxy that rejects writes.
1585
+
- `proc.run()` returns `{ code, exports }` not just exports — test assertions must use `result.exports`.
0 commit comments