XSS (Cross-Site Scripting) in Chatbot
The chatbot application rendered user-supplied HTML in chat messages without sanitisation, allowing HTML injection. An attacker could inject a button with an onclick handler that executes JavaScript when the victim clicks it, achieving reflected XSS.
medium.com
Published on medium.com
Hi Hackers! This is my first write up on the medium.
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 output was inserted into the page as raw HTML without sanitisation or escaping, so user-supplied markup was rendered and event handlers executed.
Impact
An attacker could execute arbitrary JavaScript in a victim's browser session when the victim clicks the injected button, though the exploit requires user interaction.
What the attacker needed
Access to the chatbot interface; victim clicks the injected button
How it was found
- Open the chatbot application and start a chat.
- Send a message containing HTML markup to test for HTML injection.
- Observe that the HTML is rendered in the chatbox.
- Send a message containing a button element with an onclick handler.
- Click the rendered button to trigger the JavaScript.
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 a website takes what you type and puts it directly into the page without cleaning it, you can type HTML code that the site will display as if it were part of the page. Here the chatbot showed a button the attacker created, and clicking it ran JavaScript. This lets an attacker run their own code in another user's browser.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.