Skip to content

Commit 91d1f86

Browse files
NathanFlurryclaude
andcommitted
chore: update progress for US-072
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent a031530 commit 91d1f86

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

progress.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2797,3 +2797,16 @@ PRD: ralph/kernel-hardening (46 stories)
27972797
- Only main.rs and session.rs have production unbounded channels; execution.rs, host_call.rs, snapshot.rs unbounded channels are all in test code
27982798
- crossbeam_channel::bounded API is drop-in replacement for unbounded — same Sender/Receiver types
27992799
---
2800+
2801+
## 2026-03-19 - US-072
2802+
- What was implemented: Constant-time auth token comparison and race-free socket directory creation
2803+
- Changes:
2804+
1. Added `constant_time_eq()` function using XOR-accumulate for auth token comparison (prevents timing oracle)
2805+
2. Replaced `fs::create_dir() + fs::set_permissions()` with `fs::DirBuilder::new().mode(0o700).create()` (eliminates TOCTOU race)
2806+
3. Added tests: 3 for constant_time_eq (equal, different content, different length) and 1 for socket directory 0700 permissions
2807+
- Files changed: crates/v8-runtime/src/main.rs
2808+
- **Learnings for future iterations:**
2809+
- `DirBuilderExt::mode()` (from `std::os::unix::fs`) sets permissions atomically via mkdir(2) — always prefer over create_dir + set_permissions
2810+
- V8 isolate teardown SIGSEGV is pre-existing and test-order-dependent — the process crashes during exit cleanup when both execution and snapshot tests run in the same process, but all test assertions pass before the crash
2811+
- `PermissionsExt` import moved to test module only since production code no longer needs it
2812+
---

scripts/ralph/prd.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,8 +1056,8 @@
10561056
"Typecheck passes"
10571057
],
10581058
"priority": 62,
1059-
"passes": false,
1060-
"notes": "PR review finding: Timing oracle on auth token; TOCTOU race between create_dir and set_permissions."
1059+
"passes": true,
1060+
"notes": "Fixed: constant_time_eq (XOR-accumulate) replaces String::eq for auth token comparison; DirBuilder::mode(0o700) replaces create_dir+set_permissions for race-free socket directory creation."
10611061
},
10621062
{
10631063
"id": "US-073",

0 commit comments

Comments
 (0)