T09 · Insecure Skill Coding Practices
- Location
SKILL.md:48- Finding
Unsafe Credential Loading Through Unquoted Shell Expansion
- Content
View full analysis
- Remediation
View remediation
&2 exit 1 fi uv run [SKILL_SCRIPTS_DIR]/generate_image.py \ --prompt "..." \ --filename "output.png" ``` 3. If configuration-file loading is unavoidable, use a dedicated parser that: - Reads one explicitly selected file. - Matches only an anchored `GEMINI_API_KEY=` assignment. - Does not use `eval`, `source`, or unquoted command substitution. - Rejects duplicate or malformed assignments. - Verifies restrictive ownership and permissions. 4. Remove or strongly discourage the `--api-key` argument. Environment variables or a protected credential provider are safer than process arguments. 5. Update every command example in `SKILL.md` and `references/prompt-templates.md` so insecure examples are not copied into generated workflows. 6. Document that image generation is optional and should fail safely when the environment variable is absent. ]]>
