T09 · Insecure Skill Coding Practices
- Location
SKILL.md:29- Finding
User-Controlled Research Topic Can Trigger Shell Command Injection
- Content
View full analysis
site:xiaohongshu.com OR site:zhihu.com OR site:weibo.com" ``` ```bash mcporter call glm-search.webSearchPrime search_query="<话题> 痛点 site:v2ex.com OR site:jike.city OR site:sspai.com" ``` ```bash mcporter call glm-search.webSearchPrime search_query="<话题> site:36kr.com OR site:huxiu.com" ``` ```bash mcporter call glm-search.webSearchPrime search_query="<话题> 推荐 site:zhihu.com OR site:v2ex.com" ``` The unsafe pattern is also documented in `references/platforms.md`, lines 58-67: ```bash mcporter call glm-search.webSearchPrime search_query="<话题> site:xiaohongshu.com OR site:weibo.com" mcporter call glm-search.webSearchPrime search_query="<话题> site:zhihu.com OR site:v2ex.com" mcporter call glm-search.webSearchPrime search_query="<话题> site:36kr.com OR site:huxiu.com" mcporter call glm-search.webSearchPrime search_query="<话题> 体验 site:jike.city OR site:sspai.com" ``` ### Technical Analysis The skill instructs an agent to obtain a research topic from the user and substitute that value directly for the `<话题>` placeholder in shell command templates. Although the resulting search query is enclosed in double quotes, double-quoted shell strings still evaluate command substitutions such as `$(command)` and legacy backtick syntax. Consequently, if the agent constructs these commands as strings and executes them through a shell, a malicious topic can be interpreted by the shell before `mcporter` receives the `search_query` argument. The intended data value therefore crosses into a command-execution context without validation or shell-safe argument handling. This is an exploitable coding flaw in the skill ...[truncated 1592 chars]- Remediation
View remediation
