fix: harden archive extraction validation - #102
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed August 2, 2026, 7:44 PM ET / 23:44 UTC. ClawSweeper reviewWhat this changesThe branch hardens ZIP and TAR extraction and bounded archive reads by rejecting ambiguous names and collisions, preserving explicit limits, validating ZIP integrity metadata, aligning native and JavaScript policy, and clarifying secret-reader guarantees. Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 7 items remain Keep this PR open: its archive-hardening direction is sound, but collision tracking now runs before the documented Priority: P1 Review scores
Verification
How this fits togetherThe archive subsystem takes untrusted ZIP or TAR entries, validates names and resource limits, then writes accepted entries through a staged destination or returns a bounded entry read. Its policy must remain consistent across JavaScript ZIP, JavaScript TAR, and native extraction paths because callers use filters to decide which validated entries are actually published. flowchart LR
A[Untrusted ZIP or TAR] --> B[Archive preflight]
B --> C[Path and archive-wide limits]
C --> D[Caller entry filter]
D --> E[Accepted output plan]
E --> F[Collision and integrity checks]
F --> G[Staged extraction or bounded read]
Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep archive-wide path validation and entry counting before filtering, but record output collisions only after an entry is accepted for extraction in the ZIP, TAR, and native plans; add a cross-backend regression test for skipped colliding entries. Do we have a high-confidence way to reproduce the issue? Yes — source establishes a direct reproduction: use Is this the best way to solve the issue? No — the hardening should reject collisions among accepted outputs, not entries explicitly omitted by the supported filter contract. Moving tracking after policy acceptance preserves path and archive-wide limit checks while restoring selective extraction. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 4696341685a9. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
b1ebbee to
41b698d
Compare
41b698d to
e175018
Compare
Summary
readSecureFileProof
pnpm check(699 passed, 32 skipped)pnpm test:security(64 passed)pnpm native:test(14 passed)