Repository navigation
fix(archive): use the extractor path key for ZIP collisions - #832
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 October 4, 2026, 10:59 PM ET / October 5, 2026, 02:59 UTC (Revision 3). ClawSweeper reviewWhat this changesThe PR makes ZIP collision checks use extraction’s canonical path identity and adds regression coverage, documentation, and a changelog entry. Merge readiness⛔ Blocked before merge - 2 items remain The fix remains necessary: current main and v0.23.0 retain the trailing-separator collision gap. No introduced correctness defect was found, but the external-contributor runtime proof requirement remains unmet. Priority: P2 Review scores
Verification
How this fits togetherfs-safe validates untrusted ZIP member names before extraction or bounded reads. Its shared collision tracker feeds physical archive admission and decoder validation so ambiguous names reject before files or requested bytes are returned. flowchart TD
A[Untrusted ZIP members] --> B[Validate raw names]
B --> C[Canonical path identity]
C --> D[Case and Unicode collision check]
D --> E[Reject ambiguous archive]
D --> F[Validate decoder entries]
F --> G[Extract files or return bounded bytes]
Before merge
Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Keep one canonical collision policy shared by extraction and ZIP admission, preserving raw-name rejection and validating the repaired bounded-read behavior with native runtime evidence. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the path: the current-main tracker gives A/ and a different keys, allowing the native bounded-read collision check to miss them. No runtime reproduction was executed during this read-only review. Is this the best way to solve the issue? Yes, reusing extraction’s existing canonicalization is the narrowest repair; it retains raw validation and avoids a competing normalization policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 68416a3367f6. LabelsLabel changes: No label changes. Label 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
History |
path.posix.normalize keeps a directory trailing slash, so a native bounded read treated A/ and a as different names. Collision checks now use the same stripped case-insensitive NFC key as extraction. Signed-off-by: Sebastien Tardif <[email protected]>
b4849af to
a3fbe35
Compare
ZIP preflight and bounded reads now use the extractor's canonical path key for collision detection.
path.posix.normalizeretained directory trailing separators, soA/andacould evade the shared case-insensitive NFC collision policy.stripArchivePath(entryPath, 0)removes the separator consistently with extraction.Raw-name validation rejects traversal, absolute paths, NULs, and empty physical ZIP names before collision tracking. Root markers do not alias real member paths; repeated separators and dot components retain the extractor's existing identity. Tests cover both entry orders, case and Unicode aliases, root-marker bounded reads, and native/JavaScript admission.
Validation: 223 focused tests passed with the macOS native addon loaded, covering off/require/auto-native/auto-missing modes. Codex autoreview is clean at P0–P2. Full
pnpm checkpassed lint, build, allocator-build, and documentation checks locally, but the full test phase was stopped after widespread timing failures on a busy host; exact-head hosted CI is the cross-platform gate. Documentation and the Unreleased changelog are updated.Thanks @SebTardif for the fix.
Exact-head CI passed on
a3fbe35a035c73a0221fb9592a56d92526394d5a: all OS lanes, coverage, benchmarks, and CodeQL. CI run.