T09 · Insecure Skill Coding Practices
- Location
scripts/run.py:15- Finding
Untrusted Remote Content Is Emitted Without Safety Boundaries
- Content
View full analysis
]*>(.*?)',p.stdout,re.DOTALL) times = re.findall(r']*datetime="([^"]+)"',p.stdout) out = [] for i,m in enumerate(msgs[-8:]): clean = re.sub(r'<[^>]+>',' ',m).strip()[:300] t = times[-(8-i)] if i < len(times) else '' out.append({"text":clean,"time":t}) return out ``` ```python links = re.findall(r'href="(http://[a-z0-9]+\.onion[^"]*)"',p.stdout) titles = re.findall(r']*href="http://[^"]+"[^>]*>([^<]+)',p.stdout) for i,link in enumerate(links[:5]): title = titles[i] if i < len(titles) else link results.append({"title":title.strip()[:80],"link":link}) ``` The resulting values are printed directly: ```python for p in posts: print(f"[{p['time'][:16]}]\n{p['text'][:200]}\n") ``` ```python for p in posts[:3]: print(f" • {p['text'][:100]}") ``` ```python for r in results: print(f" • {r['title']}\n {r['link']}") ``` ### Technical Analysis Telegram messages and dark-web search result titles are controlled by external parties. The implementation removes substrings resembling HTML tags but does not neutralize terminal control characters, distinguish trusted instructions from retrieved data, or provide machine-readable provenance and trust metadata. HTML tag removal is not a sufficient security boundary. An attacker can publish plain-text instructions intended to influence an AI agent, misleading text that impersonates application messages, or terminal escape sequences that alter how output is displayed. The retrieved content is then inserted directly into agent-facing or terminal-facing output. The script does not evaluate or ...[truncated 1846 chars]- Remediation
View remediation
