T05 · Unauthorized Access and Privilege Escalation
- Location
SKILL.md:17- Finding
Overly Broad Git and Agent Tool Permissions Violate Least Privilege
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, line 17
Vulnerability Type: Excessive tool permissions
Risk Level: MediumAffected code:
yaml allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) AgentTechnical Analysis
The Skill grants unrestricted access to all Git subcommands through
Bash(git:*)and permits delegation throughAgent. Its documented purpose is to provide defensive Go coding guidance and review Go source files. Unrestricted Git operations and general Agent delegation are broader than necessary for that purpose.The Git wildcard may authorize commands that modify repository configuration, hooks, branches, remotes, and working-tree content or push changes using credentials already available in the environment. Agent delegation may further expand the available operational scope beyond the explicitly listed Go review tools. This creates a least-privilege violation: malicious or prompt-injected task content could influence the model to invoke capabilities unrelated to Go safety analysis.
No evidence was found that the Skill currently executes malicious Git commands, accesses credentials, establishes persistence, or exfiltrates data. The risk arises from the excessive capabilities exposed by its configuration.
Attack Path
- The Skill is loaded for a Go code review or editing task.
- Attacker-controlled content in a source file, task description, or other reviewed input supplies instructions designed to influence the agent.
- The agent follows those instructions and invokes an unnecessary command allowed by
Bash(git:*), such as altering repository configuration, changing remotes, modifying branches, or pushing commits. - Alternatively, the agent delegates work through
Agent, potentially broadening execution beyond the narrowly documented review workflow. - The operation affects the local repository or, where credentials and network ac ...[truncated 519 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove
Bash(git:*)andAgentunless a documented workflow demonstrates that they are necessary. - Retain only capabilities directly required for Go safety review, such as
Read,Glob,Grep, and narrowly scopedgoorgolangci-lintcommands. - Grant
EditandWriteonly when the Skill is explicitly expected to modify source files. - If Git inspection is required, replace the wildcard with a strict allowlist of read-only commands, such as
git status,git diff, andgit log. - Explicitly prohibit mutating and remote Git operations, including
git push,git config,git remote set-url, hook modification, destructive reset or clean operations, and credential-related commands. - Avoid general-purpose agent delegation, or constrain delegated agents to the same minimal tool policy and repository scope.
- Add tests that verify prompt content cannot cause tool calls outside the documented Go analysis workflow.
- Remove
