T09 · Insecure Skill Coding Practices
- Location
skill.md:54- Finding
Command Injection Through User-Controlled Topic Interpolation
- Content
View full analysis
- Remediation
View remediation
&2 exit 1 fi jq -n \ --arg topic "$TOPIC" \ --argjson days "$DAYS" \ '{topic: $topic, days: $days}' | curl --fail-with-body \ -X POST 'https://www.openlesson.academy/api/agent/plan' \ -H "Authorization: Bearer $OPENLESSON_API_KEY" \ -H 'Content-Type: application/json' \ --data-binary @- ``` Additional hardening measures: 1. Validate `DAYS` against the API's accepted numeric range before serialization. 2. Invoke `curl` directly rather than through a nested shell. 3. Keep the API key in the environment or a protected credential store; do not embed it in a generated command string. 4. Avoid verbose tracing such as `set -x` while handling authorization headers. 5. Use `curl --fail-with-body` and check its exit status so API failures are not silently treated as successful operations. 6. Update every command example in the Skill to use structured serialization consistently. ]]>
