Closed
Bug 788269
Opened 14 years ago
Closed 14 years ago
CSRF via java applet in builder.addons.mozilla.org
Categories
(addons.mozilla.org Graveyard :: Add-on Builder, defect, P1)
addons.mozilla.org Graveyard
Add-on Builder
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: albinowax, Assigned: zalun)
Details
(Keywords: reporter-external, wsec-csrf)
Attachments
(1 file, 1 obsolete file)
|
172 bytes,
text/html
|
Details |
Users can attach any kind of file to their addons, and they are served from the builder.addons.mozilla.org domain eg https://builder.addons.mozilla.org/attachment/259514
They are served with the 'content-disposition: attachment' header so it isn't possible to upload HTML to XSS any browsers except Opera. However, java applets inherit permissions from the domain they originate from. The attached poc loads the java applet linked above, which fetches https://builder.addons.mozilla.org/package/150977/latest/ and prints out the full source, including CSRF tokens. From there, I think one could use CSRF to backdoor the user's addons (and the user themselves next time they clicked 'test').
| Reporter | ||
Comment 2•14 years ago
|
||
Attachment #658215 -
Attachment is obsolete: true
Updated•14 years ago
|
Attachment #658217 -
Attachment mime type: text/plain → text/html
Comment 3•14 years ago
|
||
we see _something_ happen, but your applet seems to just hang Firefox for us. Although I realize all 3 of use who tried it are using Mac so maybe it's windows specific. Clearly Java is reading the archive though so I'm confirming the bug on that basis -- Java ought to be able to do the things you say given it's not respecting the content-disposition header.
It's conceivably legitimate to have java hosted in your add-on, though it might be rare enough that we can try to keep it out of builder-based add-ons. The real solution, though, is probably to host the generated packages on a completely different domain. builder.AMO can be the site, but the packages could be on builder.mozilla.net or something. That would solve this and some of the previous issues with malicious package content.
| Reporter | ||
Comment 4•14 years ago
|
||
I tested it on windows XP since it frequently hangs the browser in Fedora. Agreed that serving attachments from a separate domain is the solution, though it will make access control on attachments to private extensions slightly harder. The alternative of blocking Java would have to be done by inspection of the binary content to see if it parses as a jar/.class, and I think there might be similar issues related to Flash, too.
Comment 5•14 years ago
|
||
Piotr, do you know if java appletes will/should be allowed to be part of new style addons put together by builder, or who could answer that question?
if they aren't this seems like a variant of the bug to limit the kinds of files that can be uploaded. If they are this would probably qualify for a bounty.
| Assignee | ||
Comment 6•14 years ago
|
||
I've asked on #jetpack, but I think that for the security we shouldn't allow them.
Comment 7•14 years ago
|
||
Piotr, do you want to write a patch to turn off Java applets as an option here?
We've approved this for a $1,000 bounty.
| Assignee | ||
Comment 8•14 years ago
|
||
Sure I will
| Assignee | ||
Updated•14 years ago
|
Severity: major → critical
Priority: -- → P1
| Assignee | ||
Comment 9•14 years ago
|
||
everywhere I was discussing the issue it seems like this is a trvial issue as running add-ons created by users is mallicious enough...
anyway - preventing jar (and by occasion zip) files in review:
https://github.com/mozilla/FlightDeck/pull/171
Status: NEW → ASSIGNED
| Assignee | ||
Updated•14 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
| Reporter | ||
Comment 10•14 years ago
|
||
You probably already know this but it may be exploitable using pdfs as well as jars: http://xs-sniper.com/blog/2012/10/11/content-smuggling/
| Assignee | ||
Comment 11•14 years ago
|
||
I didn't ... so - should we deny pdf attachments?
| Reporter | ||
Comment 12•14 years ago
|
||
I guess so, though moving the files off-domain is the only future-proof fix.
Updated•13 years ago
|
Flags: sec-bounty+
Updated•12 years ago
|
Product: addons.mozilla.org → addons.mozilla.org Graveyard
Updated•6 years ago
|
Group: client-services-security
Updated•2 years ago
|
Keywords: reporter-external
You need to log in
before you can comment on or make changes to this bug.
Description
•