Skip to content

fix(audit): refuse external hard-link aliases in entry-point reads - #381

Merged
drevendev merged 3 commits into
masterfrom
beautifulrepo/audit-hardlink-boundary-20261115
Nov 15, 2026
Merged

drevendev merged 3 commits into
masterfrom
beautifulrepo/audit-hardlink-boundary-20261115

Conversation

@drevendev

Copy link
Copy Markdown
Owner

Reader-facing defect

The direct offline entry-point auditor checks for symlinks and non-regular files, but an ordinary hard link can alias data outside the selected repository. The optional MCP preflight and README preview already refuse multiply-linked files; the standalone repo_audit.py path did not.

Change

  • Reject st_nlink > 1 on an entry-point document before opening and on its opened descriptor, preserving the existing path.non_regular diagnostic and no-target-write behavior.
  • Keep the two deterministic standalone skill copies of tools/repo_audit.py byte-identical.
  • Add a disposable synthetic outside source hard-link regression: the audit must not read its sentinel and must leave the external text unchanged. A platform unable to create hard links reports a skipped test, not a proven pass.
  • Record the bounded safety improvement in the public changelog.

Review/acceptance

Run fresh python tools/catalog.py, python tools/docs_links.py, python -m unittest discover -s tests -v, and both scripts/sync_standalone_{audit,trust}.py drift checks on this exact head; inspect Quality and standalone-skills CI. The change is not a full defense against hostile concurrent filesystem races. No model-host execution or external release is claimed.

Scope: follow-up to published BR-AUDIT-011; do not merge in the production step before later-run acceptance and provider gates.

@andy-zen-dev andy-zen-dev left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REQUEST_CHANGES — the third standalone skill copy is stale and the exact-head installed-layout CI fails.

On HEAD c1a464d0e3b92e081bbf15321ac2c24176608fa4, the canonical tools/repo_audit.py, skills/audit-repo/tools/repo_audit.py, and skills/trust-surfaces/tools/repo_audit.py all have blob 3914c6cbd719e88da30a30e624afad95c186d1a5. But skills/improve-readme/tools/repo_audit.py still has older blob d6c514a83ce4cd11d25b2b267d02cc65d561f44f, retaining the old entry-point admission behavior. The existing scripts/sync_standalone_readme.py explicitly lists tools/repo_audit.py as a required deterministic copy.

The Standalone skills CLI copy trial run 43704041016, job installed-layout, failed on this exact head with missing/stale bundle: tools/repo_audit.py immediately after validating the audit-repo and draft-release-notes copies. This makes the shipped improve-readme skill inconsistent with the canonical auditor, despite the two other updated copies.

Required: synchronize skills/improve-readme/tools/repo_audit.py from the canonical source (using python scripts/sync_standalone_readme.py --write in the author's checkout), include it in this PR, verify the audit/readme/trust deterministic drift checks, and rerun the failed installed-layout job on the new exact head. The PR's targeted source regression can then be evaluated across all shipped standalone entrypoints.

I inspected the five-file diff, both repository instruction files, the source and all three shipped auditor copies, the corresponding sync scripts, and the actual CI job log. At review time Quality and MCP smoke were still in progress; their outcomes were not assumed green. Reviewer-local full repository checks were not run. No release or model-host claim is made.

@drevendev drevendev left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Later-run acceptance on exact head 7a7e1d5b6b3d26759246cd58cba3571b71e1fa91: reviewed the six-file diff, all four canonical/standalone repo_audit.py blobs (identical 3914c6c), the synthetic hard-link regression and the Unreleased security note. The previous CHANGES_REQUESTED referred to c1a464d and its missing improve-readme copy; that copy is now synchronized and the new installed-layout job is green. Fresh provider evidence on this head: Quality 6/6, MCP 2/2, standalone installed-layout and browser evidence all SUCCESS (10/10 check runs); review threads 0; mergeable_state=clean. Ruleset #25632587 requires 0 approvals, resolved threads and 5 named status checks, all satisfied. This is author-side COMMENT acceptance, not independent APPROVED. Scope remains bounded: stable checkout, not adversarial concurrent filesystem swaps; no claim of Claude Code/Codex host acceptance. No further material findings in this scope.

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.

2 participants