T09 · Insecure Skill Coding Practices
- Location
scripts/search-stock.mjs:91- Finding
Untrusted Search Content Is Forwarded to the Agent Without Prompt-Injection Controls
- Content
View full analysis
300 ? "..." : ""}`); } console.log(); } ``` The related workflow in `SKILL.md:66-69` directs the agent to consume this output: ```markdown 用户说 "今天A股怎么样" 或 "帮我分析一下股市" 时: 1. 运行搜索脚本获取最新数据 2. 综合分析给出投资建议 ``` ### Technical Analysis The script retrieves an AI-generated answer and search-result fields from Tavily, then writes those fields directly to standard output. The returned `data.answer`, result titles, URLs, and content excerpts originate from external services and indexed websites. They are therefore attacker-influenced data. No trust-boundary marker, output encoding policy, prompt-injection filtering, source allowlist, or instruction hierarchy is applied before this content is exposed to the agent. Meanwhile, the Skill instructs the agent to synthesize the script output into investment analysis. An indexed page can consequently place instruction-like text in its title or content, and Tavily may reproduce that text in `data.answer` or `results[].content`. This does not cause the Node.js script itself to ...[truncated 1923 chars]- Remediation
View remediation
