Breaking Filter: XSS Bypass using ononmouseovermouseover, ONMOUSE
The application reflected user input inside an HTML attribute without proper sanitisation, allowing an attacker to break out and inject event handlers. The researcher found three successive bypasses of the filter, each time after the previous fix, ultimately achieving JavaScript execution.
This time we are going to talk about bypassing the XSS filter on a program say xyz. So during testing, I found that the application allows user’s to set certain conditions for workflow feature.
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 encode or sanitise user input when inserting it into an HTML attribute, and the subsequent filters were incomplete, allowing bypasses.
Impact
An attacker could execute arbitrary JavaScript in a victim's browser, potentially leading to session hijacking or other client-side attacks, though the text does not specify the full impact.
What the attacker needed
Ability to set workflow conditions; victim triggers the event (e.g., mouseover)
How it was found
- Set a workflow condition with a parameter such as contact that is reflected in the oldValue attribute.
- Break out of the attribute using a double quote and inject an event handler like onmouseover.
- Use a payload without parentheses or backticks to execute alert, such as javascript:window.onerror=alert;throw[1].
- After the first fix, bypass the removal of onxxxxx by using ononmouseovermouseover.
- After the second fix, bypass the removal of event handlers by using uppercase ONMOUSEOVER and a payload without blocked characters.
- After the third fix, the application sanitises double quotes to ", preventing breakout.
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.
The website put user input directly into a part of the page code (an attribute) without cleaning it. By using a double quote, the attacker could close the attribute and add their own code that runs when the mouse hovers over the element. This is called cross-site scripting (XSS), and it lets an attacker run their own JavaScript in the victim'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.