How We Discovered a Stored HTML Injection in a Chatbot System ️
A chatbot stored user-supplied HTML without sanitisation and rendered it on page reload, allowing HTML injection. An attacker could inject arbitrary HTML, potentially leading to defacement or phishing, but JavaScript execution was disabled so no XSS was achieved.
medium.com
Published on medium.com
As budding cybersecurity enthusiasts, we’re always on the lookout for vulnerable systems that can help us learn and sharpen our skills. One casual evening of testing led us — Het Patel and Kaif Shah — to discover a Stored HTML Injection vulnerability in the chatbot feature of redacted.co.in, an AI-driven platform that…
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 stored user messages without sanitising HTML and rendered them without escaping when loading chat history.
Impact
An attacker could inject HTML to cause page defacement or phishing content, but JavaScript execution was fully disabled so no script-based attacks were possible.
What the attacker needed
Access to the chatbot feature; victim views the chat history
How it was found
- Open the AI chatbot feature and find the message input field.
- Enter a simple HTML tag as a chat message.
- Refresh the page or revisit to load the chat history.
- Observe that the HTML is rendered as markup rather than shown as text.
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.
HTML injection is when a website saves text you type and later shows it as actual web page code instead of plain text. Here, the chatbot saved messages containing HTML tags and displayed them as real formatting when the chat history was reloaded. The authors could not run JavaScript, so the impact was limited to changing how the page looked.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.