T09 · Insecure Skill Coding Practices
- Location
skills/persian_x_radar/search.py:119- Finding
Fabricated fallback data can trigger operational intelligence alerts
- Content
View full analysis
List[RawTweet]: query = build_x_query(req) tool_order = [ ("x_keyword_search", x_keyword_search), ("x_semantic_search", x_semantic_search), ("web_search", web_search), ] for _, tool_fn in tool_order: if tool_fn is None: continue try: rows = tool_fn(query=query) if rows: return _normalize_tool_rows(rows) except Exception: continue now = datetime.now(timezone.utc) # Deterministic local mock data to keep the skill runnable without external tools. mock = [ RawTweet( id="m1", author="@analyst_fa", timestamp=now - timedelta(hours=2), text="بحث درباره حمله و موشک در حال افزایش است", likes=420, retweets=130, replies=12, url="https://x.com/analyst_fa/status/1", ), RawTweet( id="m2", author="@iran_watch", timestamp=now - timedelta(hours=3), text="گزارش هایی از اعتراض در چند شهر منتشر شده است", likes=170, retweets=42, replies=9, url="https://x.com/iran_watch/status/2", ), ] return mock ``` The returned rows are subsequently processed and dispatched as ordinary intelligence: ```python tweets = search_with_fallback( req=req, x_keyword_search=self.tools.x_keyword_sea ...[truncated 2397 chars]- Remediation
View remediation
