Improper SVG Handling in AI Generated Output
An AI-powered website rendered raw SVG output from its model as active markup instead of escaping it, and the same rendering occurred when a conversation link was shared with another user. An attacker could craft SVG content that produces phishing overlays or UI redressing in a victim's browser context.
Published on medium.com
I wasn’t hunting for this bug at all. I was actually testing a different vulnerability, and to speed things up, I was using an AI-powered website to generate payloads for me.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the application inserted LLM-generated output into the page as raw HTML without escaping or sanitising it, so SVG markup was treated as active content.
Impact
A shared conversation link could render attacker-influenced SVG in a victim's browser, enabling phishing, invisible click layers and UI redressing without the victim interacting beyond viewing the page.
What the attacker needed
Access to the AI website; ability to share a conversation link; victim opens the shared link
The fix
SVG output should not be rendered by default in generated or shared content; it should be escaped, aggressively sanitised, or treated strictly as plain text, with a strong content security policy as an additional control.
How it was found
- Ask the AI website to generate an SVG-based payload.
- Observe that the output is rendered as active markup rather than shown as escaped text.
- Share the generated output using a conversation link.
- Open the shared link as another user and see the SVG rendered in that user's browser context.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
SVG is a picture format that can also contain links and interactive elements. If a website shows SVG code as a real image instead of plain text, those links and overlays become active in the viewer's browser. Here, an AI chat site displayed generated SVG directly, so a shared chat link could show a fake clickable overlay to anyone who opened it.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.