T09 · Insecure Skill Coding Practices
- Location
SKILL.md:87- Finding
Arbitrary Shell Command Execution Through Unsafe Dotenv Sourcing
- Content
View full analysis
- Remediation
View remediation
&2 exit 1 } curl --fail --silent --show-error \ -H "Authorization: Bearer ${SERVICEGRAPH_API_KEY}" \ 'https://api.servicegraph.co/v1/datasets/pro_services/fields' ``` 4. If dotenv-file support is unavoidable, use a dedicated parser that treats the file strictly as data. Permit only the exact `SERVICEGRAPH_API_KEY` key, validate its expected format, and reject command substitutions, shell expansions, additional keys, malformed records, and duplicate assignments. 5. Avoid command forms such as `source FILE`, `. FILE`, or `eval` for secret loading. 6. Keep the existing instruction not to paste the key into chat, and ensure errors and debug output never print the bearer token. 7. Document that local configuration files must not be trusted merely because they exist in the workspace. ]]>
