Skip to content

Commit f357548

Browse files
committed
chore: update progress for US-111
1 parent 0a6daee commit f357548

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

scripts/ralph/prd.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2124,7 +2124,7 @@
21242124
"Tests pass"
21252125
],
21262126
"priority": 126,
2127-
"passes": false,
2127+
"passes": true,
21282128
"notes": "Audit M2 — MEDIUM. apply-timing-mitigation-freeze.ts:13-17. Date.now is set with writable: true, configurable: true. Sandbox code can restore it trivially."
21292129
},
21302130
{

scripts/ralph/progress.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ PRD: ralph/kernel-hardening (46 stories)
107107
- Source policy tests (isolate-runtime-injection-policy, bridge-registry-policy) read specific source files by path — update them when moving code between files
108108
- 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
109109
- 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
110+
- V8 isolate native `performance` object has non-configurable `now` — must replace entire global with frozen proxy; after build:isolate-runtime, also run core tsc to update dist .js
110111

111112
---
112113

@@ -1613,3 +1614,17 @@ PRD: ralph/kernel-hardening (46 stories)
16131614
- Testing handle cap directly via _registerHandle/_unregisterHandle globals from sandbox code is simpler and more reliable than testing through child_process.spawn (which has async lifecycle)
16141615
- The 5 failures in tests/runtime-driver/node/index.test.ts (ECONNREFUSED + upgrade) are pre-existing and unrelated
16151616
---
1617+
1618+
## 2026-03-18 - US-111
1619+
- What was implemented: Hardened timing mitigation — Date.now frozen as non-configurable/non-writable, Date constructor patched to return frozen time for no-arg `new Date()`, performance global replaced with frozen proxy object
1620+
- Files changed:
1621+
- packages/secure-exec-core/isolate-runtime/src/inject/apply-timing-mitigation-freeze.ts — Date.now: configurable/writable→false; new Date constructor wrapper with frozen no-arg time; performance: replaced native with Object.create(null) + Object.freeze + non-configurable global property
1622+
- packages/secure-exec-core/src/generated/isolate-runtime.ts — auto-regenerated by build:isolate-runtime
1623+
- packages/secure-exec/tests/runtime-driver/node/index.test.ts — added 3 tests: Date.now override blocked (strict mode assignment + defineProperty), new Date().getTime() matches frozen Date.now(), performance.now override blocked
1624+
- **Learnings for future iterations:**
1625+
- V8 isolate's native `performance` object has non-configurable `now` property — Object.defineProperty in-place fails silently to catch block; must replace the entire global with a frozen proxy
1626+
- `Object.defineProperty(globalThis, "performance", { configurable: false })` works in isolated-vm — the global proxy supports non-configurable data properties
1627+
- Assignment to non-writable property silently fails in sloppy mode, throws TypeError only in strict mode — security tests must use `'use strict'` to verify TypeError
1628+
- `build:isolate-runtime` generates the `.ts` source, but `@secure-exec/core` tsc must run to compile to dist `.js` — tests resolve through compiled dist, not raw .ts
1629+
- Date constructor replacement: must use Object.defineProperty for prototype (direct assignment fails with TS2540), forward parse/UTC, lock Date.now on replacement too
1630+
---

0 commit comments

Comments
 (0)