Skip to content

fix(provenance): confine paths before hashing#349

Closed
SUaDtL wants to merge 2 commits into
mainfrom
fix/provenance-path-confinement
Closed

fix(provenance): confine paths before hashing#349
SUaDtL wants to merge 2 commits into
mainfrom
fix/provenance-path-confinement

Conversation

@SUaDtL

@SUaDtL SUaDtL commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Reject NUL, CR/LF, POSIX and Windows absolute paths, root-self paths, parent traversal, and existing symlink escapes before provenance entries reach git hash-object.
  • Remove rejected entries from the in-memory drift comparison so invalid records cannot create false missing-file warnings.
  • Add regression coverage for every rejected path class while preserving valid batched hashing and byte-identical ca and ca-codex hook copies.
  • Mark backlog task v2.harden.0001 complete through the sanctioned task lifecycle.

Why

Provenance records are repository data. They must not control Git's newline-delimited path protocol or resolve outside the project root during SessionStart drift checks.

Verification

  • python .github/scripts/test_provenancelib.py (109 tests)
  • Exact tech-stack.md project suite (15 script suites plus 967 hook tests)
  • python -m py_compile for all three touched hook copies
  • python tools/sync-core.py --check
  • python .github/scripts/check-plugin-refs.py
  • Security review: PASS, no findings
  • Coverage review: PASS after adding the symlink-escape fixture
  • Architecture-drift review: PASS

Tradeoff

Conflict level: §2 L1. The existing Git-based hashing design retains a narrow validation-to-open race under a concurrent local filesystem mutator. The documented boundary assumes a cooperative local host, and descriptor-based hashing would be a separate architecture change.

SUaDtL added 2 commits July 20, 2026 03:36
Record the SMARTS selection and audited task start before the implementation commit. This preserves the task board's required queued-to-in-progress lifecycle transition.
Provenance records are repository data and must not control git's newline-delimited path protocol or escape the project root. Filter unsafe drift triggers before existence checks, hashing, and drift comparison.

CHANGELOG: Reject unsafe provenance paths before startup drift hashing.
@SUaDtL

SUaDtL commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator Author

Superseded by #313, the single hackathon review surface. This PR's recorded head and changes are represented in #313's exact 16-PR / 29-commit / 126-path source manifest. PR #313 passed final exact-head CI at commit 6173b1d and remains open and unmerged. Closing this source PR to avoid parallel review; please continue review and discussion on #313.

@SUaDtL SUaDtL closed this Jul 20, 2026
@SUaDtL
SUaDtL deleted the fix/provenance-path-confinement branch July 24, 2026 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant