T09 · Insecure Skill Coding Practices
- Location
scripts/research_crawler.py:161- Finding
Server-Side Request Forgery Through Unvalidated Search Result URLs
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This market research skill is mostly purpose-aligned, but its fallback crawler can make unscoped web requests to URLs from search results and feed untrusted page text back into the agent.
Review before installing. The skill is not clearly malicious, but run its crawler only in a sandboxed environment with restricted outbound network access, avoid using it where internal services or metadata endpoints are reachable, and treat all crawled text as untrusted source material rather than instructions. Prefer the RSS/web_fetch path and only use -o output when you intentionally want a local JSON file.
scripts/research_crawler.py:161Server-Side Request Forgery Through Unvalidated Search Result URLs
scripts/research_crawler.py:179Indirect Prompt Injection Through Untrusted Crawled Web Content
The stated purpose is market analysis, but the instructions also direct active web crawling, search-engine querying, content extraction, and local JSON output. This mismatch is dangerous because it hides materially riskier behavior behind an innocuous description, reducing informed consent and making misuse or over-privileged execution more likely.
The skill instructs the agent to perform network access and potentially write files via the crawler output, but it declares no explicit tool scope or permissions. This creates an authorization gap where a seemingly simple analysis skill can invoke higher-risk capabilities without transparent user or platform constraints.
The manifest description says the skill triggers on requests for '市场调研、行业分析、竞争分析、商业可行性分析等', where the '等' and broad analysis terms make activation boundaries unclear. This lacks specific scope limits or negative examples, increasing the chance of unintended invocation for generic business-analysis requests.
The skill includes instructions to run a local Python crawler script as a fallback, expanding capability from text analysis into arbitrary code execution. Running local scripts increases attack surface substantially because the script may access the filesystem, network, or other local resources beyond what users expect from a research assistant.
The instructions describe network crawling and saving results to local files without explicit user warning or opt-in. This is risky because it can create unexpected outbound requests and local artifacts, affecting privacy, auditability, and user trust.
The HTTP header sets Accept-Language to "zh-CN,zh;q=0.9,en;q=0.8", which forces a Chinese locale preference for all requests. The file also presents all user-facing help text in Chinese, but does not state that the tool is region-specific or allow users to opt into another language/locale.
The code follows a URL extracted from untrusted Baidu search result HTML with requests.get(..., allow_redirects=True) and no hostname or scheme validation. This creates an SSRF-style outbound request primitive that can be abused to make the agent contact arbitrary external endpoints and potentially internal services if attacker-controlled content appears in results or redirect chains.
# 百度搜索结果需要解析真实URL
if 'baidu.com' in href and 'http' not in href:
try:
resp = requests.get(href, headers=HEADERS, timeout=5, allow_redirects=True)
href = resp.url
except:
pass
The manifest describes a market-research assistant that generates structured analysis from a user-provided topic, but this script directly fetches arbitrary URLs and extracts full page content. While web retrieval is relevant to research, implementing a standalone crawler that downloads and parses arbitrary pages is a materially broader behavior than the manifest's analysis-focused description.
When search engines fail, the code fetches homepage content from hardcoded news sources and returns it as research input, even though those pages may not match the requested industry or product topic. This diverges from the manifest's promise to analyze the user-provided research subject, because the fallback can supply generic site content instead of topic-specific market research.
The instructions specify '默认中文输出' and require Chinese punctuation/formatting, which imposes a language preference without indicating that the user may choose another language. Per the policy, forcing a specific language without opt-in is a natural-language policy issue unless clearly justified or optional.
The manifest describes generating a market analysis report, but the code also supports saving raw search and crawl output to an arbitrary local JSON file. Local file output is not obviously implied by the skill description and represents extra behavior beyond simply producing analysis for the user.