Closed Bug 648655 Opened 14 years ago Closed 12 years ago

Mozilla Hacks - Hacks2010 Template XSS Bugs

Categories

(Developer Engagement :: Mozilla Hacks, task, P1)

task

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: d3v1l.securityshell, Unassigned)

References

()

Details

(Keywords: reporter-external, sec-high, wsec-xss, Whiteboard: [infrasec:xss][ws:high][sepcification-like][type:bug])

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.16) Gecko/20110319 Firefox/3.6.16 ( .NET CLR 3.5.30729; .NET4.0E) Build Identifier: http://hacks.mozilla.org - xss on all parameters/categories where you see "?" POC: http://hacks.mozilla.org/2011/03/?"><marquee><h1>XSS</h1></marquee>--><script>alert('XSS-HACK?')</script>--> SEE: http://img691.imageshack.us/f/marzt.jpg/ Reproducible: Always
The issue appears to be in the Hacks2010 template which doesn't properly escape output in tmh_by_as_url . I will look at the rest of the template for other potential issues. index http://viewvc.svn.mozilla.org/vc/projects/hacks.mozilla.org/trunk/wp-content/themes/Hacks2010/index.php?revision=58712&view=markup Template functions http://viewvc.svn.mozilla.org/vc/projects/hacks.mozilla.org/trunk/wp-content/themes/Hacks2010/functions.php?revision=66342&view=markup
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows Vista → All
Hardware: x86 → All
Summary: Mozilla Hacks -XSS Bug → Mozilla Hacks - Hacks2010 Template XSS Bugs
Whiteboard: [infrasec:xss][ws:high]
Other files which use tmh_by_as_url find . -name "*.php" | xargs fgrep -i "tmh_by_as_url" | cut -d: -f1 | sort | uniq ./archive.php ./category-demo.php ./category-featured-demo.php ./category-featured.php ./category.php ./functions.php ./index.php ./search.php
Do any of the other themes in use on any of our blogs share code with this theme?
blizzard: where did the hacks theme come from? Is there an upstream source we need to inform about the XSS or did we write it ourselves?
Severity: normal → critical
Craig - can you take a look at this?
Assignee: nobody → craigcook.bugz
I think it may be as simple as running the tmh_by_as_url request through htmlspecialchars. I've done that in r88625 and it seems to do the trick locally, or at least the URL hack in the original report doesn't work. The extra HTML just gets ignored. That tmh_by_as_url function is what we use to sort posts by different criteria in different views based on the request URL (e.g. /by/date/ = "sort by date", /as/title/ = "display as title"). It was custom rolled for the Hacks blog and isn't in use anywhere else as far as I know. I don't think it occurred to us to test for passing in an arbitrary query string so this vulnerability went unnoticed. Good catch.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Has this theme been updated in production? The site is still vulnerable to the XSS in the original bug report.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
(In reply to comment #9) > Has this theme been updated in production? The site is still vulnerable to > the XSS in the original bug report. Nope, doesn't look like it was ever pushed to prod. I expect that requires filing a separate bug for server-ops. But I also don't know if the code change was reviewed again to make sure the security hole is plugged. I don't think we have any staging environment for hacks to test against, but just a code review may be enough.
Adding the reporter of a duplicate bug. Can we get the updates by Craig staged so that we can review this?
Assignee: craigcook.bugz → server-ops
Status: REOPENED → NEW
Assignee: server-ops → jthomas
Production is currently at r90170 which includes the fix mentioned above. [root@mradm02 hacks.mozilla.org-wpcontent]# svn info Path: . URL: http://svn.mozilla.org/projects/hacks.mozilla.org/trunk/wp-content Repository Root: http://svn.mozilla.org Repository UUID: 4eb1ac78-321c-0410-a911-ec516a8615a5 Revision: 90170 Node Kind: directory Schedule: normal Last Changed Author: craigcook@gmail.com Last Changed Rev: 90088 Last Changed Date: 2011-06-07 14:49:01 -0700 (Tue, 07 Jun 2011) http://viewvc.svn.mozilla.org/vc/projects/hacks.mozilla.org/trunk/wp-content/?view=log
Ok thanks, I will review this.
Assignee: jthomas → nobody
I wonder if was fixed the bug...or not yet?
This bug is still listed as new and does not yet appear to have been fixed (or at least pushed to production). Revision 88625 (http://viewvc.svn.mozilla.org/vc/projects/hacks.mozilla.org/trunk/wp-content/?view=log) lists the fix as being applied, but the live site is still vulnerable. :jason, can you take a look at this so that we can fix it and close the bug? Thanks!
Component: hacks.mozilla.org → Mozilla Hacks
Product: Websites → Mozilla Developer Network
The MDN team now owns Hacks development, so we would like to take care of this as soon as possible. Jason, thoughts on comment 16?
Flags: needinfo?(jthomas)
Priority: -- → P1
Whiteboard: [infrasec:xss][ws:high] → [infrasec:xss][ws:high][sepcification-like][type:bug]
CC'ing Jake from Webops
Flags: needinfo?(jthomas)
Flags: needinfo?(nmaul)
Priority: P1 → P2
Priority: P2 → P1
We are *way* beyond the commit in comment 16 now. Can we still confirm this is an issue? There are no actions for WebOps to take on this at the moment. [root@genericadm.private.phx1 Hacks2010]# svn info Path: . Working Copy Root Path: /data/genericrhel6/src/hacks.mozilla.org/wp-content URL: http://svn.mozilla.org/projects/hacks.mozilla.org/trunk/wp-content/themes/Hacks2010 Repository Root: http://svn.mozilla.org Repository UUID: 4eb1ac78-321c-0410-a911-ec516a8615a5 Revision: 115475 Node Kind: directory Schedule: normal Last Changed Author: craigcook@gmail.com Last Changed Rev: 115472 Last Changed Date: 2013-04-26 02:04:48 -0700 (Fri, 26 Apr 2013)
Flags: needinfo?(nmaul) → needinfo?
Presuming this is fixed now, since production is well beyond the commit where this was believed to be fixed.
Status: NEW → RESOLVED
Closed: 14 years ago12 years ago
Flags: needinfo?
Resolution: --- → FIXED
Adding keywords to bugs for metrics, no action required. Sorry about bugmail spam.
Keywords: wsec-xss
Flags: sec-bounty+
For bugs that are resolved, we remove the security flag. These haven't had their flag removed, so I'm removing it now.
Group: websites-security
Product: Mozilla Developer Network → Developer Engagement
You need to log in before you can comment on or make changes to this bug.