T08 · Insecure Dependencies
- Location
scripts/pr_auto_check.sh:56- Finding
Untrusted Health-Check Script Discovery and Execution
- Content
View full analysis
/dev/null || echo '{"max_severity":2,"checks":{}}') else # Fallback: try installed healthcheck skill HC=$(find ~/.openclaw/skills/healthcheck -name healthcheck.sh -type f 2>/dev/null | head -1) if [[ -n "$HC" ]]; then HEALTH_JSON=$(bash "$HC" --json 2>/dev/null || echo '{"max_severity":2,"checks":{}}') else HEALTH_JSON='{"max_severity":-1,"checks":{},"note":"healthcheck script not found"}' fi fi ``` ### Technical Analysis The pipeline automatically executes either a sibling `healthcheck.sh` file or the first recursively discovered file with that name under `~/.openclaw/skills/healthcheck`. It does not verify the selected script's canonical path, owner, permissions, origin, or cryptographic integrity. The fallback is particularly unsafe because `find ... | head -1` selects a script based on filesystem traversal order. If an attacker or compromised dependency can write beneath the searched directory, a counterfeit script can be selected and executed by `bash`. The sibling script is also trusted solely because it exists and is executable. The discovered script runs with the same operating-system identity, environment, filesystem access, and available credentials as the PR auto-check process. ### Attack Path 1. An attacker obtains write access to the sibling health-check location or a directory beneath `~/.openclaw/skills/healthcheck`. 2. The attacker creates a malicious file named `healthcheck.sh`. 3. The user or Agent invokes `scripts/pr_auto_check.sh`. 4. The pipeline locates the malicious file without validating its provenance. 5. The script is executed with ...[truncated 572 chars]- Remediation
View remediation
