T07 · Tool Hijacking and Spoofing
Warning
- Location
- scripts/trigger-evaluator.sh:4
- Finding
- Unverified Delegation to an External Executable<![CDATA[ ## Vulnerability Details **File Location**: `scripts/trigger-evaluator.sh`, lines 4-5 and 30-34 **Vulnerability Type**: `T07: Tool Hijacking and Spoofing` **Risk Level**: Medium ### Vulnerable Code ```sh WORKSPACE="/home/cmart/.openclaw/workspace" ENGINE="$WORKSPACE/scripts/stale_missions_engine.sh" # ... [ -x "$ENGINE" ] || { echo "Error: engine not executable: $ENGINE" >&2 exit 1 } exec "$ENGINE" ``` ### Technical Analysis The skill delegates its primary evaluation operation to an executable outside the audited project directory. Before execution, the wrapper checks only whether the target has its executable permission set. It does not validate the target's owner, permissions, cryptographic integrity, or whether the path resolves through a symbolic link. The external dependency is disclosed in `SKILL.md`, so no concealed malicious payload was identified in the packaged files. Nevertheless, the effective behavior of the `evaluate` command cannot be determined from this package alone. If another user or compromised process can replace the engine, modify its contents, or redirect its path through a symbolic link, a legitimate invocation of the skill will execute attacker-controlled code. ### Attack Path 1. An attacker obtains write access to `/home/cmart/.openclaw/workspace/scripts/stale_missions_engine.sh` or one of its parent directories. 2. The attacker modifies the engine or replaces it with an executable symbolic link or malicious program. 3. A user or agent invokes: ```sh trigger-evaluator.sh evaluate stale_missions_alert ``` 4. The wrapper's executable check succeeds because the substituted target is executable. 5. `exec "$ENGINE"` transfers control to the attacker-controlled program under the privileges of the invoking account. ### Impact Assessment Successful exploitation provides arbitrary command execution with the privileges of the user running the skill. The resulting access may include local files, environment vari ...[truncated 325 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Package the evaluation engine inside the audited skill directory whenever possible. 2. Store the engine in an administrator-owned location that is not writable by the invoking user or other untrusted accounts. 3. Resolve the target to its canonical path and reject symbolic links or paths that escape the expected directory. 4. Verify that the engine and every parent directory have trusted ownership and restrictive permissions before execution. 5. Pin and validate a cryptographic digest or verify a signed artifact before transferring control. 6. Fail closed if any ownership, permission, path, or integrity check is unsuccessful. 7. Include the engine in future code-audit scope so the complete evaluation behavior can be reviewed. ]]>
