Closed Bug 628212 Opened 15 years ago Closed 13 years ago

IE-Specific Cross-Site Scripting Vulnerability on Mozilla.com

Categories

(www.mozilla.org :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: neal, Assigned: jpetto)

References

()

Details

(Keywords: reporter-external, sec-high, wsec-xss, Whiteboard: [infrasec:xss][ws:high][site:www.mozilla.com])

Attachments

(2 files)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13 Build Identifier: Hilarious, isn't it. :-P IE 6/7/8 will sniff for HTML in cases where .html, .xml, or .txt are a part of the URL path (source: http://code.google.com/p/browsersec/wiki/Part2#Survey_of_content_sniffing_behaviors). There is a stats script on Mozilla.com which takes a callback parameter so it can be used as JSONP. It does not filter the characters in or length of the callback, which allows HTML tags to be included. By taking advantage of PHP and PATH_INFO to inject a fake filename at the end of the URL, it's possible to trick IE into executing the malicious input as HTML. IE8's XSS filter blocks the attacks I've come up with, but IE7 and IE6 will parse them without any difficulty. Reproducible: Always Steps to Reproduce: 1. Open IE6, IE7, or IE8 with the XSS Filter disabled 2. Browse to http://www.mozilla.com/en-US/firefox/stats/total.php/index.txt?callback=<script>alert('asdf')</script> 3. Enjoy the alert box ;)
Status: UNCONFIRMED → NEW
Ever confirmed: true
Whiteboard: [infrasec:xss][ws:high]
if ($_REQUEST['callback']) { header('Content-type: text/javascript'); printf("%s(%s)",$_REQUEST['callback'],$json); }
Attached patch patch - v1 — — Splinter Review
Possible patch?
You'll need to also send an explicit charset header, because otherwise IE 6 / 7 can be tricked into parsing HTML via UTF-7 text. http://www.mozilla.com/en-US/firefox/stats/total.php/index.txt?callback=%2BADw-script%2BAD4-alert('XSS')%2BADsAPA-%2Fscript%2BAD4-
Component: www.mozilla.org/firefox → www.mozilla.org
This still appears to be an issue and is unresolved. I'm CC'ing the last developer who worked on the stats folder although it was over 9 months ago. :jlong, can you take a look at this page or see if someone can update this? The fixes are listed in the attachments and are quite simple. Thanks!
Component: www.mozilla.org → General
Product: Websites → www.mozilla.org
:jlong, ping for an update. Trying to close out these old bugs.
Whiteboard: [infrasec:xss][ws:high] → [infrasec:xss][ws:high][site:www.mozilla.com]
Assignee: nobody → jon
Flags: needinfo?
Force UTF-8 encoding. Needs testing in native IE 6/7 - cannot replicate behavior in IE 10 (running in IE 7 mode).
Attachment #739270 - Flags: review?
Flags: needinfo?
Attachment #739270 - Flags: review? → review-
This file and everything else under /en-US/firefox/stats was for the Firefox Glow page and it doesn't even seem functional anymore -- downloadstats.mozilla.com is completely gone -- and as far as we know, nobody is using it, so patching it doesn't really make any sense. Deleted the entire directory in r115434, pushed live in r115436.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Adding keywords to bugs for metrics, no action required. Sorry about bugmail spam.
Keywords: wsec-xss
Flags: sec-bounty+
Group: websites-security
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: