security: separate logical and host path contracts - #17
Merged
Merged
Conversation
Owner
Author
|
Finalizer review at 83b98d0 completed after CI. All seven current checks pass, including the changed-file blocking gate and synthetic PASS/FAIL/redaction contract. The initial gate failure was limited to entropy-like ASCII mapping literals; 83b98d0 replaces those literals with the equivalent explicit ASCII code-point range without changing the approved collision policy. Final diff review found no scope drift: acquisition, PR #16, workflow activation, baseline/scanner/report semantics, and repository settings remain unchanged. The fresh 242-file probe again preserved all paths, modes, blob identities, and 2,260,062 bytes with successful cleanup and no target-content execution. PR remains draft; workflow activation remains out of scope. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Separate Git logical path identity from portable filesystem materialization policy.
The snapshot reader now admits exact strict-UTF-8 logical paths without applying host-specific filename rules. The materializer independently performs complete-tree portable path validation and collision preflight before populating the target directory.
Motivation
The previous reader used a deliberately portable ASCII pathname subset. A real repository probe showed that this rejected eight legitimate current paths containing ordinary punctuation or Unicode characters.
Those names are valid snapshot identities and safe to treat as data. Host-specific pathname restrictions belong at the materialization boundary.
Reader contract
The reader now:
SnapshotFile.pathremains an exact Pythonstr.Materializer contract
Before creating any target-tree entry, the materializer performs complete-tree preflight covering:
.gitconsumer-policy rejection;Arbitrary manually constructed
Snapshotobjects are validated independently rather than treated as trusted reader output.Existing exclusive creation, regular-entry/reparse checks, no-follow verification, exact-byte readback, and cleanup behavior remain unchanged.
Cross-platform determinism
The canonical
portable-v1policy uses explicit project-defined collision rules rather than runtime-dependentntpath.normcase()behavior.For example:
Unicode normalization does not alter snapshot identity. Canonically equivalent NFC/NFD names remain distinct logical paths but are rejected as a portable materialization ambiguity.
Compatibility
The eight legitimate path classes that previously failed reader admission are now accepted without special-casing individual filenames.
A read-only full-repository probe verifies all 242 regular files through the reader and materializer with exact path identity, modes, blob identities, and file bytes preserved.
Security properties
Path-policy and collision failures occur before the materialized target tree is populated.
The change does not enable symlinks or gitlinks, execute repository content, or weaken existing object-identity and filesystem-write verification.
Scope
This change is independent from pull-head acquisition.
It does not modify:
Workflow activation remains a separate reviewed step after path admission is established.
Pipeline
Validation
Windows
10.0.26200.9445, Python3.14.3:WSL Ubuntu
24.04.4 LTS, Python3.12.3:Additional validation:
4.5.1: passed;0.15.5: passed;git diff --check: passed, with only existing line-ending warnings;Read-only full-repository probe at commit
56fdb32012f287c8fc615df711c02d41a9919052, tree960dc6c6496f1260f6fab74b64f26408024cd5fb:ad39acf89d0826ce2651ed14d12e143d7f0a8b5cb6b2eb219b46895688f45d0a;