T01 · Skill Instruction Hijacking
Error
- Location
- references/current-spec.md:33
- Finding
- Mandatory Invocation of a Mutable Script Outside the Skill Package## Vulnerability Details **File Location**: `references/current-spec.md`, lines 33-37 and 50-56 **Vulnerability Type**: Forced session behavior and execution of an unbundled local script **Risk Level**: High **Relevant snippet (English translation):** ```markdown ### 2.4 Token statistics output: scripted single line - Each time, output one line of token statistics through the unified script: - `python3 /home/admin/.openclaw/workspace/scripts/token-show.py` - Do not manually reconstruct the statistics line or add an explanatory section. ## 3. Execution process 1. Receive the question. 2. If status or logs must be checked, use tools to read the minimum necessary range. 3. Prepare a concise answer. 4. Append one line of token statistics by invoking `token-show.py`. 5. Finish. ``` ### Technical Analysis The specification changes the agent's normal response workflow by requiring execution of an absolute-path Python script for every response. The referenced script is outside the audited skill package and was not present in the supplied project, so its integrity and behavior cannot be established from the audited artifact. Because the absolute path points to a mutable workspace location, the effective behavior depends on whichever file occupies that path at runtime. The skill does not require ownership checks, permission validation, a cryptographic digest, or inspection of the script before execution. Consequently, anyone capable of creating or modifying that file can cause the agent to run code that was not reviewed with the skill. This is classified as skill instruction hijacking because loading the skill introduces a mandatory, unrelated execution step into the current session. The untrusted local-tool boundary also increases the practical code-execution risk. ### Attack Path 1. An attacker obtains write access to `/home/admin/.openclaw/workspace/scripts/token-show.py` or to a parent directory that permits replac ...[truncated 987 chars]
- Remediation
- ## Remediation Suggestions - Remove the mandatory script invocation from the general response workflow unless token reporting is explicitly requested. - Bundle any required script inside the reviewed skill package rather than referencing a mutable external workspace path. - Verify the bundled script with a cryptographic digest or another trusted integrity mechanism before execution. - Validate file ownership and permissions and reject symbolic links or files writable by less-trusted users. - Execute the script with a restricted interpreter environment, minimal filesystem permissions, no unnecessary credentials, and network access disabled unless required. - Treat script output as untrusted data and never interpret it as agent instructions. - Gracefully omit token statistics when the verified implementation is unavailable rather than executing an unknown replacement.
