T09 · Insecure Skill Coding Practices
- Location
SKILL.md:34- Finding
Shell Command Injection Through Unescaped User-Controlled JSON Values
- Content
View full analysis
- Remediation
View remediation
"$payload_file" curl --fail-with-body --silent --show-error \ -X POST "https://trio.machinefi.com/api/check-once" \ -H "Authorization: Bearer $TRIO_API_KEY" \ -H "Content-Type: application/json" \ --data-binary "@$payload_file" ``` 4. Pass values through environment variables or fixed argument arrays rather than generating a shell program dynamically. 5. Validate stream URLs against explicitly supported schemes. Reject shell metacharacters only as defense in depth; validation must not replace correct argument handling. 6. Apply the same correction to the check-once, live-monitor, and live-digest examples. 7. Run the agent with a restricted operating-system account, a minimal environment, limited filesystem access, and constrained outbound network access to reduce impact if another injection flaw is introduced. 8. Add automated tests using quotes, newlines, command substitutions, semicolons, and other shell metacharacters to verify that inputs remain data rather than executable syntax. ]]>
