Repository navigation
fix(security): bind ZIP entry names to kinds - #421
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. Reviewed September 16, 2026, 9:42 AM ET / 13:42 UTC (Revision 12). ClawSweeper reviewWhat this changesThe branch binds ZIP names and entry kinds to physical archive records before filtering or reading, adds coverage and benchmarks, and improves lock cleanup and test fixture lifetimes. Merge readiness⛔ Blocked before merge - 5 items remain The ZIP hardening remains necessary on current main. No concrete introduced defect was found; compatibility acceptance, current runtime evidence, and resolution of the historical performance hold remain outstanding. Likely related people: steipete (high-confidence routing candidate). Priority: P2 Review scores
Verification
How this fits togetherfs-safe admits untrusted ZIP metadata before native or JavaScript decoders expose entries to application policy. Accepted entries then feed bounded member reads or guarded filesystem extraction. flowchart TD
A[Untrusted ZIP archive] --> B[Physical metadata admission]
B --> C[Native or JavaScript decoder]
C --> D{Name and kind agree?}
D -->|No| E[Reject archive]
D -->|Yes| F[Filter or select member]
F --> G[Guarded extraction or bounded bytes]
Decision needed
Why: The stricter interpretation is security-motivated but can stop existing archive workflows; source correctness alone cannot establish the acceptable compatibility tradeoff. Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Preserve complete pre-effect ZIP association, with an explicitly accepted compatibility boundary, demonstrated upgrade outcomes, and a resolved performance budget. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the missing main-branch kind association, and the added fixtures identify conflicting terminal markers and decoder metadata cases. No runtime reproduction was executed during this read-only review. Is this the best way to solve the issue? Yes, binding all physical entries before callbacks or member selection is a focused repair, and canonical-key association correctly avoids relying on JavaScript object order. Merge readiness still depends on the declared compatibility and performance tradeoffs. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 2374204cc8d0. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (11 earlier review cycles; latest 8 shown)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
HOLD on exact head Fresh GPT-6 Astra xhigh raw-evidence audit verified all 16 artifact digests, 288 report hashes and provenance bindings, 4,896 workload rows, and 34,272 samples. It independently recomputed 1,632 strict gates from raw samples: source ABBA 361 failures, source BAAB 370, same-artifact ABBA 234, and same-artifact BAAB 256; 1,221 total failures, including 307 pooled. The exact candidate therefore cannot merge under the predeclared median/max thresholds. Same-artifact failures make precise attribution inconclusive, but consistent Linux mixed-kind loader increases across every source block also indicate real added work. Representative pooled source failure: macOS BAAB/off Unicode-deflate loader median +69.725% (+2,641.529 us), maximum sample average +85.381% (+6,995.883 us). Evidence root: Astra also challenged the implementation and proposed only security-preserving optimizations: reuse exact-equal validated names, avoid the intermediate Map tuple array, and normalize native paths only after exact-string mismatch while retaining complete archive association/kind checks. Those changes are being prepared as a separate exact revision and will receive a fresh Astra correctness challenge plus a full new ABBA/BAAB source/control study. No threshold, failed block, control, order, or workload is being discarded. |
|
Optimized-head performance remains a strict BLOCK after fresh independent GPT-6 Astra xhigh raw-sample audit:
All 16 API artifact digests/sizes, 288 report seals and runner receipts, plans, exact trees/harness/workflow identities, builds, native modes, runtimes, and order were independently verified (16,666 checks, zero integrity failures). All 17 selected workloads were retained. The matrix directly enters the changed loader; both controls also fail, so attribution is noisy but no gate may be waived or subtracted. The optimization improved the earlier result but did not establish a pass. HOLD / do not merge. |
|
Performance HOLD for exact head All exact candidate workflows passed, and the fresh Astra exact-tree review found no P0-P3 issues. The independent raw performance audit also passed every provenance/integrity check, but the fixed gates did not:
All rows and raw samples were retained, including two substring-selected gzip workloads; orders and controls stayed separate, with no subtraction, exclusions, cross-order pooling, or selective reruns. Mixed-kind portable-loader source rows on macOS repeated about +13.5% median latency in both orders, while same-artifact controls also showed large instability. Do not merge this head. |
Close synchronous lock descriptors even when cleanup metadata inspection fails, preserving the original error and unverified sidecar.
563208d to
af2e543
Compare
Bind ZIP physical entry names and kinds to decoder metadata before callbacks or member selection, rejecting ambiguous interpretations consistently.
af2e543 to
0549925
Compare
ZIP extraction binds physical entry names and kinds to decoder metadata before callbacks or member selection. Ambiguous associations, conflicting interpretations, and unsupported decoder naming behavior fail closed instead of allowing metadata from one physical entry to authorize another. Portable and native extraction preserve the same name/kind boundary.
The binding covers decoder key ordering, Unicode name overrides, directory interpretations, and conflicting names. Admission remains ahead of member callbacks and content selection, with documented rejection of unsupported interpretations. The integrated archive paths retain the current Windows namespace guards.
The package and native addon build successfully. Validation passed all 103 Rust tests and all 420 focused ZIP, native-buffer, and archive-boundary tests. Fresh independent review through P2 is clean. Complete platform CI passed on the final PR head.
CI also exposed two test-fixture defects: extraction work could outlive the fsync fixtures, and parallel Rust copy tests could choose identical timestamp-based directory names. The fixtures now retain extraction through teardown and use an atomic sequence for unique copy directories; all original operation counts and assertions remain in force.