T07 · Tool Hijacking and Spoofing
- Location
SKILL.md:25- Finding
Repository-Controlled Helper Script Execution
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 25–33
Vulnerability Type: Repository-controlled local tool execution
Risk Level: HighVulnerable code snippet:
markdown From the repository root, run the bundled helper when available. If this skill is installed globally, resolve the script from the installed skill directory, for example `C:\Users\Nick\.agents\skills\semver-release-recommender\scripts\analyze_release_semver.py`, while keeping the working directory at the repository being analyzed. ```powershell python scripts/analyze_release_semver.pyFor JSON output:
powershell python scripts/analyze_release_semver.py --jsontext ### Technical Analysis The Skill instructs the agent to run `scripts/analyze_release_semver.py` from the root of the repository being analyzed. The audited Skill package contains only `SKILL.md`; it does not contain the referenced helper script. Consequently, the relative path resolves to a file controlled by the target repository rather than to a verified component of the installed Skill. A malicious repository can place arbitrary Python code at that path. If the agent follows the documented workflow, the repository-controlled program executes with the permissions and environment of the agent process. The prose mentioning an absolute globally installed path does not neutralize the unsafe relative commands presented as the default quick-collection procedure. Executing repository code is unnecessary for the declared read-only task because the relevant evidence can be obtained through explicit Git inspection commands. The behavior therefore exceeds the minimum privileges required to recommend a semantic-version bump. ### Attack Path 1. An attacker creates or modifies a repository to include a malicious `scripts/analyze_release_semver.py`. 2. The attacker persuades a user to analyze that repository with this Skill. 3. The agent changes its working d ...[truncated 1234 chars]- Remediation
View remediation
Remediation Suggestions
- Remove the relative
python scripts/analyze_release_semver.pycommands from the workflow. - Package the helper within the Skill and resolve it through a verified absolute path rooted in the installed Skill directory, independently of the current working directory.
- Canonicalize the helper path and verify that it remains inside the trusted Skill installation directory before execution.
- Fail closed if the trusted helper is absent; do not fall back to a same-named file in the target repository.
- Prefer explicit, read-only Git commands for evidence collection, as these are sufficient for the declared functionality.
- If execution of repository-provided tooling is ever necessary, clearly identify it as untrusted and obtain separate, informed user approval before running it.
- Run any approved repository code in a sandbox with no credentials, restricted filesystem access, disabled or tightly controlled network access, and no privilege elevation.
- Add a warning that changing the working directory does not establish trust and that relative executable paths must never resolve against the repository being audited.
- Remove the relative
