fix: harden path and archive parser edge cases - #119
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed August 3, 2026, 4:30 AM ET / 08:30 UTC. ClawSweeper reviewWhat this changesThe branch hardens FileStore key validation and TAR/ZIP parser error handling and limits, with deterministic property-based regression tests for path aliases and malformed archives. Merge readiness⛔ Blocked until real behavior proof is added - 8 items remain Keep open: the archive hardening is substantial, but this PR still makes previously valid FileStore key spellings inaccessible in the released public API. Likely related people: Peter Steinberger (high confidence, current FileStore and archive-area history). Priority: P1 Review scores
Verification
How this fits togetherFileStore converts application-managed relative keys into paths confined under a trusted root, while archive readers validate untrusted entry names and limits before extraction. Both surfaces sit before guarded filesystem operations, so their accepted spellings and error contracts affect callers and existing stored data. flowchart LR
A[Application keys and archives] --> B[FileStore and archive validation]
B --> C{Accepted input?}
C -->|No| D[Documented error]
C -->|Yes| E[Root confinement and limits]
E --> F[Safe read or extraction]
Decision needed
Why: The patch intentionally changes a released public storage-key contract; code review cannot determine whether breaking access to existing persisted keys is acceptable product policy. Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain existing FileStore key reachability in this release and land the archive parser fixes with direct live proof; move portable canonical-key enforcement to a documented, versioned migration or an explicit new API rather than silently changing existing keys. Do we have a high-confidence way to reproduce the issue? Yes—source reproducible with high confidence: current main safely normalizes empty and dot segments in relative paths, while this PR rejects those spellings before FileStore can resolve an existing key. Is this the best way to solve the issue? No: archive hardening is a reasonable direction, but silently rejecting historical FileStore key spellings is not the narrowest compatible fix; preserve them or introduce canonical enforcement through a versioned migration or new API. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 5f528c322461. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
a76190a to
9bfc4bf
Compare
Summary
fast-checkproperties for FileStore key containment, canonical spelling, sync/async agreement, rejection side effects, and portable aliasingEvery property uses seed
0x5eedc0de, bounded case counts, verbose counterexamples, and fast-check shrink paths for direct replay.Findings fixed
archive-header-invalidcodemaxEntryBytesboundaries do not accumulate across filesAll minimized regressions were confirmed against an untouched
origin/main; the native high-order base-256 fixture was accepted there as a zero-byte file.Verification
pnpm check— 1018 passed, 61 skippedpnpm test:security— 70 passedpnpm native:test— 18 passedgit diff --checkgpt-5.6-sol, high) — clean, no accepted/actionable findings