T05 · Unauthorized Access and Privilege Escalation
Warning
- Location
- SKILL.md:18
- Finding
- Overbroad Tool Permissions Violate Least Privilege## Vulnerability Details **File Location**: `SKILL.md`, line 18 **Vulnerability Type**: Excessive agent tool authorization **Risk Level**: Medium ### Vulnerable Code ```yaml allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent WebFetch mcp__context7__resolve-library-id mcp__context7__query-docs Bash(godig:*) Bash(gopls:*) LSP mcp__gopls__* ``` ### Technical Analysis The Skill primarily provides architectural guidance for applications using `go.uber.org/fx`. Most of that functionality requires reading and editing Go files, searching source code, and optionally running narrowly scoped Go analysis or test commands. The authorization of unrestricted `Bash(git:*)`, `WebFetch`, and `Agent` capabilities exceeds these minimum requirements: - `Bash(git:*)` permits mutating Git operations, including changing remotes, modifying repository configuration, committing changes, and potentially pushing data if credentials are available. - `WebFetch` introduces an outbound network channel that could disclose information through attacker-controlled URLs or retrieve untrusted content. - `Agent` permits delegation to other agents, expanding the effective execution and information-access scope. - Broad write access may allow changes outside the narrow set of Go source files declared under `paths`. The Skill does not contain instructions that actively exploit these permissions. Nevertheless, granting them increases the consequences of prompt injection originating from an untrusted repository or externally retrieved documentation. The pre-scan warning concerning sensitive network transmission was also reviewed. No explicit credential exfiltration was found. The API-key example in `references/recipes.md` only reads and injects a key into an API client; it does not transmit or log it. ### Attack Path 1. A repository being analyzed contains attacker-controlled comments, documentation, generated files, or ...[truncated 1162 chars]
- Remediation
- ## Remediation Suggestions Apply least-privilege controls to the Skill declaration: 1. Remove `Agent` unless delegated execution is demonstrably required. 2. Remove `WebFetch` for ordinary source work. If documentation retrieval is necessary, restrict it to an allowlist of official domains such as `pkg.go.dev`, `go.uber.org`, `uber-go.github.io`, and the verified upstream GitHub repository. 3. Replace `Bash(git:*)` with narrowly scoped, read-only operations such as status, diff, log, and show. Explicitly prohibit push, remote mutation, hooks, configuration changes, and credential-related operations. 4. Restrict write operations to files needed for the user-requested Go change and require confirmation before modifying dependency manifests or repository metadata. 5. Treat repository content and fetched documentation as untrusted data rather than agent instructions. 6. Require explicit user approval before any outbound network operation or Git operation that affects a remote.
