Closed
Bug 562547
(CVE-2010-1585)
Opened 15 years ago
Closed 14 years ago
ParanoidFragmentSinks allow javascript: urls in chrome documents
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
People
(Reporter: dveditz, Assigned: sayrer)
References
()
Details
(Whiteboard: [sg:vector-critical] [qa-examined-191] [qa-examined-192] [qa-needs-STR])
Attachments
(4 files)
7.34 KB,
patch
|
jst
:
review+
christian
:
approval1.9.2.14+
christian
:
approval1.9.2.9-
christian
:
approval1.9.1.12-
|
Details | Diff | Splinter Review |
7.71 KB,
patch
|
BenB
:
review+
|
Details | Diff | Splinter Review |
7.28 KB,
patch
|
BenB
:
review+
|
Details | Diff | Splinter Review |
7.29 KB,
patch
|
reed
:
review+
dveditz
:
review+
dveditz
:
approval1.9.1.17+
|
Details | Diff | Splinter Review |
The two ns(X)HTMLParanoidFragmentSink classes are used by nsIScriptableUnescapeHTML to sanitize (X)HTML by stripping attributes and tags not on a built-in whitelist. Internally to Firefox this is only used by the feed processor, but it's fairly popular with add-on authors and recommended as a best-practice.
The sinks attempt to sanitize URLs by calling CheckLoadURI[...]DISALLOW_INHERIT_PRINCIPAL), but unfortunately when the target document is a chrome document (as is common with add-ons) this check allows any URI. In particular malicious href="javascript:evil()" or <iframe src="data:evil"> can slip through and create sg-critical bugs.
http://hg.mozilla.org/mozilla-central/annotate/c753325a40ff/content/html/document/src/nsHTMLFragmentContentSink.cpp#l967
and ditto content/xml/document/src/nsXMLFragmentContentSink.cpp
Would it be OK to simply always pass a nsNullPrincipal in instead?
This problem was recently published in a whitepaper referenced at
http://www.securityfocus.com/archive/1/archive/1/510883/100/0/threaded
Cross Context Scripting with Firefox - Roberto Suggi Liverani
Link: http://www.security-assessment.com/files/whitepapers/Cross_Context_Scrip
ting_with_Firefox.pdf
MITRE has apparently assigned this CVE-2010-1585
Reporter | ||
Updated•15 years ago
|
blocking1.9.1: --- → ?
blocking1.9.2: --- → ?
Whiteboard: [sg:vector-critical]
Assignee | ||
Updated•15 years ago
|
Assignee: nobody → sayrer
Assignee | ||
Comment 1•15 years ago
|
||
taking
Updated•15 years ago
|
OS: Mac OS X → All
Hardware: x86 → All
Assignee | ||
Comment 2•15 years ago
|
||
I'll add tests if jst thinks this is the right way to go
Attachment #442465 -
Flags: review?
Assignee | ||
Updated•15 years ago
|
Attachment #442465 -
Flags: review? → review?(jst)
Comment 3•15 years ago
|
||
Comment on attachment 442465 [details] [diff] [review]
null principal
Looks good to me.
Attachment #442465 -
Flags: review?(jst) → review+
Updated•15 years ago
|
blocking1.9.1: ? → needed
blocking1.9.2: ? → needed
Comment 4•15 years ago
|
||
*ping*... jst gave r+, so can we get this checked-in with tests?
blocking2.0: --- → ?
Updated•15 years ago
|
blocking2.0: ? → final+
Reporter | ||
Comment 5•15 years ago
|
||
Comment on attachment 442465 [details] [diff] [review]
null principal
would like to get this into the branches, too.
Attachment #442465 -
Flags: approval1.9.2.9?
Attachment #442465 -
Flags: approval1.9.1.12?
Comment on attachment 442465 [details] [diff] [review]
null principal
a=LegNeato for 1.9.2.9 and 1.9.1.12.
Please note that for these releases code-freeze is this Thursday, 2010-08-12 @ 11:59 pm PST. This needs to be landed as soon as possible.
Attachment #442465 -
Flags: approval1.9.2.9?
Attachment #442465 -
Flags: approval1.9.2.9+
Attachment #442465 -
Flags: approval1.9.1.12?
Attachment #442465 -
Flags: approval1.9.1.12+
Comment on attachment 442465 [details] [diff] [review]
null principal
Removing .9 approval as this missed landing before freeze. Feel free to nominate again, though the bar for approval will be higher.
Attachment #442465 -
Flags: approval1.9.2.9-
Attachment #442465 -
Flags: approval1.9.2.9+
Attachment #442465 -
Flags: approval1.9.1.12-
Attachment #442465 -
Flags: approval1.9.1.12+
![]() |
||
Updated•14 years ago
|
Keywords: checkin-needed
Comment 9•14 years ago
|
||
Attachment #497538 -
Flags: review+
Comment 10•14 years ago
|
||
We really dropped the ball here, this is a critical security hole and should have been commited immediately, not 8 months (!) later.
I'd like to commit this NOW, so that it makes beta 8.
I also think it should be commited to stable branches, esp. considering Thunderbird 3.1.
Comment 11•14 years ago
|
||
Comment on attachment 442465 [details] [diff] [review]
null principal
See above. Critical hole, needed for Firefox 3.6, Thunderbird 3.1, and extensions.
Attachment #442465 -
Flags: approval1.9.2.14?
Updated•14 years ago
|
Attachment #497538 -
Flags: approval2.0?
Comment 12•14 years ago
|
||
Comment on attachment 442465 [details] [diff] [review]
null principal
a=LegNeato for 1.9.2.14
Attachment #442465 -
Flags: approval1.9.2.14? → approval1.9.2.14+
Comment 13•14 years ago
|
||
BTW: Why is that?
dveditz wrote in comment 0:
> The sinks attempt to sanitize URLs by calling
> CheckLoadURI[...]DISALLOW_INHERIT_PRINCIPAL), but unfortunately when
> the target document is a chrome document (as is common with add-ons)
> this check allows any URI.
It seems like DISALLOW_INHERIT_PRINCIPAL would forbid exactly that, and it would be most important to work in the case of chrome. There may be other code which wrongly relies on that. Did anybody search addons code and other thirdparty code?
<http://www.google.com/codesearch?q=DISALLOW_INHERIT_PRINCIPAL> shows a few other uses. Or am I misunderstanding the API?
Comment 14•14 years ago
|
||
Attachment #497566 -
Flags: review+
Comment 15•14 years ago
|
||
Comment on attachment 497566 [details] [diff] [review]
same patch, for 1.9.2 branch -- commited
Commited as <http://hg.mozilla.org/releases/mozilla-1.9.2/rev/1e85c1a49573>
Attachment #497566 -
Attachment description: same patch, for 1.9.2 branch → same patch, for 1.9.2 branch -- commited
Updated•14 years ago
|
Attachment #497538 -
Flags: approval2.0?
Comment 16•14 years ago
|
||
Comment on attachment 497538 [details] [diff] [review]
same patch, updated to trunk
Commited as <http://hg.mozilla.org/mozilla-central/rev/e952221c3251>
Updated•14 years ago
|
Comment 17•14 years ago
|
||
I'd like to have comment 13 answered before I close this as FIXED.
Comment 18•14 years ago
|
||
This might have caused test failure bug 619436, maybe also bug 619437 and bug 619438. Please see bug 619436 - I don't want to delude this security bug here with discussion about tests.
Particularly, I think we may need a more general fix here which fixes DISALLOW_INHERIT_PRINCIPAL to actually do what it says.
![]() |
||
Comment 19•14 years ago
|
||
Fundamentally, using DISALLOW_INHERIT_PRINCIPAL is an abuse of what's a security check API. And chrome code should be able to pass any security check...
This bug, if it's fixed, should be resolved accordingly. If you think we should change the behavior of DISALLOW_INHERIT_PRINCIPAL for the system principal, that should be a separate bug.
Comment 20•14 years ago
|
||
bz, I don't understand... The word DISALLOW_INHERIT_PRINCIPAL for me says: Ignore the passed in principal, do not use it to calculate the permissions. In other words, exactly what this patch did.
The description says: "Don't allow URLs which would inherit the caller's principal (such as javascript: or data:) to load." Here, javascript: URLs *did* load, directly violating what the flag promised.
Again, if I misunderstood something, please tell me where/why.
![]() |
||
Comment 21•14 years ago
|
||
DISALLOW_INHERIT_PRINCIPAL was added to an existing security check which always returned "ok" for system principals. Perhaps the check should have been redefined in the process; I'm happy to have a separate bug on that. But why is THIS bug still open, given that the patch has landed? Why is the checkin-needed keyword still present? Why are the branch status flags indicating nothing has landed given that branch fixes have laded? Am _I_ misunderstanding something about the state of this bug?
Comment 22•14 years ago
|
||
> But why is THIS bug still open, given that the patch has landed?
Because I wanted this question to be resolved. As shown in the comments above, there are other third-party users of this flag, and they likely misunderstood this, too, in the same way.
From my point of view, this bug is not resolved until that flag behaves differently, but apparently you disagree, and that's fine.
Also, this bug may or may not have caused several test failures, specifically bug 619436. Given that the failure is intermittent, I don't know what (and don't want) to do with it. I can't see a problem in the app.
Leaving that to you...
Keywords: checkin-needed
Updated•14 years ago
|
![]() |
||
Comment 23•14 years ago
|
||
> Because I wanted this question to be resolved.
THIS BUG is about a particular issue in the paranoid fragment sink. How about not hijacking it?
Did a patch for this bug land or not? If so, which branches did it land on?
Comment 24•14 years ago
|
||
> THIS BUG is about a particular issue in the paranoid fragment sink.
OK, marking FIXED.
> Did a patch for this bug land or not? If so, which branches did it land on?
See comment 15 and 16:
Commited as <http://hg.mozilla.org/releases/mozilla-1.9.2/rev/1e85c1a49573>
Commited as <http://hg.mozilla.org/mozilla-central/rev/e952221c3251>
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
![]() |
||
Comment 25•14 years ago
|
||
Thank you!
Please do file a followup on the general behavior of DISALLOW_INHERIT_PRINCIPAL?
Comment 26•14 years ago
|
||
Is 1.9.1 affected? If so, need a patch for it and a request for approval.
Comment 27•14 years ago
|
||
reed: go ahead. I personally don't care about < FF 3.6.
Comment 28•14 years ago
|
||
Attachment #499199 -
Flags: review+
Attachment #499199 -
Flags: approval1.9.1.17?
Reporter | ||
Comment 29•14 years ago
|
||
Comment on attachment 499199 [details] [diff] [review]
same patch, for 1.9.1 branch
r=dveditz
approved for 1.9.1.17, a=dveditz
Thanks for the merge to 1.9.1!
Attachment #499199 -
Flags: review+
Reporter | ||
Updated•14 years ago
|
Attachment #499199 -
Flags: approval1.9.1.17? → approval1.9.1.17+
Comment 30•14 years ago
|
||
Comment 31•14 years ago
|
||
No manual testcase, no STR, and no automated test.
What is QA supposed to do here to verify this since it was based ona whitepaper?
Updated•14 years ago
|
Whiteboard: [sg:vector-critical] → [sg:vector-critical] [qa-examined-191] [qa-examined-192] [qa-needs-STR]
Reporter | ||
Updated•14 years ago
|
Group: core-security
Updated•9 years ago
|
Keywords: testcase-wanted
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•