From a Single Quote & a Space to a 1‑Year AI Subscription
The AI chatbot platform failed to properly sanitise user messages, allowing HTML injection when a single quote and space preceded HTML tags. An attacker could create deceptive UI elements, such as fake login forms, that would render in shared chat links and could be used for phishing.
medium.com
Published on medium.com
So, here is the full story. I was using this AI chatbot platform (I can’t name them due to their disclosure policy), and I was really just casually testing it out seeing what it could do and where its limits were.
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 failed to properly escape or sanitise user-supplied content before rendering it as HTML, allowing HTML injection when a specific pattern (a single quote followed by a space) was used.
Impact
An attacker could inject deceptive UI elements, such as fake login forms, into shared chat links, potentially tricking users into entering credentials; however, no script execution was achieved, limiting the attack to HTML injection.
What the attacker needed
A free account; victim clicks a shared chat link
The fix
The bug was fixed by the company after the report.
How it was found
- Send a message containing a single quote, a space, and an HTML tag such as `<b>hello</b>`.
- Observe that the HTML tag is rendered as bold text instead of being displayed as plain text.
- Build a full HTML form with input fields and inline CSS, wrapped in the same quote-and-space pattern, and send it as a chat message.
- Generate a share link for the conversation and open it from a different account.
- See that the fake form renders in the shared chat view.
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.
When you type a message into a chat, the website should treat it as plain text, not as code. Here, the site mistakenly turned some of the user's text into actual web page elements, like bold text or a form. This means someone could make a fake login box appear inside the chat, which other people might trust because it looks like part of the real site.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.