Repository navigation
fix(security): fence root file opens - #428
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, 6:09 AM ET / 10:09 UTC (Revision 3). ClawSweeper reviewWhat this changesThe branch adds final root and file identity checks before returning descriptors or reading contents, normalizes Windows root spellings, and updates documentation, regression tests, benchmarks, and fixture cleanup. Merge readiness⛔ Blocked before merge - 4 items remain The low-level adapter hardening remains necessary. The merged Root-read work covers only part of this branch; no concrete patch defect was found, but real behavior proof and supplied-root compatibility acceptance remain unresolved. Priority: P2 Review scores
Verification
How this fits togetherfs-safe turns untrusted paths into filesystem access confined to a selected root. Its low-level file adapters supply admitted descriptors to callers, including structured-file readers and synchronous file stores. flowchart TD
A[Untrusted path and root] --> B[Capture root identity]
B --> C[Traverse and validate path]
C --> D[Open and verify descriptor]
D --> E[Recheck root and canonical file]
E -->|Accepted| F[Return descriptor to reader]
E -->|Rejected| G[Close descriptor and report failure]
Decision needed
Why: The security fence is coherent, but acceptance of newly failing existing caller setups requires an explicit compatibility decision rather than an inferred approval from passing tests. Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the exact-identity fence with proven supplied-root compatibility and an explicit upgrade contract for custom adapters and Bun's existing native modes. Do we have a high-confidence way to reproduce the issue? Yes, at source level: current-main low-level opens lack the captured-root and final-canonical admission sequence, and the new tests identify deterministic substitution points. No runtime reproduction was executed during this read-only review. Is this the best way to solve the issue? Yes, structurally: extending the existing pinned-open ownership boundary is a focused solution, and the docs accurately limit it to observational protection; runtime and upgrade evidence remain necessary. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 54342760a4e9. 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
History |
Fence Root reads against replacement of the captured root and final path, rejecting swapped trees before returning file contents or handles.
Fence low-level root-file opens with exact root and final-file identities, consistently admitting native Windows root spellings without weakening symlink or replacement rejection.
905d9a5 to
234d9c9
Compare
Keep file creation outside the observation assertion timeout, settle failed batches, and defer native-loader and mock reset until pending fixture work completes.
Low-level root-file opens could finish against a replaced root or file after traversal. This change captures the Root identity before traversal and verifies the Root, descriptor, and canonical pathname before returning an opened file.
The Windows correction binds native root spelling to the already-observed identity, including caller-supplied rootRealPath values, so short-name roots and long-name files agree without weakening identity checks. Integration preserves single-read pathname snapshots, metadata observations, namespace rejection, and namespaced-drive-root dispatch. POSIX and custom adapters retain their existing lookup ownership.
The integrated package builds and 102 focused open, JSON, path, and store tests pass (10 platform skips). Fresh independent review through P2 found no actionable issue. Head
1ae20ab44184fc5a11def0e0a70f03020e99c457passed Windows and the complete CI matrix, including coverage, then was fast-forwarded onto main.The first Windows run exposed a wide metadata fixture whose timed-out setup could keep writing and alter the following test’s native-loader state. File creation now uses tracked suite setup, failed batches settle completely, and cleanup owns the final mock/native reset. Focused fixture tests pass (20 tests, 1 platform skip); the change received independent review.