Double Trouble: Finding Both XSS and HTML Injection in an AI Chatbot
An AI support chatbot on a company's Responsible Disclosure page reflected user input without any sanitisation, so HTML and script tags were rendered and executed in the chat window. An attacker could inject a script that runs in the context of the page and reads the visitor's cookies.
Published on vanshrathorebughunter.medium.com
It’s easy to assume that modern web applications are fortified against the classic, low-hanging vulnerabilities of the past. As bug hunters, we often find ourselves digging deep into complex logic flaws, chaining multiple bugs just to get a single pop-up.
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 chatbot rendered user-supplied messages as raw HTML instead of encoding or sanitising them before display.
Impact
An attacker could run script in the page context of anyone viewing the chat, which could allow reading the visitor's cookies; the text does not show a full account takeover.
What the attacker needed
Access to the public disclosure page; ability to type into the chatbot
How it was found
- Open the company's Responsible Disclosure page and identify the AI support chatbot.
- Enter basic HTML and script tags into the chat input.
- Observe that the chatbot renders the tags as live HTML and executes the script.
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.
A chatbot on a website took whatever text a visitor typed and showed it back in the chat without cleaning it first. Because of that, a visitor could type special formatting or script code that the browser treated as part of the page rather than as plain text. That let the code run inside the site, which is called cross-site scripting, and it could be used to read things like the visitor's cookies.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.