T05 · Unauthorized Access and Privilege Escalation
- Location
SKILL.md:21- Finding
Unrestricted Git Tool Permission Enables Arbitrary Command Execution
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:21
Vulnerability Type: Excessive tool permissions and violation of least privilege
Risk Level: HighVulnerable code:
yaml allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) AgentTechnical Analysis
The skill grants unrestricted access to every Git subcommand and argument through
Bash(git:*), although the documented linting workflows do not require Git command execution.This permission is broader than ordinary repository inspection. It permits destructive operations such as
git clean,git reset, branch deletion, history rewriting, remote modification, and Git configuration changes. More critically, Git supports shell-command aliases. If the tool-policy matcher only verifies that a command begins withgit, an invocation using a temporary alias can execute an arbitrary shell command while still matching the allowedgit:*pattern.For example, the underlying capability can be abused in the following form:
bash git -c alias.payload='!arbitrary-command' payloadThe finding concerns the granted capability; no such malicious command is present in the audited project.
Attack Path
- The skill is loaded for a Go linting or lint-configuration task.
- The agent receives permission to execute any command matching
Bash(git:*). - Malicious or compromised instructions cause the agent to invoke a dangerous Git operation.
- An attacker can use destructive Git commands directly, modify Git configuration, or define a temporary shell-backed Git alias.
- The Git process launches the attacker-selected command with the same operating-system privileges and environment as the agent.
- The command can modify the repository and any other resources accessible to the agent account.
Impact Assessment
Successful exploitation can provide arbitrary command execution under the agent's existing o ...[truncated 746 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove
Bash(git:*)because no documented workflow in this skill requires unrestricted Git execution. - If revision information is genuinely necessary, grant only narrowly scoped, read-only commands such as
git status,git diff, orgit rev-parse. - Enforce argument-level validation rather than relying exclusively on a command-prefix allowlist.
- Explicitly reject dangerous options and command families, including:
git -cand configuration overrides.git config.- Git aliases and shell-backed aliases.
git clean,git reset,git checkout, andgit restore.- Remote, credential, hook, and submodule configuration operations.
- Run any necessary repository inspection in a restricted environment without write access, sensitive credentials, or unnecessary network connectivity.
- Review the remaining tool permissions periodically and retain only capabilities directly required by the documented linting workflows.
- Remove
