Overly broad mcp__forgejo* wildcard grants Claude access to destructive Forgejo operations #9
Labels
No labels
shellcheck
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
bc1bb/claude-code-audit#9
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The
claudeinvocation for Forgejo-hosted repos uses--allowedTools "mcp__forgejo*,Read,Glob,Grep,LS". The globmcp__forgejo*matches every Forgejo MCP tool, including many destructive ones that are not required for a read-and-report audit.Location
audit.sh, line 276:Risk
The audit task only needs four Forgejo operations:
list_repo_issues,create_issue,list_repo_labels, andadd_issue_labels. The wildcard also permits tools such as:mcp__forgejo__delete_branchmcp__forgejo__merge_pull_requestmcp__forgejo__delete_file/create_file/update_filemcp__forgejo__delete_releasemcp__forgejo__delete_orgBecause
--permission-mode dontAsksuppresses all confirmation prompts, Claude can invoke any of these without human review. Even without a prompt injection attack, ambiguous or misinterpreted audit instructions could lead Claude to call unintended tools. With a successful prompt injection (see issue #2), an attacker-controlled repo could direct Claude to merge PRs, delete branches, or modify repository content on the Forgejo instance.Suggested fix direction
Replace the wildcard with an explicit allowlist of only the four tools the audit actually needs:
This enforces least privilege and limits blast radius regardless of whether prompt injection succeeds.
Severity
moderate
Found by
Automated audit by Claude Code