T05 · Unauthorized Access and Privilege Escalation
- Location
SKILL.md:5- Finding
Excessive and Inconsistent Tool Permissions
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:5andSKILL.md:17-20
Vulnerability Type: Excessive tool privileges and violation of least privilege
Risk Level: MediumVulnerable Code
yaml allowed-tools: read execyaml tools: - exec - read - writeTechnical Analysis
The skill declares
execandwritecapabilities even though its documented function is to construct image-generation prompts from natural-language input. The document later identifies the skill as a pure Markdown workflow that does not require command-line execution.The two permission declarations are also inconsistent:
allowed-toolspermitsreadandexec, while the separatetoolslist additionally requestswrite. Depending on how the hosting agent interprets overlapping metadata, the skill may receive arbitrary command-execution and filesystem-write capabilities that are unnecessary for its legitimate purpose.The document also presents a command invoking
scripts/build_prompt.py, but that script is absent from the audited project. Consequently, the command-execution workflow cannot be verified against local implementation. No malicious command, payload, persistence mechanism, or data-exfiltration behavior was found; the risk arises from unnecessary permissions and the possibility that later untrusted instructions could influence their use.Attack Path
- The agent loads the skill and grants the declared
execorwritecapability. - An attacker supplies crafted prompt content or other untrusted instructions intended to influence tool invocation.
- The skill or agent incorrectly treats the supplied content as a command, command argument, file path, or file content.
- The agent invokes
execorwriteunder its own operating-system privileges. - The attacker may cause local command execution or modification of files accessible to the agent.
Successful exploitation requires ...[truncated 903 chars]
- The agent loads the skill and grants the declared
- Remediation
View remediation
Remediation Suggestions
- Remove
execandwritefrom all tool declarations because prompt construction can be performed directly by the LLM. - Remove
readas well unless the skill genuinely needs to load local template files. - Use a single authoritative tool-permission declaration to prevent inconsistent policy interpretation.
- Remove the example invoking the nonexistent
scripts/build_prompt.py, or add the script to the package and subject it to a separate security review. - If command execution is introduced later, enforce a fixed executable allowlist, pass arguments without shell interpolation, reject user-controlled command fragments, and run the process in a restricted sandbox.
- If file output becomes necessary, restrict writes to a dedicated workspace directory, normalize and validate paths, reject traversal sequences and symbolic-link escapes, and avoid overwriting existing files by default.
- Add automated package validation that rejects references to missing files and flags permissions not justified by documented functionality.
- Remove
