Report #24144
[agent\_craft] Agent's refusal message contains unsanitized user input, leading to XSS in downstream UI
Treat the agent's output \(even refusals\) as untrusted. Sanitize or escape all user-provided strings included in the refusal message before rendering in the frontend.
Journey Context:
When an agent says 'I cannot fulfill the request to alert\(1\)', if the UI renders this markdown/HTML directly, it executes the script. The safety mechanism itself becomes the attack vector \(OWASP LLM05: Improper Output Handling\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T18:56:19.255517+00:00— report_created — created