T09 · Insecure Skill Coding Practices
- Location
scripts/run.sh:2- Finding
Execution of an Unverified External Script Outside the Audited Package
- Content
View full analysis
&1 | tee "$LATEST" ``` ### Technical Analysis The launcher delegates its primary behavior to `/home/welderjustin/.openclaw/workspace/scripts/health_report.sh`, which is outside the audited project and is not included in the package. Before execution, `run.sh` does not verify that the target is a regular file, that it has trusted ownership and permissions, or that its contents match an approved cryptographic digest. As a result, the code that ultimately executes can be changed independently of this reviewed Skill. An attacker who already has permission to create, replace, or modify the external script can cause arbitrary commands to run when the Skill is invoked. The command also merges standard error into standard output using `2>&1` and persists the combined stream through `tee`. If the delegated script prints sensitive diagnostics, environment details, or secrets, those values may be stored in `latest-health-report.txt`. This issue does not itself grant write access to the external script or elevate privileges. Exploitation requires an existing ability to modify the referenced file or manipulate a writable component of its path. ### Attack Path 1. The attacker obtains write access to `/home/welderjustin/.openclaw/workspace/scripts/health_report.sh`, or can replace a writable file or path component leading to it. 2. The attacker replaces or modifies the script to include arbitrary shell commands. 3. A user, agent, or scheduler invokes `scripts/run.sh`. 4. The attacker-controlled script executes with the opera ...[truncated 927 chars]- Remediation
View remediation
&1` unless error persistence is explicitly required, and ensure the log directory and report file have restrictive permissions. 8. Enable strict shell error handling, including `set -euo pipefail`, so failures in the delegated script are not hidden by a successful `tee` process. ]]>
