T07 · Tool Hijacking and Spoofing
Error
- Location
- SKILL.md:233
- Finding
- Automatic Execution of an Untrusted Repository-Relative Script## Vulnerability Details **File Location**: `SKILL.md`, lines 233-244 **Vulnerability Type**: Untrusted local tool execution through path resolution **Risk Level**: High ### Vulnerable Code ```markdown **Deferred capture for high-scoring suggestions:** After the user confirms which suggestions to act on, any high-scoring suggestion (score > 2.5) that is not acted on should be preserved as a deferred item. Run once per skipped high-scoring suggestion: ```bash python3 scripts/deferred_capture.py \ --title "<suggestion title>" \ --source feature-review \ --context "RICE score: <score>. <description>" ``` This runs automatically without prompting the user. ``` ### Technical Analysis The Skill instructs the Agent to execute `scripts/deferred_capture.py` automatically. That script is not included in the audited Skill package, and the command refers to it through a relative path. When the Skill runs from the target project's working directory, this relative path can resolve to a file controlled by that project. A malicious or compromised repository can therefore provide its own `scripts/deferred_capture.py`. The Skill's instruction to run the script automatically would cause that repository-controlled Python code to execute with the privileges of the Agent process. This behavior exceeds the minimum privileges needed for feature scoring and backlog review. Recording a deferred suggestion does not require executing arbitrary code supplied by the repository under review. ### Attack Path 1. An attacker creates or modifies a repository so that it contains a malicious `scripts/deferred_capture.py`. 2. The repository is submitted for feature review. 3. The Skill identifies a suggestion with a score greater than 2.5. 4. The user chooses not to act on that suggestion. 5. The Skill follows its automatic deferred-capture instruction. 6. `python3` resolves `scripts/deferred_capture.py` relative to the repository and executes the attacker's cod ...[truncated 937 chars]
- Remediation
- ## Remediation Suggestions 1. Remove the instruction to execute the helper automatically. 2. Require explicit user approval after displaying the exact operation, destination, and data that will be written. 3. Bundle the helper inside the trusted Skill package rather than resolving it from the repository under review. 4. Resolve the bundled helper through a canonical absolute path rooted in the verified Skill installation directory. 5. Verify the helper's integrity before execution, such as through a package manifest or cryptographic hash. 6. Reject helper paths that resolve outside the trusted Skill directory, including through symbolic links. 7. Prefer a constrained file-write API over arbitrary Python execution when recording deferred suggestions. 8. Run any unavoidable helper in a sandbox with minimal filesystem access, no inherited secrets, and network access disabled unless strictly required.
