T09 · Insecure Skill Coding Practices
- Location
SKILL.md:16- Finding
Potential Shell Command Injection Through Unsafely Interpolated DOI Input
- Content
View full analysis
"`. 2. Use a página resolvida para identificar título, autores, publicação, editora/periódico, ano, URL canônica e acesso ao texto quando disponível. 3. Se o DOI não for informado, mas o usuário pedir para localizar uma obra, pesquise na Crossref REST API: `curl -sG "https://api.crossref.org/works" --data-urlencode "query=" --data-urlencode "rows=5"`. 4. Para candidatos Crossref, priorize correspondência por título, autores, ano, tipo (`journal-article`, `book`, `book-chapter`, etc.) e fonte. 5. Quando encontrar o DOI provável, confirme os metadados em: `curl -sL "https://api.crossref.org/works/"`. ``` ### Technical Analysis The skill directs the agent to place a DOI originating from the user directly inside a double-quoted shell command. It requires the DOI to be “normalized,” but it does not define strict validation, reject shell metacharacters, require URL encoding, or prohibit execution through a shell. Double quotes do not make arbitrary interpolation safe when the interpolated value can itself contain a quote. A crafted value containing a closing quote and shell control syntax could terminate the URL argument and introduce additional shell commands. Both the DOI.org resolution command and the Crossref metadata-confirmation command use this unsafe construction pattern. The Crossref search example uses `--data-urlencode` for search terms, which reduces URL-encoding problems, but the DOI path parameters are still directly interpolated into command text. ### Attack Path 1. An attacker asks the agent to resolve or verify a purported DOI. 2. The supplied DOI contains a double quote followed by shell contr ...[truncated 1449 chars]- Remediation
View remediation
