T01 · Skill Instruction Hijacking
Error
- Location
- SKILL.md:25
- Finding
- Forced Execution of an Unbundled and Unverified Local Script## Vulnerability Details **File Location**: `SKILL.md`, line 25 **Vulnerability Type**: `T01: Skill Instruction Hijacking` **Risk Level**: High **Vulnerable Code Snippet**: ```markdown > **ALWAYS run `python3 ~/.openclaw/scripts/spotify.py [cmd]`** — never respond with text only. ``` ### Technical Analysis The skill unconditionally instructs the agent to execute `~/.openclaw/scripts/spotify.py` and explicitly prohibits a text-only response. The referenced script is outside the project directory and is not included in the audited artifact. Its contents, provenance, permissions, and integrity therefore cannot be verified from this project. Because the path is mutable and external to the reviewed package, the behavior described by the skill is not necessarily the behavior that will execute. Any process or user capable of creating or replacing that file can control the Python code subsequently run by the agent. The unconditional wording also attempts to direct agent behavior whenever the skill is invoked, without requiring validation of the executable or confirmation from the user. ### Attack Path 1. An attacker or compromised local process creates or replaces `~/.openclaw/scripts/spotify.py`. 2. The replacement script contains attacker-controlled Python code. 3. The user makes a request matching one of the skill's Spotify-related triggers. 4. The skill instructs the agent to execute the external script and not provide a text-only response. 5. The attacker-controlled code runs with the same operating-system privileges and environment access as the agent process. 6. The script can access resources available to that account, potentially including files, network services, and Spotify credentials retrieved from macOS Keychain. ### Impact Assessment Successful exploitation permits arbitrary Python execution under the privileges of the account running the agent. The resulting scope may include reading or modifying user-access ...[truncated 419 chars]
- Remediation
- ## Remediation Suggestions 1. Include the Spotify implementation within the audited project rather than referencing a mutable file in the user's home directory. 2. Resolve the executable through a package-relative canonical path and reject paths that escape the installed skill directory. 3. Verify the script against a signed release or an approved cryptographic hash before execution. 4. Remove the unconditional `ALWAYS` and `never respond with text only` directives. 5. Require explicit user confirmation before executing a script whose provenance or integrity cannot be established. 6. Execute the implementation with least privilege and restrict filesystem, Keychain, subprocess, and network access to what Spotify control strictly requires. 7. Document the exact credential access and outbound network behavior so they can be audited.
