T03 · Remote Payload Retrieval and Execution
- Location
scripts/runner.sh:27- Finding
Mutable Git Updates Are Executed by the Recurring Audit Runner
- Content
View full analysis
/dev/null 2>&1 && [[ -d "$ROOT_DIR/.git" ]]; then git -C "$ROOT_DIR" pull --ff-only >/dev/null 2>&1 || true fi fi ``` The retrieved working-tree content is subsequently executed: ```bash REPORT="$($SCRIPT_DIR/run_audit_and_format.sh "${args[@]}")" ``` ### Technical Analysis When `PROMPTSEC_GIT_PULL=1`, the scheduled runner performs `git pull --ff-only` against the repository's currently configured remote and branch. It does not pin an expected commit, verify a signed commit or tag, validate file hashes, or compare the update against a trusted release manifest. A fast-forward-only update prevents local history rewriting but does not establish authenticity. An attacker who can publish to the tracked branch, compromise the upstream account, alter repository DNS or credentials, or modify the local Git remote can replace executable files such as `run_audit_and_format.sh`, `render_report.mjs`, or the email-delivery scripts. The runner then executes files from the updated working tree during the same invocation. Suppressing the Git error with `|| true` also makes update failures less visible to operators. ### Attack Path 1. An operator enables `PROMPTSEC_GIT_PULL=1`. 2. The Skill runs through its unattended cron job. 3. An attacker compromises the tracked repository, branch, publisher account, or local remote configuration. 4. The attacker publishes a fast-forward commit containing modified executable scripts. 5. `git pull --ff-only` accepts the commit without cryptographic trust verification. 6. The runner invokes the newly retrieved `run_audit_and_format.sh`. 7. The malicious code executes with the filesystem, environment, network access, and OpenClaw credentials available to the schedu ...[truncated 526 chars]- Remediation
View remediation
