Closed
Bug 745397
(CVE-2012-0466)
Opened 13 years ago
Closed 13 years ago
[SECURITY] The JS template for buglists permits attackers to access all bugs that the victim can see
Categories
(Bugzilla :: Query/Bug List, defect)
Tracking
()
RESOLVED
FIXED
Bugzilla 3.6
People
(Reporter: LpSolit, Assigned: LpSolit)
References
Details
(Keywords: reporter-external)
Attachments
(3 files, 1 obsolete file)
1.44 KB,
text/html
|
Details | |
2.60 KB,
patch
|
glob
:
review+
|
Details | Diff | Splinter Review |
3.09 KB,
patch
|
LpSolit
:
review+
|
Details | Diff | Splinter Review |
Bug 195530 added a JavaScript template for buglists in Bugzilla 2.17.4. Despite it was written with security in mind (see the 2nd patch there), it's still possible to bypass this security check by forcing buglist.cgi to log in the user again after the check is done, see the PoC (no worry, it tries to access bugs on landfill). To make the PoC work, you must first be logged into https://landfill.bugzilla.org/bugzilla-tip/. The vulnerability exists since 2.17.4.
The best way to fix this bug is to remove this JS template. I'm pretty sure that nobody besides gerv and Jesse knows that this template exists (I found it by accident earlier today). Either that, or this code must be moved right before calling Search.pm:
if ((defined $cgi->param('ctype')) && ($cgi->param('ctype') eq "js")) {
Bugzilla->logout_request();
}
Flags: blocking4.2.1+
Flags: blocking4.0.6+
Flags: blocking3.6.9+
![]() |
Assignee | |
Comment 1•13 years ago
|
||
Hum, even if we move the code mentioned in comment 0 right before calling Search.pm, this correctly excludes security bugs, but it still returns all public bugs when requirelogin is turned on. This means that the attacker could still use this PoC to collect data about bugs being in Bugzilla installations which require the user to be logged in (such as corporate installations).
Bugzilla 3.4 and above have Bug.search available as a WebServices method, so this makes this JS template less useful, especially as it only returns public bugs. So I'm in favor of removing this template entirely. Objections? CC'ing those who were involved in bug 195530.
Comment 2•13 years ago
|
||
AIUI, the standards-based fix for this sort of problem is Access-Control-Allow-Origin. But who would be on the whitelist? It may be easier to just remove the feature if no-one is using it. I wonder if we could use BMO access logs to find out if anyone is?
The other option is fix the JS template to only return public bugs, with LpSolit's patch and perhaps more.
Gerv
![]() |
Assignee | |
Comment 3•13 years ago
|
||
Let's remove the JS template entirely. I'm pretty sure mostly nobody knows about its existence.
Assignee: query-and-buglist → LpSolit
Status: NEW → ASSIGNED
Attachment #615324 -
Flags: review?(glob)
i'll chat with IT to check the bmo logs; i don't want this removed on the back of a hunch.
![]() |
Assignee | |
Comment 5•13 years ago
|
||
(In reply to Byron Jones ‹:glob› from comment #4)
> i'll chat with IT to check the bmo logs; i don't want this removed on the
> back of a hunch.
Could you get this information asap?
Comment on attachment 615324 [details] [diff] [review]
patch, v1
r=glob
i don't see any hits on this since 1st jan 2012 :)
Attachment #615324 -
Flags: review?(glob) → review+
![]() |
Assignee | |
Comment 7•13 years ago
|
||
Let's also remove the doc reference about ctype=js for buglists. I removed the whole paragraph, because the other format specified (RDF) is already covered a few lines above this paragraph.
Attachment #615324 -
Attachment is obsolete: true
Attachment #615666 -
Flags: review?(glob)
![]() |
Assignee | |
Comment 8•13 years ago
|
||
dveditz: we need a CVE number for this bug.
Comment 11•13 years ago
|
||
The PoC doesn't work for me (buglist.cgi syntax error in Fx 14 Nightly?) but it's easy to see the problem if you compare
https://landfill.bugzilla.org/bugzilla-tip/buglist.cgi?f1=bug_group&o1=regexp&v1=.%2B&ctype=js&cmdtype=doit&remtype=asdefault
... with what you ought to get:
https://landfill.bugzilla.org/bugzilla-tip/buglist.cgi?f1=bug_group&o1=regexp&v1=.%2B&ctype=js
I'm assuming every landfill user is a member of "Test Group" by default (I don't remember asking to be added). If not both lists might be blank.
Victims might later notice their default search was changed but by then it's too late.
![]() |
Assignee | |
Comment 12•13 years ago
|
||
(In reply to Daniel Veditz [:dveditz] from comment #11)
> I'm assuming every landfill user is a member of "Test Group" by default
No, nobody is in this group by default. Only canconfirm and editbugs. You have been added to the TestGroup group in 2006 by reed.
Comment 13•13 years ago
|
||
Comment on attachment 615666 [details] [diff] [review]
patch for trunk, v1.1
r=glob
Attachment #615666 -
Flags: review?(glob) → review+
![]() |
Assignee | |
Updated•13 years ago
|
Flags: approval?
Flags: approval4.2?
Flags: approval4.0?
Flags: approval3.6?
![]() |
Assignee | |
Updated•13 years ago
|
Attachment #615666 -
Attachment description: patch, v1.1 → patch for trunk, v1.1
![]() |
Assignee | |
Comment 14•13 years ago
|
||
This is the patch for all branches. The single change is the license header in list.js.tmpl, which is still MPL 1.1 (and so the patch for trunk didn't apply cleanly as the trunk uses MPL 2.0).
Attachment #616082 -
Flags: review+
![]() |
Assignee | |
Comment 15•13 years ago
|
||
It's release time.
Flags: approval?
Flags: approval4.2?
Flags: approval4.2+
Flags: approval4.0?
Flags: approval4.0+
Flags: approval3.6?
Flags: approval3.6+
Flags: approval+
![]() |
Assignee | |
Comment 16•13 years ago
|
||
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/
modified buglist.cgi
modified docs/en/xml/using.xml
deleted template/en/default/list/list.js.tmpl
Committed revision 8207.
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/4.2/
modified buglist.cgi
modified docs/en/xml/using.xml
deleted template/en/default/list/list.js.tmpl
Committed revision 8081.
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/4.0/
modified buglist.cgi
modified docs/en/xml/using.xml
deleted template/en/default/list/list.js.tmpl
Committed revision 7706.
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/3.6/
modified buglist.cgi
modified docs/en/xml/using.xml
deleted template/en/default/list/list.js.tmpl
Committed revision 7286.
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Comment 18•13 years ago
|
||
Oh, remove it was not necessary. You could have put a domain check or some not scriptable code before of returned javascript code.
Something Like that:
"""
;;;;REMOVEIT;;;;
callback({'someinfoname':'someinfo'});
"""
Comment 19•12 years ago
|
||
Hello,
I was using the JavaScript template to track issue diffs for W3C specification documents.
https://github.com/oslego/w3c-bugzilla-tracker/blob/master/scripts/BugzillaTrackerUtil.js#L96
The script is being actively used on W3C documents by authors to track bugs on their specs.
Since this has now been closed, is there any other way to get cross-domain search information from Bugzilla?
Comment 20•12 years ago
|
||
Razvan: yes, there is. You can use Bugzilla's build in APIs - XML-RPC, or JSON-RPC if your Bugzilla is recent. Or, of course, you could install a BzAPI instance: https://wiki.mozilla.org/Bugzilla:REST_API .
See http://www.bugzilla.org/docs/ for API documentation for the WebServices interfaces.
Gerv
Comment 21•12 years ago
|
||
Thank you for the links, Gervase!
Updated•11 years ago
|
Flags: sec-bounty+
Updated•8 months ago
|
Keywords: reporter-external
You need to log in
before you can comment on or make changes to this bug.
Description
•