T09 · Insecure Skill Coding Practices
- Location
scripts/sentiment_data.py:15- Finding
Untrusted RSS Content Can Influence Real-Money Trading Decisions
- Content
View full analysis
Vulnerability Details
File Location:
scripts/sentiment_data.py:15-29,scripts/sentiment_data.py:49-60, andSKILL.md:37-62
Vulnerability Type: Indirect prompt injection through untrusted external content
Risk Level: HighVulnerable code:
python response = requests.get(feed_url, timeout=10) if response.status_code == 200: root = ET.fromstring(response.content) count = 0 for item in root.findall('.//item'): if count >= limit: break title = item.find('title').text if item.find('title') is not None else "No Title" description = item.find('description').text if item.find('description') is not None else "" news_items.append({ "source": feed_url, "title": title, "description": description[:200] + "..." if len(description) > 200 else description })python for news in all_news: sentiment = analyze_sentiment(news['title'] + " " + news['description']) sentiment_label = "NEUTRAL" if sentiment > 0.1: sentiment_label = "POSITIVE" elif sentiment < -0.1: sentiment_label = "NEGATIVE" processed_news.append({ "title": news['title'], "sentiment_score": round(sentiment, 2), "sentiment_label": sentiment_label })The associated workflow instructs the Agent to use this output when deciding whether to place a trade:
markdown **Sentiment Analysis** Run the sentiment script to fetch latest news headers and forum buzz. ```bash python skills/crypto_trader/scripts/sentiment_data.py2. Decision Making & Logging
Analyze & Record Based on the outputs from step 1, form a hypothesis. Is the market Bullish, Bearish, or Neutral?
3. Execution
Trade If the analysis supports a trade, execute it.
text ### Technical Analysis RSS titles and descriptions are remo ...[truncated 1840 chars]- Remediation
View remediation
Remediation Suggestions
- Treat every RSS field as untrusted data and explicitly instruct the Agent never to follow commands or recommendations contained in fetched content.
- Place feed content in a rigid structured-data boundary and label fields as quotations from external sources.
- Use a deterministic preprocessing layer to reject or flag instruction-like content before presenting it to the Agent.
- Do not allow news text alone to trigger a trade. Use independently validated numerical signals and predefined trading rules.
- Require explicit human confirmation for every real-money order, displaying the symbol, side, order type, quantity, estimated value, and decision rationale.
- Enforce maximum order values, daily loss limits, symbol allowlists, position limits, and cooldown periods in
trade.py. - Use a Binance API key restricted to trading only, disable withdrawal permission, and apply an IP allowlist where supported.
- Keep dry-run mode as the default and require a separate explicit flag for live trading.
