T01 · Skill Instruction Hijacking
- Location
scripts/owl.py:412- Finding
Untrusted Web Content Is Inserted Directly into the LLM Prompt
- Content
View full analysis
str: parts = [ f"You are OWL, an expert research analyst.\n", f"Topic: {query}\n", "=" * 70, "PAPERS (title + abstract + intro + full text where available)", "=" * 70, ] for i, p in enumerate(papers, 1): authors = ", ".join(p.get("authors", [])[:4]) parts.append(f"\n[P{i}] {p['title']}") parts.append(f"Authors : {authors} | Published: {p.get('published','')}") parts.append(f"URL : {p.get('url','')}") parts.append(f"PDF : {p.get('pdf_url','')}") full = p.get("full_text", "") if full: parts.append(f"\nFull text (from PDF via markitdown):\n{full}") else: parts.append(f"\nAbstract:\n{p.get('abstract','')}") parts.append("-" * 60) parts += ["\n" + "=" * 70, "WEB SEARCH RESULTS", "=" * 70] for search_type, results in web_results.items(): parts.append(f"\n── {search_type.upper()} SEARCH ──") for r in results: parts.append(f"\n[{r['label']}] {r['title']}") if r.get("url"): parts.append(f"URL : {r['url']}") if r.get("snippet"): parts.append(f"Snippet: {r['snippet']}") if r.get("page_content"): parts.append(f"Content:\n{r['page_content']}") parts.append("") ``` ```python for r in results[:2]: if r.get("url"): content = web_fetcher.quick_fetch(r["url"]) if content: r["page_content"] = content[:4000] ``` ```python prompt = build_summary_prompt(query, best, web_results) summary = call_claude(prompt, None, max_tokens ...[truncated 2286 chars]- Remediation
View remediation
