T05 · Unauthorized Access and Privilege Escalation
- Location
SKILL.md:4- Finding
Excessive Shell and Filesystem Permissions
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, line 4
Vulnerability Type: Excessive tool permissions violating least privilege
Risk Level: MediumCode Snippet:
yaml allowed-tools: Bash, ReadTechnical Analysis
The skill is intended to generate a client education handout, and its documented API requirements are limited to
chatandimage_generation. Nevertheless, its configuration authorizesBashandRead.Shell access can permit arbitrary local command execution within the privileges of the agent process, while filesystem-read access can expose files unrelated to handout generation. The documented workflow does not establish a legitimate requirement for either capability. This unnecessarily expands the skill's attack surface and violates the principle of least privilege.
No malicious commands, credential-access logic, or direct exploitation instructions were found in the reviewed file. Exploitation would therefore depend on the agent being induced to misuse these granted tools, such as through malicious or untrusted task content.
Attack Path
- A user or external content source supplies crafted instructions as part of a handout-generation request.
- Those instructions attempt to persuade the agent to inspect local files or execute shell commands.
- Because the skill explicitly permits
ReadandBash, the agent may invoke those tools despite their being unnecessary for the stated task. - Commands execute with the operating-system privileges of the hosting agent, or local files become accessible to the active session.
- Retrieved information could subsequently be included in generated output or otherwise disclosed, depending on the surrounding agent runtime and safeguards.
Impact Assessment
Successful exploitation could allow command execution and filesystem access within the privilege boundary of the agent process. The practical scope depends on runtime sandboxin ...[truncated 385 chars]
- Remediation
View remediation
Remediation Suggestions
Remove
BashandReadfromallowed-toolsunless a concrete, documented workflow requires them. Restrict the skill to the minimum capabilities needed for text and image generation.If filesystem access later becomes necessary:
- Permit access only to an isolated workspace containing task-specific assets.
- Apply path allowlists and block traversal outside that workspace.
- Deny access to credentials, environment files, user home directories, and system configuration.
- Prefer a narrowly scoped asset-reading tool over general filesystem access.
If command execution is unavoidable:
- Replace unrestricted shell access with a purpose-built tool exposing only required operations.
- Enforce strict argument validation and fixed executable allowlists.
- Run commands in a sandbox with no network access, minimal filesystem mounts, and an unprivileged account.
- Require explicit confirmation for security-sensitive operations.
- Treat all user-provided and externally retrieved content as untrusted instructions.
- Log tool calls and test that handout-generation prompts cannot trigger unrelated file access or command execution.
