[SECURITY] XSS in show_bug.cgi when using an invalid page format
The show_bug.cgi page reflected an invalid page format value into the HTML without sanitising it, so a crafted URL containing an image tag with an error handler executed script in the victim's browser. An attacker could run JavaScript in the context of the Bugzilla site by getting a user to open a link.
Originally disclosed on Mozilla
- Fixed in 10.7 years
- Paid in 3 days
- Disclosed after 10.7 years
User Agent: Mozilla/5.0 (Windows NT 5.1; rv:18.0) Gecko/20100101 Firefox/18.0
Build ID: 20130201065344
Steps to reproduce:
Hi,
I would like to report Cross site scripting vulnerability.
Steps to reproduce :
Navigate
https://bugzilla.mozilla.org/show_bug.cgi?id=%22%3E%3Cimg%20src=%22aaa.jpg%22%20onerror=javascript:alert%28%27HappyBirthdayDone%27%29%3E&format=123
Actual results:
JavaScript get executed.
Expected results:
Site should not execute the script and should filter metacharacter in
order to prevent XSS attacks and Bounty :P
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 invalid format parameter was echoed into the page without HTML encoding or validation.
Impact
An attacker could execute arbitrary JavaScript in a victim's browser on the Bugzilla domain, which could be used to perform actions as the victim.
What the attacker needed
Victim clicks a crafted link
The fix
The format parameter should be validated against allowed values and any reflected output should be HTML-encoded.
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.
A web page took part of the address bar (the 'format' value) and pasted it straight into the page without cleaning it. By putting HTML and a small script in that value, the reporter made the browser run code as if the site itself had written it. This is called cross-site scripting, and it lets an attacker act as the logged-in user on that site.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.