trailofbits / trailofbits/claude-code-config
harden sandbox file write deny rules - cover .git/hooks
Nobody has claimed this yet.
- Dominant language
- Shell
- Stars
- 2.1k
- Forks
- 161
- Avg merge
- 3d 59m
- Merged PRs (30d)
- 1
Description
.git/hooks/ is not in the deny list for file writes
The deny rules protect ~/.bashrc, ~/.zshrc, ~/.ssh/** — but not .git/hooks/**. The /sandbox restricts writes to
CWD, but .git/hooks/ is a subdirectory of the project root, so it's inside the allowed write scope. A sandboxed
agent can write and chmod +x a hook file. The hook fires at next git commit with full user privileges, outside
the sandbox. We verified this in the ToB settings.json directly.
Fix candidates for the issue: Edit(.git/hooks/) + Write(.git/hooks/) deny rules as a speed bump (doesn't
cover Bash shell redirects), and/or a README recommendation for git config --global core.hooksPath pointing to a
read-only directory as the complete fix.
Happy to make a PR if you like.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting the ToB settings.json deny rules and the README guidance mentioned in the issue. Compare the existing Edit and Write protections for .git/hooks/**, then confirm whether the intended result is deny rules, the core.hooksPath recommendation, or both; done means the chosen mitigation is present and documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, shell
- Domain
- devtools, security
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100