T09 · Insecure Skill Coding Practices
- Location
multi_source_estimator.py:738- Finding
Untrusted Internet Content Can Influence Automated Financial Trades Through Prompt Injection
- Content
View full analysis
str: """ Gather real-time context from all relevant sources in parallel. Returns a formatted string (max ~2000 chars) for injection into the LLM prompt. """ categories = detect_categories(question) if category and category not in categories: categories.insert(0, category) parts = [] # Always fetch news news = _match_news(question) if news: parts.append("RECENT NEWS:\n" + "\n".join(news)) # Dispatch category-specific sources in parallel with ThreadPoolExecutor(max_workers=4) as pool: futures = {} if any(c in categories for c in ["economics", "crypto"]): futures[pool.submit(_get_fred_context, question)] = "FRED" if "geopolitics" in categories: futures[pool.submit(_get_gdelt_context, question)] = "GDELT" if "sports" in categories: futures[pool.submit(_get_odds_context, question)] = "ODDS" if "politics" in categories: futures[pool.submit(_get_538_context, question)] = "538" futures[pool.submit(_get_congress_context, question)] = "CONGRESS" if "pharma" in categories: futures[pool.submit(_get_fda_context, question)] = "FDA" if "weather" in categories: futures[pool.submit(_get_meteo_context, question)] = "METEO" if any(kw in question.lower() for kw in ["earthquake", "quake", "seismic"]): futures[pool.submit(_get_usgs_context, question)] = "USGS" if any(kw in question.lower() for kw in ["earnings", "ipo", "revenue", "stock ...[truncated 5061 chars]- Remediation
View remediation
