Observatory defense blueprint · ATO.M0004
Safe Output Rendering & Markdown/Link Exfiltration Guard
Neutralize XSS, active HTML/SVG, and silent Markdown image/link beacons (``) in rendered AI responses.
Control blueprint overview
- Control ID
ATO.M0004- Framework
- Observatory defense blueprint
- Stack layers
- Input/Output Classifier · Tool/Sandbox Boundary
- Techniques addressed
- 0
- OWASP LLM Top 10
- NIST AI RMF
- Reference URI
https://observatory.silvauren.com/catalog/mitigations/ato-m0004/
Control mechanism
Interposes strict output sanitization and Content Security Policy (CSP) controls between LLM text streams and client web/desktop UIs—disabling automatic external image fetches inside rendered Markdown, stripping inline SVG/HTML/JavaScript sinks, warning on unverified external link domains, and blocking query-string token exfiltration.
Implementation steps
- Configure Markdown renderers to block or proxy-allowlist external `<img>` / `` elements so browser clients never fire automatic GET beacons.
- Sanitize rendered HTML via strict DOMPurify profiles with zero raw `<script>`, `<svg>`, `<iframe>`, or `javascript:` URI schemes.
- Enforce strict `img-src` and `connect-src` Content Security Policy (CSP) headers on AI chat and agent UIs.
- Validate with automated `markdown_link_exfil` probes (Refract) that canary secrets cannot be appended to rendered URLs.
What this control stops
- Zero-click Markdown image exfiltration (``) stealing chat context or PII (AML.T0077).
- DOM XSS and Mermaid/SVG script-execution exploits embedded in LLM responses.
- Deceptive crafted assistant hyperlinks spoofing internal login or approval pages (AML.T0131).
Known bypass conditions & residual risk
- User-clicked phishing links if clickable external hyperlinks remain permitted without domain warnings.
- Server-side exfiltration executed via agent HTTP tools rather than client browser rendering (mitigated by AML.M0028/AML.M0032).
- Direct API consumers parsing raw unescaped LLM outputs into unsafe downstream SQL/eval sinks.
Latency, usability & false-refusal trade-offs
Latency: <1 ms client/server Markdown AST sanitization. | False-Refusal Risk: Zero conversational refusal; external third-party images in chat responses appear as inert links or blocked placeholders unless allowlisted. | Operational Cost: Very low; standard Markdown/CSP hardening in web and desktop client renderers.