GHSL-2020-336: reflected Cross-Site scripting (XSS) in analytics-quarry-web - CVE-2020-36324
The server returned JSON responses without setting the application/json MIME type, so a URL containing a script payload was reflected and executed in the browser. An attacker could trick a logged-in user into visiting a crafted URL to run JavaScript in the context of the site, potentially leading to session hijacking.
Originally disclosed on GitHub Security Lab
A reflected Cross-Site scripting (XSS) vulnerability has been found in analytics-quarry-web
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 report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the server failed to set the Content-Type header to application/json when returning JSON responses, allowing reflected content to be interpreted as HTML.
Impact
XSS could lead to complete account compromise, including disclosure of the user's session cookie and session hijacking.
What the attacker needed
Victim is logged in; victim clicks a crafted link
The fix
The issue was fixed by setting the proper MIME type for JSON responses.
How it was found
- Visit the official Quarry site or follow setup instructions.
- Log in with a Wikimedia account.
- Visit the vulnerable URL containing the script payload.
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 report has not been written yet. The Original tab links to the source.
When a website sends data back to the browser, it should label it as data (JSON) so the browser does not treat it as a web page. Here the label was missing, so a malicious link could make the browser run a script as if it were part of the site. This lets an attacker run code in the victim's browser and possibly steal their session.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.