Art of onscrollend | Demonstrating XSS through scroll events with write-up
A hidden input field reflected a parameter without proper sanitisation, allowing an attacker to inject a slot element with an onscrollend event handler. By using a hash fragment to trigger scrolling, the attacker could execute JavaScript and steal cookies.
Published on infosecwriteups.com
Through development of Web Application Firewalls recently, both internals and externals(CDN), its growing harder and harder to deliver a successful payload. However, its never impossible to find developers miss a sanitization or a pattern filter, leading to XSS.
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 sanitise or encode user input reflected in a hidden input field, allowing injection of HTML tags and event handlers.
Impact
An attacker could execute arbitrary JavaScript in the victim's browser, potentially stealing cookies or performing actions on behalf of the user.
What the attacker needed
Victim clicks a crafted link; WAF bypass via slot tag
How it was found
- Find a hidden directory that redirects to an SSO login page with a form.
- Submit the form and observe that the 'page' parameter is reflected in a hidden input field.
- Fuzz tags and events to find a combination not blocked by the WAF.
- Craft a payload using a slot element with onscrollend and a hash fragment to trigger scrolling.
- Execute JavaScript via setInterval to access document.cookie.
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 took a value from the URL and put it into the page without cleaning it. An attacker could craft a special link that, when opened, runs harmful code in the victim's browser. This is called cross-site scripting (XSS).
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.