T09 · Insecure Skill Coding Practices
- Location
SKILL.md:194- Finding
Execution of an Unverified Relative Script
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 5 and 194
Vulnerability Type: Execution of an unresolved local script
Risk Level: MediumVulnerable Code
yaml allowed-tools: read execbash python3 write.py draft --input topic-card.md -o draft.mdTechnical Analysis
The Skill grants command-execution capability and documents execution of
write.pythrough a relative path. The audited project contains onlySKILL.md; it does not include or verify the referenced script.Relative script resolution depends on the Agent's current working directory. If an attacker can place a file named
write.pyin that directory, the documented command will execute the attacker's code. No fixed Skill-relative path, integrity validation, ownership check, or user confirmation is specified.The core functionality is described as Markdown-driven article generation, so unrestricted command execution is not necessary for its primary purpose.
Attack Path
- An attacker gains the ability to create or influence files in the Agent's working directory, shared workspace, or extracted project location.
- The attacker places a malicious file named
write.pyin that directory. - A user requests the optional scripted workflow described by the Skill.
- The Agent executes
python3 write.py draft --input topic-card.md -o draft.md. - Python resolves the relative path to the attacker-controlled script.
- The script executes with the operating-system privileges and environment access of the Agent process.
Impact Assessment
Successful exploitation provides arbitrary Python code execution under the Agent's account. Depending on that account's permissions, an attacker could read or modify accessible files, obtain environment variables and locally available credentials, alter generated content, invoke network services, or execute additional local commands.
This does not independently provide ...[truncated 151 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove
execfromallowed-toolsif the optional script is not required. - Remove the documented command unless the referenced script is included in the package and receives a separate security review.
- If the script is retained, resolve it from a canonical path rooted in the installed Skill directory rather than the current working directory.
- Verify the resolved path, file ownership, and cryptographic integrity before execution.
- Run the script in a sandbox with minimal filesystem, environment-variable, and network access.
- Require explicit user confirmation before invoking optional executable components.
- Reject symlinks and paths that resolve outside the trusted Skill directory.
- Remove
