Closed
Bug 765430
Opened 13 years ago
Closed 11 years ago
XSS in jsonrpc.cgi on IE6/7
Categories
(Bugzilla :: WebService, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: netfuzzerr, Unassigned)
Details
Attachments
(3 files, 1 obsolete file)
User Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1171.0 Safari/537.1
Steps to reproduce:
Hi,
Bugzilla does not escape bad chars on json response. This can allow xss attacks on IE.
PoC: https://landfill.bugzilla.org/bugzilla-tip/jsonrpc.cgi/?method=User.get¶ms="<iframe%20onload=alert('XSS')>":"aa"&a.html
Tested on IE 6.
Patch this is convert dangerous to javascript.
Cheers,
Mario.
Comment 1•13 years ago
|
||
This sounds like big fail on IE's part (especially with regards to the ending ".html" causing it to render. Not sure we can (or want to) do much here.
http://blog.watchfire.com/wfblog/2011/10/json-based-xss-exploitation.html has more detail.
Reporter | ||
Comment 2•13 years ago
|
||
So, will you ignore it? This is not exploitable on IE8+ due to header X-content-type-options:nosniff. But still exploitable on IE6/7. Patch it is just replace "<" to "\u003c", ">" to "\u003e" and "&" to "\u0026".
This is not the first time that this happens, you already patched a similar flaw on bug 637981. So, why ignore it?
Comment 3•13 years ago
|
||
I cannot reproduce the XSS attack, because the page is downloaded locally before being opened, and so you cannot do any harm. I also had to write jsonrpc.cgi? instead of jsonrpc.cgi/? else IE doesn't recognize "jsonrpc" at all.
Note that the whole error message is:
Could not parse the 'params' argument as valid JSON. Error: garbage after JSON object, at character offset 30 (before \":\"aa\"\") at Bugzilla/WebService/Server/JSONRPC.pm line 155. at Bugzilla/WebService/Server/JSONRPC.pm line 155 eval {...} called at Bugzilla/WebService/Server/JSONRPC.pm line 154 Bugzilla::WebService::Server::JSONRPC::retrieve_json_from_get('Bugzilla::WebService::Server::JSONRPC=HASH(0xa59b320)') called at /usr/lib/perl5/vendor_perl/5.14.2/JSON/RPC/Legacy/Server.pm line 110 JSON::RPC::Legacy::Server::handle('Bugzilla::WebService::Server::JSONRPC=HASH(0xa59b320)') called at /var/www/html/bugzilla/jsonrpc.cgi line 27
Assignee: general → webservice
Component: Bugzilla-General → WebService
Version: unspecified → 4.3.1
Reporter | ||
Comment 4•13 years ago
|
||
I got it on chrome.
{"error":{"message":"Could not parse the 'params' argument as valid JSON. Error: Value: \"<iframe onload=alert('XSS')>\":\"aa\"","code":32000},"id":"https://landfill.bugzilla.org/bugzilla-tip/","result":null}
Reporter | ||
Comment 5•13 years ago
|
||
Reporter | ||
Comment 6•13 years ago
|
||
What version have you tested?
(In reply to Frédéric Buclin from comment #3)
> I cannot reproduce the XSS attack, because the page is downloaded locally
> before being opened, and so you cannot do any harm. I also had to write
> jsonrpc.cgi? instead of jsonrpc.cgi/? else IE doesn't recognize "jsonrpc" at
> all.
>
>
> Note that the whole error message is:
>
> Could not parse the 'params' argument as valid JSON. Error: garbage after
> JSON object, at character offset 30 (before \":\"aa\"\") at
> Bugzilla/WebService/Server/JSONRPC.pm line 155. at
> Bugzilla/WebService/Server/JSONRPC.pm line 155 eval {...} called at
> Bugzilla/WebService/Server/JSONRPC.pm line 154
> Bugzilla::WebService::Server::JSONRPC::retrieve_json_from_get('Bugzilla::
> WebService::Server::JSONRPC=HASH(0xa59b320)') called at
> /usr/lib/perl5/vendor_perl/5.14.2/JSON/RPC/Legacy/Server.pm line 110
> JSON::RPC::Legacy::Server::handle('Bugzilla::WebService::Server::
> JSONRPC=HASH(0xa59b320)') called at /var/www/html/bugzilla/jsonrpc.cgi line
> 27
Comment 7•13 years ago
|
||
(In reply to Mario Gomes from comment #6)
> What version have you tested?
IE6 and IE9.
Reporter | ||
Comment 8•13 years ago
|
||
As I told before this works only on IE6/7(in this version there is no X-content-type-options).
(In reply to Frédéric Buclin from comment #7)
> (In reply to Mario Gomes from comment #6)
> > What version have you tested?
>
> IE6 and IE9.
Summary: XSS on jsonrpc is possible on IE. → XSS on jsonrpc is possible on IE6/7.
Reporter | ||
Comment 9•13 years ago
|
||
As I told before this works only on IE6/7(in this version there is no X-content-type-options).
(In reply to Frédéric Buclin from comment #7)
> (In reply to Mario Gomes from comment #6)
> > What version have you tested?
>
> IE6 and IE9.
Comment 10•13 years ago
|
||
Reporter | ||
Updated•13 years ago
|
Reporter | ||
Comment 11•13 years ago
|
||
Sure, this could be explored in all IE versions, but since Bugzilla uses X-content-type-options this is not possible on IE8/9/10.
(In reply to Frédéric Buclin from comment #10)
> The URL that reed posted in comment 1 shows that all versions of IE are
> affected, not only IE6 and 7. And in comment 7, I mentioned IE6.
Comment 12•13 years ago
|
||
I don't know how your IE browser is configured, but both IE6 and IE9 first download the HTML page locally before opening it, which means that the iframe is executed locally and so is not exploitable. If this is the default behavior, then this means you deactivated some security restrictions.
Do you have a real PoC which works rather than the harmless alert('XSS') popup?
Reporter | ||
Comment 13•13 years ago
|
||
Reporter | ||
Updated•13 years ago
|
Attachment #634136 -
Attachment is obsolete: true
Reporter | ||
Updated•13 years ago
|
Attachment #634136 -
Attachment mime type: application/octet-stream → text/javascript
Reporter | ||
Comment 14•13 years ago
|
||
Someone here is able to trigger it?
Try it: https://landfill.bugzilla.org/bugzilla-tip/jsonrpc.cgi/.html?method=User.get¶ms="<script>alert(location.href)</script>":"aa"
Reporter | ||
Comment 15•13 years ago
|
||
@Byron, Reed: Are you able to reproduce it?
Comment 16•13 years ago
|
||
(In reply to Mario Gomes from comment #14)
> Someone here is able to trigger it?
>
> Try it:
> https://landfill.bugzilla.org/bugzilla-tip/jsonrpc.cgi/.html?method=User.
> get¶ms="<script>alert(location.href)</script>":"aa"
IE6 complains that it cannot download "aa". Looks like this PoC doesn't work either.
Reporter | ||
Comment 17•13 years ago
|
||
Can you attach a screenshot? I really don't undestand why you cannot reproduce it, I can do it easy.
(In reply to Frédéric Buclin from comment #16)
> (In reply to Mario Gomes from comment #14)
> > Someone here is able to trigger it?
> >
> > Try it:
> > https://landfill.bugzilla.org/bugzilla-tip/jsonrpc.cgi/.html?method=User.
> > get¶ms="<script>alert(location.href)</script>":"aa"
>
> IE6 complains that it cannot download "aa". Looks like this PoC doesn't work
> either.
Reporter | ||
Updated•13 years ago
|
Comment 18•13 years ago
|
||
IE 6 is unable to download anything.
Reporter | ||
Comment 19•13 years ago
|
||
That's Strange, I keep be able to reproduce. Is there someone else that got this problem too?
(In reply to Frédéric Buclin from comment #18)
> Created attachment 634498 [details]
> screenshot - IE6
>
> IE 6 is unable to download anything.
Reporter | ||
Comment 20•13 years ago
|
||
Frederic, look this screenshot on IE7.
Reporter | ||
Comment 21•13 years ago
|
||
Reporter | ||
Updated•13 years ago
|
Attachment #633802 -
Attachment mime type: image/png → image/png; charset=utf-7
Comment 22•13 years ago
|
||
(In reply to Mario Gomes from comment #20)
> Frederic, look this screenshot on IE7.
I don't see how this is related to this bug. You are just trying to abuse IE7 using a well-known trick. IE8 and newer are no longer vulnerable to this problem.
Also, please don't use bmo for your tests. You generate bugmails uselessly.
Reporter | ||
Comment 23•13 years ago
|
||
I'm justing trying show that I can reproduce this bug(that does not seems to be taken seriously) on IE7 with default config.
Reporter | ||
Comment 24•13 years ago
|
||
Frederic, can you explain what's the difference of https://landfill.bugzilla.org/bugzilla-tip/ for https://landfill.bugzilla.org/bugzilla-4.2-branch/?. Vulnerabilities found in this channel is valid like on https://landfill.bugzilla.org/bugzilla-tip/?
Reporter | ||
Comment 25•13 years ago
|
||
Long time, no fix. Nobody will fix this? And can this be eligible for a bounty? ;)
Reporter | ||
Comment 26•13 years ago
|
||
Closing... bug ignored...
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Resolution: --- → INVALID
Comment 27•13 years ago
|
||
Seems like the patch in bug 243764 may "fix" this on trunk... Can somebody confirm?
Status: RESOLVED → REOPENED
Ever confirmed: true
Resolution: INVALID → ---
Reporter | ||
Comment 30•12 years ago
|
||
Just a tip, you can fix this by adding "Content-Disposition: attachment", it'll not allow the page be view directly by browser.
Reporter | ||
Updated•12 years ago
|
Summary: XSS on jsonrpc is possible on IE6/7. → %PDF-1.5trailer<</Root<</Pages<<>>/OpenAction<</S/JavaScript/JS(app.alert({cMsg:this.path});)>>>>>>%%EOF
Reporter | ||
Updated•12 years ago
|
Summary: %PDF-1.5trailer<</Root<</Pages<<>>/OpenAction<</S/JavaScript/JS(app.alert({cMsg:this.path});)>>>>>>%%EOF → XSS in jsonrpcg.cgi on IE6/7
Comment 31•12 years ago
|
||
I already asked you to stop playing with bmo. Use landfill for your tests.
Summary: XSS in jsonrpcg.cgi on IE6/7 → XSS in jsonrpc.cgi on IE6/7
Reporter | ||
Updated•12 years ago
|
Updated•11 years ago
|
Attachment #633802 -
Attachment mime type: image/png; charset=utf-7 → image/png
Updated•11 years ago
|
Reporter | ||
Updated•11 years ago
|
Summary: XSS in jsonrpc.cgi on IE6/7 → XSS in jsonrpc.cgi on IE6/7(payload: "'></title><img src=x onerror=confirm(2);>)
Updated•11 years ago
|
Summary: XSS in jsonrpc.cgi on IE6/7(payload: "'></title><img src=x onerror=confirm(2);>) → XSS in jsonrpc.cgi on IE6/7
Reporter | ||
Comment 32•11 years ago
|
||
Doesn't work anymore.
Status: REOPENED → RESOLVED
Closed: 13 years ago → 11 years ago
Resolution: --- → INVALID
Comment 33•11 years ago
|
||
IE 6 and 7 are no longer supported, and the reporter says this issue no longer works.
Group: bugzilla-security
You need to log in
before you can comment on or make changes to this bug.
Description
•