T09 · Insecure Skill Coding Practices
- Location
oc-security-scan.sh:159- Finding
Arbitrary Command Execution Through Unsafe Auto-Fix Evaluation
- Content
View full analysis
- Remediation
View remediation
&2 return 1 ;; esac ``` 4. Use `--` before path operands where supported so paths beginning with a hyphen cannot be interpreted as command-line options. 5. For `.gitignore` updates, avoid dynamically generated `echo -e` commands. Write fixed patterns directly with `printf`: ```bash printf '%s\n' "${missing_patterns[@]}" >> "$gitignore" ``` 6. Validate `OPENCLAW_HOME` before use. Validation is defense in depth and must not replace removal of `eval`. 7. Preserve the confirmation prompt, but display the operation and literal target separately rather than displaying executable shell text. 8. Add regression tests using paths containing spaces, quotes, semicolons, command substitutions, newlines, leading hyphens, and wildcard characters. Verify that these values are treated strictly as literal filesystem paths. ]]>
