Debug param can force html content type on non-html responses, resulting in XSS
Categories
(Bugzilla :: Reporting/Charting, defect)
Tracking
()
People
(Reporter: hofusec, Assigned: justdave)
References
Details
(Keywords: reporter-external, sec-high, wsec-xss, Whiteboard: [disclose when 1439786 AND upstream is fixed][reporter-external] [web-bounty-form] [verif?])
Attachments
(7 files, 8 obsolete files)
179.51 KB,
image/png
|
Details | |
479.63 KB,
image/png
|
Details | |
2.28 KB,
patch
|
Details | Diff | Splinter Review | |
2.27 KB,
patch
|
dkl
:
review+
|
Details | Diff | Splinter Review |
2.50 KB,
patch
|
Details | Diff | Splinter Review | |
5.12 KB,
patch
|
Details | Diff | Splinter Review | |
5.17 KB,
patch
|
Details | Diff | Splinter Review |
Reporter | ||
Updated•7 years ago
|
Comment 1•7 years ago
|
||
Comment 2•7 years ago
|
||
Comment 3•7 years ago
|
||
Reporter | ||
Comment 4•7 years ago
|
||
Reporter | ||
Comment 5•7 years ago
|
||
Comment 6•7 years ago
|
||
Comment 7•7 years ago
|
||
Updated•7 years ago
|
Comment 8•7 years ago
|
||
Comment 9•7 years ago
|
||
Comment 10•7 years ago
|
||
Comment 11•7 years ago
|
||
Comment 12•7 years ago
|
||
Comment 13•7 years ago
|
||
Comment 14•7 years ago
|
||
Comment 15•7 years ago
|
||
Comment 16•7 years ago
|
||
Comment 17•7 years ago
|
||
Updated•7 years ago
|
Comment 19•7 years ago
|
||
Comment 20•7 years ago
|
||
Comment 21•7 years ago
|
||
Comment 22•7 years ago
|
||
Comment 23•7 years ago
|
||
Updated•7 years ago
|
Comment 24•7 years ago
|
||
Comment 25•7 years ago
|
||
Updated•7 years ago
|
Updated•7 years ago
|
Updated•7 years ago
|
Updated•6 years ago
|
Comment 26•6 years ago
|
||
I assume this was merged? Can we close this bug out?
Comment 27•6 years ago
|
||
(In reply to April King [:April] from comment #26)
I assume this was merged? Can we close this bug out?
This has not been merged upstream for whatever reasons so cannot be closed yet.
Comment 28•6 years ago
|
||
Are you able to check in on it? It's been almost two years now. :)
Comment 29•4 years ago
•
|
||
the issue doesn't seem to be fixed, the payload is not executed because it's blocked by CSP
Comment 30•4 years ago
|
||
Updated•3 years ago
|
Updated•3 years ago
|
Comment 31•3 years ago
|
||
(In reply to David Lawrence [:dkl] from comment #27)
This has not been merged upstream for whatever reasons so cannot be closed yet.
Has this been merged upstream by now? Is there a bug or GH reference for that?
Assignee | ||
Comment 32•3 years ago
|
||
Just verified this has NOT been committed upstream yet. This will be included in the upcoming releases.
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 33•2 years ago
|
||
I was thinking the fix for this would already included in Harmony by virtue of it having merged BMO after this was committed to BMO. However, upon investigating (good thing I looked), it has not been applied to Harmony, and it ALSO hasn't been applied to BMO. Per Comment 22, BMO "fixed" this by setting up the CSP to block the symptoms rather than fixing the root of the problem.
Per comment 19, chart.cgi has the same problem, and is not included in this set of patches, nor are there any patches on the dependent bug to cover chart.cgi.
I'll have revised patches shortly.
Assignee | ||
Comment 34•2 years ago
|
||
The existing patch for harmony no longer applies to either harmony or BMO. The fixed patch for harmony also does not apply against BMO (the chart half applies, the reports.cgi part doesn't - and it looks like it's because of context)
This patch is for Harmony only.
Assignee | ||
Comment 35•2 years ago
|
||
I guess I should actually attach the patch here, nobody will be able to see that PR since it's on a private repo. I actually tried to do that first but Bugzilla wouldn't let me pick Dylan for a reviewer.
Assignee | ||
Comment 36•2 years ago
|
||
Assignee | ||
Comment 37•2 years ago
|
||
Patch for 4.4 applies intact, but of course was missing the chart.cgi part. This one has both.
Assignee | ||
Comment 38•2 years ago
|
||
5.0 patch applies cleanly, but didn't have chart.cgi portion. This one includes both.
Assignee | ||
Comment 39•2 years ago
|
||
Assignee | ||
Comment 40•2 years ago
|
||
Comment on attachment 9350590 [details] [diff] [review]
patch for 5.2 branch and master
Turns out the 5.2 patch applies cleanly on master. :-)
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 41•2 years ago
|
||
Vulnerability Description:
Leftover debugging code allowed XSS injection within the bug title when viewing charts and reports if a specific URL param was passed to enable the debugging code.
Vulnerable versions:
Bug was introduced in version 2.18
From 2.18 prior to 4.4.14 -> upgrade to 4.4.14
5.0.x versions prior to 5.0.4.1 -> upgrade to 5.0.4.1
5.0.5 and 5.0.6 -> upgrade to 5.2
Developer snapshots in 5.1.x prior to 5.1.3 -> upgrade to 5.1.3
dveditz, can we get a CVE for this?
Comment 42•2 years ago
|
||
![]() |
||
Comment 43•2 years ago
|
||
Assignee | ||
Comment 44•2 years ago
|
||
(In reply to Frédéric Buclin from comment #43)
Could you give us a PoC explaining how to abuse chart.cgi?
There's a PoC in bug 1439786 comment 1.
IMO, a better solution would be to fallback to reports.html.tmpl instead of
reports.csv.tmpl when debug=1.
This makes sense... I'm not that familiar with the reporting code, so I took the fix Dylan had already provided (which seemed to have been vetted by BMO) and ran with it. While it does actually remove the vulnerability, you're right that it's removing a useful feature that could have the actual XSS fixed instead of just removing it wholesale.
Comment 45•2 years ago
|
||
Bouncing request for CVE to Tom. Our local pool of reserved IDs is empty and we'll have to request more.
Updated•2 years ago
|
Assignee | ||
Comment 46•1 year ago
|
||
OK, new set of patches for this incoming.
New philosophy, taking comment 43 into account. Instead of removing this feature, we're going to implement it properly.
- The dump() function in Bugzilla::Chart now returns the dumped data raw instead of html_sanitizing it and dumping it to standard out.
- debug_group is now checked in both CGIs (it was only being checked in report.cgi before, and debug=1 worked for anyone in chart.cgi
- Previous implementation had it dumping raw HTML before the template was output, which meant it was outside of the html entity. Proper browsers would probably ignore it, but instead they all just use quirks mode and it looks weird. We now feed the debug data to the template, and the template filters it on output (data sanitation philosophy: filter as close to the user as possible)
Assignee | ||
Comment 47•1 year ago
|
||
Assignee | ||
Comment 48•1 year ago
|
||
Assignee | ||
Comment 49•1 year ago
|
||
Updated•1 year ago
|
Assignee | ||
Comment 50•11 months ago
|
||
The final patches can be found in the git commits as follows:
4.4: https://github.com/bugzilla/bugzilla/commit/095e8f1f039d7f7425ed32515d5964a84dcbf315
5.0.4: https://github.com/bugzilla/bugzilla/commit/430a93b7c4df3aadfa2262ef9b8bcc8e77f0eca8
5.2: https://github.com/bugzilla/bugzilla/commit/2b5bf1ccea9ca61989b5f0819d929252bd41fc6f
5.3: https://github.com/bugzilla/bugzilla/commit/5af7bc0be41b244d916888139616e0898d35e37e
harmony: https://github.com/bugzilla/harmony/commit/67d5f3c5f60598f33c88a6599c5ae5923097a16e
Description
•