T09 · Insecure Skill Coding Practices
- Location
scripts/model-failover.sh:19- Finding
Shell Command Injection Through Persisted Model State
- Content
View full analysis
/dev/null)" ``` ### Technical Analysis The script converts values read from `watchdog-state.json` into shell assignment statements and executes the generated text with `eval`. The values are inserted without shell escaping. Consequently, model names or failed-model data containing shell metacharacters, command substitutions, backticks, quotation marks, or statement separators can alter the generated shell program. For example, a `current_model` value containing `$(command)` is evaluated as part of the generated assignment rather than retained as literal data. The state file is initially derived from the primary model in `openclaw.json`, and it is subsequently modified by the watchdog. A crafted configuration value can therefore reach this execution sink. Direct modification of the user-owned state file is another possible input path. ### Attack Path 1. An attacker or compromised configuration source places a malicious model identifier in `openclaw.json`, or modifies `watchdog-state.json` directly. 2. The malicious value includes shell syntax such as command substitution. 3. Setup copies the configured primary model into the persistent watchdog state, or the altered state is otherwise retained. 4. Model failover is triggered manually or automatically after repeated ...[truncated 920 chars]- Remediation
View remediation
