AI Security Atlas › All entries › RAG & Knowledge Retrieval Security

VulnerabilityHigh severity

Lack of Context Sanitization

Retrieved chunks are concatenated into prompts without stripping control tokens, markup, or instruction markers.

Open in the interactive atlas →

Impact

Untrusted document content is interpreted as higher-privilege instructions.

Why this severity

Impact Medium × Likelihood High = High

Impact medium: enables injection but grants no privileges by itself. Likelihood high: unsanitized retrieval is what in-the-wild assistant manipulation exploits.

Impact Medium: Limited or recoverable harm: cost, availability, reputational damage, or exposure confined to one session or user.
Likelihood High: At least one documented real-world incident, and the attack needs no access beyond what the system exposes to ordinary users or content (publishing to a public registry counts as ordinary).

Method: OWASP Risk Rating Methodology

Evidence

Related

Exploited by

Mitigated by

Remediation

  1. Normalize encodings and strip HTML/script before chunking.
  2. Wrap retrieved text in explicit data delimiters the model is trained/instructed to ignore as commands.
  3. Score and drop chunks with high instruction-likeness.

How to verify

Pattern

chunks = chunks.map(c => `<DATA>\n${stripControls(c)}\n</DATA>`);

Framework mapping

OWASP Top 10 for LLM Applications 2025

OWASP Top 10 for Agentic Applications 2026

MITRE ATLAS

NIST AI RMF 1.0