T09 · Insecure Skill Coding Practices
- Location
references/cron-job-template.md:18- Finding
Shell Command Injection Through Unescaped Cron Template Values
- Content
View full analysis
' \ BACKUP_BRANCH='' \ BACKUP_TZ='' \ BACKUP_AUTHOR_NAME='OpenClaw Backup' \ BACKUP_AUTHOR_EMAIL='backup@local' \ BACKUP_EXCLUDES='' \ bash -lc ' ' ``` The agent instruction template reinforces execution of the interpolated command: ```text You are running a scheduled git backup for . Requirements: 1) commit if there are staged changes after exclusions, 2) use the bundled backup script so the commit subject includes +added ~modified -deleted counts and the commit body lists changed files, 3) push to /, 4) still run push even if there was no new commit so older local commits are flushed, 5) do not ask the user questions. First run this exact command, then summarize the result briefly: BACKUP_REMOTE='' BACKUP_BRANCH='' BACKUP_TZ='' BACKUP_AUTHOR_NAME='OpenClaw Backup' BACKUP_AUTHOR_EMAIL='backup@local' BACKUP_EXCLUDES='' bash -lc ' ' ``` Related guidance in `SKILL.md` uses the same unsafe construction: ```bash bash -lc ' ' ``` ### Technical Analysis Values such as the repository path, runtime script path, remote, branch, timezone, and exclusion patterns are inserted into shell source code using fixed single quotes. No validation or shell-safe escaping is prescribed. If any substituted value contains a single quote, it can terminate the intended quoted string. Subsequent characters are then interpreted as shell syntax. The use of `bash -lc` introduces another shell parsing pass, increasing the likelihood that metacharacters embedded in generated command text will be executed rather ...[truncated 1485 chars]- Remediation
View remediation
