T09 · Insecure Skill Coding Practices
- Location
scripts/assess.py:424- Finding
Indirect Prompt Injection Through Untrusted Claim and Evidence Content
- Content
View full analysis
Vulnerability Details
File Location:
scripts/assess.py:424-437andscripts/assess.py:653-666
Vulnerability Type: Indirect prompt injection caused by unsafe interpolation of untrusted content
Risk Level: HighVulnerable Code
python prompt = f"""You are a fact verification assistant. Based on the following [Claim] and [New Evidence], answer 6 judgments. Output only a JSON object, no other text. Claim: {claim} New Evidence: {evidence[:1500]} Judgment criteria: 1. direct_support: Does the evidence directly support the claim? 2. new_info: Does the evidence provide new information not previously mentioned? 3. logical_consistent: Is the evidence logically consistent with previously known information? 4. direct_refute: Does the evidence explicitly refute the claim? 5. limitation: Does the evidence point out limitations or exceptions? 6. error_outdated: Does the evidence reveal that the claim contains errors or outdated info? Output format: {{"direct_support": true/false, "new_info": true/false, "logical_consistent": true/false, "direct_refute": true/false, "limitation": true/false, "error_outdated": false}}"""The same vulnerable construction is exposed by the AI-friendly interface:
python return f"""You are a fact verification assistant. Based on the following [Claim] and [New Evidence], answer 6 judgments. Output only a JSON object, no other text. Claim: {claim} New Evidence: {evidence[:1500] if evidence else "(No evidence provided)"} Judgment criteria: 1. direct_support: Does the evidence directly support the claim? 2. new_info: Does the evidence provide new information not previously mentioned? 3. logical_consistent: Is the evidence logically consistent with previously known information? 4. direct_refute: Does the evidence explicitly refute the claim? 5. limitation: Does the evidence point out limitations or exceptions? 6. error_outdated: Does the evidence reveal that the claim contains errors or outdated info?...[truncated 2166 chars]
- Remediation
View remediation
Remediation Suggestions
- Place the claim and evidence in clearly delimited, structured data fields rather than concatenating them directly into the instruction text.
- Add an explicit higher-priority instruction stating that all content inside claim and evidence fields is untrusted data and that instructions found there must never be followed.
- Use schema-constrained generation where supported, requiring exactly the six expected boolean properties and rejecting additional fields or text.
- Validate LLM judgments independently against quoted evidence spans. Do not permit the model to mark a feature as true without identifying the supporting or refuting passage.
- Consider a two-stage design in which one component sanitizes and extracts factual passages while a separate model evaluates only those passages.
- Add adversarial tests covering instruction injection in claims, search snippets, page titles, URLs, and evidence bodies.
- For high-stakes use, require human review or corroboration from multiple independently retrieved sources before reporting a claim as verified.
