Cross-site-scripting on one of the largest Dutch franchisors
A reflected cross-site scripting flaw existed in a product quick-view page because a URL parameter was placed into an HTML attribute without proper encoding, allowing an attacker to inject an event handler. An attacker could steal a signed-in user's name and email via cross-frame scripting, and could also store a malicious payload in local storage to trigger DOM-based XSS on every visit.
Published on tij.me
By abusing a sensitive data exposure vulnerability it is possible to steal data from a Hema user. If the user is signed in, data like the user’s name and email can be stolen using cross frame scripting.
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 inserted the productSku parameter into an HTML attribute without encoding or validating it, so an attacker could break out of the attribute and add event handlers.
Impact
An attacker could steal a signed-in user's name and email, and could store a payload that triggers an alert on every visit to the site; the reflected XSS worked in Firefox because other browsers' XSS auditors filtered some of it.
What the attacker needed
Victim visits a crafted URL; victim is signed in (for data theft); victim uses a browser without an XSS auditor; victim moves the mouse over the page
The fix
The vulnerability was fixed by Hema on 20 December 2016.
How it was found
- Find the ListerQuickView.aspx endpoint with several GET parameters.
- Try injecting JavaScript into each parameter, noting that requests with a less-than sign are blocked.
- Use the productSku parameter to break out of the attribute and add an onmousemove handler that posts the cookie to the parent frame.
- Place the resulting page in an iframe to perform cross-frame scripting.
- For stored DOM-based XSS, use a payload that evaluates JavaScript from the location hash to set up a message listener.
- Use postMessage to execute arbitrary code in the iframe, then edit the local storage favourites to include an onload handler in an image URL.
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.
Cross-site scripting (XSS) is when a website puts user-supplied text into a page without making it safe, so that text can run as code in a visitor's browser. Here, a value from the web address was inserted into an HTML attribute, letting an attacker add their own event handler that runs JavaScript when the mouse moves. The attacker could then read data the site had stored about the logged-in user.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.