T09 · Insecure Skill Coding Practices
- Location
SKILL.md:53- Finding
Command Injection Through Unescaped Search Terms
- Content
View full analysis
]+' | head -10 curl -s "https://duckduckgo.com/html/?q=关键词" curl -s "https://www.wolframalpha.com/input?i=公式" ``` ```powershell Start-Process "https://www.google.com/search?q=关键词" (Invoke-WebRequest -Uri "https://www.google.com/search?q=关键词" -UseBasicParsing).Content -split "`n" | Select-String "href" | ForEach-Object { $_.Matches.Value } | Select-Object -First 10 (Invoke-WebRequest -Uri "https://duckduckgo.com/html/?q=关键词" -UseBasicParsing).Content Start-Process "https://www.wolframalpha.com/input?i=公式" ``` ### Technical Analysis The documented commands imply that the search-term and formula placeholders are replaced with user-controlled values before the resulting command is executed. These values are inserted directly into shell command text without URL encoding, shell-safe argument construction, or input validation. Double quotation marks do not prevent all forms of evaluation: - POSIX-compatible shells perform command substitution such as `$(command)` inside double-quoted strings. - PowerShell evaluates variables, subexpressions such as `$()`, and other expandable-string expressions inside double-quoted strings. - URL metacharacters supplied without encoding can alter the structure and meaning of the outbound request even when they do not cause local command execution. Consequently, a search request that is expected only to become a URL query can become executable local syntax when an agent constructs and runs one of these examples. ### Attack Path 1. An attacker provides a crafted search term or formula containing shell interpolation syntax. 2. The skill is triggered because the input requests a search or knowledge calculation. 3. The agent repla ...[truncated 1397 chars]- Remediation
View remediation
