Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions .claude/settings.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,33 @@
{
"permissions": {
"allow": [
"Bash(git status*)",
"Bash(git status)",
"Bash(git diff*)",
"Bash(git log*)",
"Bash(git branch*)",
"Bash(git push*)",
"Bash(./scripts/run.sh *)",
"Bash(./scripts/lint.sh *)"
],
"deny": [
"Bash(git push*)",
"Bash(git push* --force*)",
"Bash(git push* +*)",
"Bash(git push* -f*)",
"Bash(git push* -uf*)",
"Bash(git push* -vf*)",
"Bash(git push* -qf*)",
"Bash(git push* -nf*)",
"Bash(git push* -df*)",
Comment on lines +13 to +20

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

security-critical critical

BLOCKER: Allowing git push* without restricting --exec and --receive-pack flags introduces a critical security vulnerability.

An agent can execute arbitrary local bash commands by running git push with the --exec or --receive-pack option pointing to a local repository path (e.g., git push --exec="id" .). Since git push* is in the allow list, this command would be executed automatically without user prompting.

Please add explicit deny rules for --exec and --receive-pack to prevent this command-injection vector.

      "Bash(git push* --force*)",
      "Bash(git push* +*)",
      "Bash(git push* -f*)",
      "Bash(git push* -uf*)",
      "Bash(git push* -vf*)",
      "Bash(git push* -qf*)",
      "Bash(git push* -nf*)",
      "Bash(git push* -df*)",
      "Bash(git push* --exec*)",
      "Bash(git push* --receive-pack*)"
References
  1. Section 2 (Security): Parameterized queries used, all user input validated/escaped before use, no hardcoded secrets. (link)

"Bash(git reset --hard*)",
"Bash(rm -rf*)"
"Bash(rm -rf*)",
"Bash(rm -fr*)",
"Bash(rm -Rf*)",
"Bash(rm -fR*)",
"Bash(rm -r -f*)",
"Bash(rm -f -r*)",
"Bash(rm -R -f*)",
"Bash(rm -f -R*)",
"Bash(rm --recursive*)"
Comment on lines +22 to +30

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

WARNING: The current rm deny list does not cover several common recursive/force delete combinations, such as using --force with -r/-R or --recursive. This allows Claude to potentially prompt for or execute destructive commands like rm -r --force or rm --force -r.

Additionally, please note that simple glob matching is sensitive to whitespace; extra spaces (e.g., rm -rf) can bypass these rules.

Let's expand the deny list to cover these additional --force combinations.

      "Bash(rm -rf*)",
      "Bash(rm -fr*)",
      "Bash(rm -Rf*)",
      "Bash(rm -fR*)",
      "Bash(rm -r -f*)",
      "Bash(rm -f -r*)",
      "Bash(rm -R -f*)",
      "Bash(rm -f -R*)",
      "Bash(rm --recursive*)",
      "Bash(rm -r --force*)",
      "Bash(rm -R --force*)",
      "Bash(rm --force -r*)",
      "Bash(rm --force -R*)",
      "Bash(rm --force --recursive*)",
      "Bash(rm --recursive --force*)"
References
  1. Section 4 (Code Quality): Naming is clear, self-documenting, and follows project conventions. (link)

]
}
}
}
Loading