Closed Bug 1198990 Opened 11 years ago Closed 11 years ago

Cross-site security vulnerability in file viewer

Categories

(addons.mozilla.org Graveyard :: Admin/Editor Tools, defect)

defect
Not set
critical

Tracking

(Not tracked)

RESOLVED FIXED
2015-09-03

People

(Reporter: jwkbugzilla, Assigned: kmag)

Details

(4 keywords)

Attachments

(1 file)

File viewer is currently assuming that file names are safe. That's not the case - a ZIP file can contain files with pretty much any name. Steps to reproduce: 1. Upload the attached extension to AMO and request full review. 2. Now log in as a reviewer, go to the full review queue and click on "XSS via file names." 3. Browse through the contents of the extension and click on the file named "some very long.." 4. The file contents try to trick you into reloading the page - do that. You will see an alert message saying "xss" - JavaScript code was executed in your browser and might approve the add-on for example. The file name has malicious HTML code in it, and it will run JavaScript whenever this file is opened in the file viewer. The code isn't executed when you navigate from another file however, that's why you need to reload the page first.
Thanks for the report! Needinfo Will for triage.
Flags: needinfo?(wclouser)
The problem is apparently caused by this line: https://github.com/mozilla/olympia/blob/6ddb7508377be38ae7273ce4af77e908b0aa0e9e/static/js/zamboni/files.js#L675 If there are already a sufficient number of breadcrumbs (switching between files) the safe jQuery.text() function is being used. However, if the third breadcrumb isn't there yet (initial load) the unsafe jQuery.append() function is used and file name not escaped.
Assignee: nobody → kmaglione+bmo
Severity: normal → critical
Status: NEW → ASSIGNED
This vulnerability specifically affects add-on reviewers, who have elevated privileges on AMO. I believe this qualifies for a sec bounty.
Keywords: sec-critical
This fix won't go into a public repo until just before we push: https://github.com/mozilla/olympia-security/compare/2015.08.20...2015.08.31
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → 2015-09-03
Flags: sec-bounty?
Flags: sec-bounty? → sec-bounty+
Product: addons.mozilla.org → addons.mozilla.org Graveyard
This should be public I think.
Flags: needinfo?(amuntner)
Group: client-services-security
Flags: needinfo?(amuntner)
Flags: needinfo?(wclouser)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: