Repository navigation
fix(security): sanitize sibling callback names - #382
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:43 AM ET / 13:43 UTC (Revision 15). ClawSweeper reviewWhat this changesThe branch sanitizes fallback filenames, validates staging names before producer callbacks, binds ZIP metadata to decoded entries, and checks cancellation before compressed-input refills. Merge readiness⛔ Blocked before merge - 4 items remain This remains useful security hardening absent from current main and v0.12.0. No new blocking code defect was found; the recorded conditional acceptance remains unsatisfied. Priority: P2 Review scores
Verification
How this fits togetherfs-safe turns untrusted filenames and archive entries into guarded filesystem operations. These changes strengthen admission before producer callbacks, archive member selection, and publication. flowchart TD
A[Untrusted filenames] --> B[Sanitize and validate staging names]
B --> C[Producer callback]
C --> D[Guarded publication]
E[Archive bytes] --> F[Validate names and entry kinds]
F --> G[Bounded reads or extraction]
H[Cancellation signal] --> G
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the shared sanitization and pre-producer admission boundary, with demonstrated safe-caller upgrade compatibility and accepted performance evidence, then land the filename change after its archive prerequisites. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main returns an unsafe fallback verbatim when the primary filename is empty or unusable. No runtime reproduction was executed. Is this the best way to solve the issue? Yes for the filename repair: applying one sanitizer to both candidates and validating completed components preserves the existing guarded publication design. The broader stack still needs its recorded compatibility and performance validation. 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 (14 earlier review cycles; latest 8 shown)
|
|
Maintainer decision: accept the hardened exported fallback contract, conditional on the promised consumer proof and performance evidence. A fallback that is already a safe bounded filename remains its existing fixed point. Empty, reserved, separator-bearing, colon-bearing, trailing-dot/space, control-bearing, or overlong fallbacks may now be sanitized, truncated, or replaced with the documented fixed ile default instead of being returned verbatim. That compatibility change is intentional: fallback text is attacker-controlled at the same boundary as the primary name and must not bypass the shared filename policy. Callers that require an exact display label should store it separately from the filesystem component. Landing remains held until exact-head public-API evidence covers safe-caller compatibility, confined ordinary and private publication, and rejection before producers, and until the comparative performance gates pass. |
Bind ZIP physical entry names and kinds to decoder metadata before callbacks or member selection, rejecting ambiguous interpretations consistently.
309c86f to
0b0a552
Compare
0b0a552 to
29344f9
Compare
Stop zstd and bzip2 compressed-input refills after cancellation while retaining decoded-output and complete archive validation.
Sanitize fallback filenames and validate completed sibling callback components before producers run, retaining bounded names and Windows device-name rejection.
29344f9 to
5d4ebba
Compare
Fallback filenames pass through the same sanitization as primary names, and completed sibling staging components are validated before producer callbacks run. This closes bypasses through fallback and callback names while preserving bounded filenames, extension handling, and Windows device-name rejection.
The integration keeps the current descriptor-handoff and private-producer cleanup lifecycle. Callback parents retain valid Windows namespace-root spelling, and raw/resolved parent aliases are checked before constructing the completed path. Internal callback tests use the new directory/component interface while preserving receiver identity and isolation behavior.
The package builds and 218 focused filename, output, callback, snapshot, namespace, and private-producer tests pass (26 platform skips). Fresh independent review through P2 is clean. Complete platform CI passed on the final PR head.