Skip to content

feat(security): detect a created-in-session core.hooksPath dir (sandbox-escape Issue F) - #86

Merged
rappdw merged 2 commits into
mainfrom
security/hookspath-session-end-detect
Jul 28, 2026
Merged

feat(security): detect a created-in-session core.hooksPath dir (sandbox-escape Issue F)#86
rappdw merged 2 commits into
mainfrom
security/hookspath-session-end-detect

Conversation

@rappdw

@rappdw rappdw commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Sandbox-escape eval Issue F (LOW) — closes the last detection slice of Issue D's residual.

The core.hooksPath :ro mount (#82) is existence-gated: it only covers a hooks dir present at launch. The create-fresh case — core.hooksPath set but the dir absent at launch, so the agent writes .githooks/pre-commit during the session — escapes both the mount and the static protected-dirs walk, and fires on the user's next host git commit. The code + SPEC previously marked this 'deferred to a generalized auto-exec sweep (Issue F)'; this is that sweep.

  • sandy: _sandy_configured_hooks_rel resolves the configured hooks path existence-independently (same containment rules as _sandy_extra_hooks_dir: inside workspace, not root, no .. escape, not an already-protected dir). The launch snapshot records it only if it existed; the exit sweep flags a newly-appeared hooks dir with content.
  • run-tests.sh §38d: 8 resolver cases including the absent-dir case (the gap), plus root/escape/outside-workspace/already-protected rejections.
  • CLAUDE.md + SPEC: document the now-covered create-fresh case.

Detection + warn only (no auto-delete), consistent with the existing philosophy.

rappdw and others added 2 commits July 28, 2026 14:52
…ooksPath dir (Issue F)

Sandbox-escape eval Issue F (LOW). The core.hooksPath :ro mount (#82) is
existence-gated — it only covers a hooks dir present at launch. The create-fresh
case (hooksPath set, dir absent at launch, agent writes .githooks/pre-commit
in-session) escapes both the mount and the static protected-dirs walk, so it went
undetected. It's the last uncovered slice of Pillar #4 (Issue D's residual).

- sandy: _sandy_configured_hooks_rel resolves the configured hooksPath
  existence-independently (unlike _sandy_extra_hooks_dir, which needs the dir to
  exist for the mount), with the same containment rules (inside workspace, not
  root, no .. escape, not an already-protected dir). Snapshot records it only if
  it existed at launch; the exit sweep flags a newly-appeared hooks dir with
  content alongside the other auto-execution configs.
- run-tests.sh §38d: 8 resolver cases incl. the absent-dir case (the F gap),
  root/escape/outside/already-protected rejections.
- CLAUDE.md + SPEC: document the create-fresh coverage (was marked 'deferred').

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@rappdw
rappdw merged commit 64c2ee7 into main Jul 28, 2026
2 checks passed
@rappdw
rappdw deleted the security/hookspath-session-end-detect branch July 28, 2026 15:02
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