T05 · Unauthorized Access and Privilege Escalation
- Location
SKILL.md:18- Finding
Overbroad Tool Permissions Violate Least Privilege
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, line 18
Vulnerability Type: Excessive agent tool authorization
Risk Level: MediumVulnerable 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, andAgentcapabilities 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.WebFetchintroduces an outbound network channel that could disclose information through attacker-controlled URLs or retrieve untrusted content.Agentpermits 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.mdonly reads and injects a key into an API client; it does not transmit or log it.Attack Path
- A repository being analyzed contains attacker-controlled comments, documentation, generated files, or ...[truncated 1162 chars]
- Remediation
View remediation
Remediation Suggestions
Apply least-privilege controls to the Skill declaration:
- Remove
Agentunless delegated execution is demonstrably required. - Remove
WebFetchfor ordinary source work. If documentation retrieval is necessary, restrict it to an allowlist of official domains such aspkg.go.dev,go.uber.org,uber-go.github.io, and the verified upstream GitHub repository. - 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. - Restrict write operations to files needed for the user-requested Go change and require confirmation before modifying dependency manifests or repository metadata.
- Treat repository content and fetched documentation as untrusted data rather than agent instructions.
- Require explicit user approval before any outbound network operation or Git operation that affects a remote.
- Remove
