T05 · Unauthorized Access and Privilege Escalation
- Location
SKILL.md:5- Finding
Unnecessary Command Execution and File-Write Capabilities Violate Least Privilege
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 5 and 17–20; the contradictory capability statement appears at line 265
Vulnerability Type: Excessive tool permissions
Risk Level: MediumComplete Code Snippet
yaml allowed-tools: read execyaml tools: - exec - read - writeThe skill later states:
markdown - **Category**: MD (pure Markdown instructions, no exec command-line capability required)Technical Analysis
The skill describes itself as a pure Markdown frontend-design guide and explicitly states that it does not require command-line execution. Nevertheless, its metadata requests both
execandwritecapabilities. Thewritecapability is also listed undertoolsbut omitted fromallowed-tools, creating an inconsistent and ambiguous permission declaration.These capabilities exceed the skill's legitimate requirements. Design guidance and code generation can be delivered as textual output without arbitrary command execution. If reading project context is required,
readalone is sufficient. Grantingexecexposes a local command-execution channel, whilewritemay permit modification of files accessible to the hosting agent.The error-handling section also recommends running
ping, which could encourage use of the otherwise unnecessary execution capability. The audited file does not contain an automatically executed malicious command, credential-stealing logic, persistence mechanism, or remote payload retrieval. The risk arises from excessive authority that could be misused when processing attacker-controlled prompts.Attack Path
- A user or untrusted project supplies crafted design, implementation, or troubleshooting instructions.
- The agent loads this skill with the declared
execandwritetools available. - The crafted input persuades the agent to treat a shell command or file modification as part of frontend implementation or connectivity troubleshooting.
- The ag ...[truncated 1058 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove
execbecause the skill explicitly identifies itself as Markdown-only and does not need command-line execution. - Remove
writeunless direct artifact creation is an essential, documented feature. - Retain only the minimum required capability, such as
read, and makeallowed-toolsandtoolsconsistent. - If file generation is required, replace unrestricted writing with a workspace-scoped output API that blocks path traversal, symlink escapes, and writes outside a designated directory.
- If command execution becomes strictly necessary, use an explicit allowlist with fixed arguments. Never concatenate user-controlled values into shell commands.
- Replace the recommendation to invoke
pingwith host-provided network diagnostics that do not expose a general-purpose shell. - Enforce runtime sandboxing, a non-privileged process identity, network restrictions, and confirmation prompts for security-sensitive operations.
A reduced declaration should resemble:
yaml allowed-tools: read tools: - read- Remove
