Closed
Bug 993423
Opened 11 years ago
Closed 11 years ago
XBL scopes can be hijacked from <svg:use>
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla31
Tracking | Status | |
---|---|---|
firefox30 | --- | unaffected |
firefox31 | --- | fixed |
firefox-esr24 | --- | unaffected |
People
(Reporter: marius.mlynski, Assigned: bholley)
References
Details
(Keywords: regression, reporter-external, sec-high, Whiteboard: [qa-])
Attachments
(2 files)
783 bytes,
text/html
|
Details | |
4.53 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
This is a regression from bug 986730. Now that all anonymous content is hosted in the XBL scope, it is possible to execute scripts in its context by cloning a user-defined node into the anonymous content of <svg:use>. Please see the attached proof of concept.
Assignee | ||
Comment 1•11 years ago
|
||
Ugh, we should have seen that coming. Nice one, Mariusz.
jwatt, smaug, what do you think we should do here? Is there some way we can avoid using anonymous content to implement this web-facing feature?
Flags: needinfo?(jwatt)
Flags: needinfo?(bugs)
Comment 2•11 years ago
|
||
As of now we I can't think of any other way to implement svg:use.
We have bugs open to implement in the way the spec wants, but that is far from being trivial.
And we'd still probably implement the cloned part using anonymous content.
Flags: needinfo?(bugs)
Updated•11 years ago
|
status-firefox30:
--- → unaffected
status-firefox31:
--- → affected
status-firefox-esr24:
--- → unaffected
Keywords: regression
![]() |
||
Comment 3•11 years ago
|
||
(In reply to Olli Pettay [:smaug] from comment #2)
> As of now we I can't think of any other way to implement svg:use.
> We have bugs open to implement in the way the spec wants, but that is far
> from being trivial.
Indeed.
> And we'd still probably implement the cloned part using anonymous content.
Actually the idea is to only have one instance that is somehow lightly restyled as each instance is painted...or something. So no cloning would be involved. I don't think it's a solution here though since it's a fairly large project, and it likely has a bunch of issues to work through that we aren't even aware of yet.
Flags: needinfo?(jwatt)
![]() |
||
Updated•11 years ago
|
Blocks: 986730
tracking-firefox31:
--- → ?
Assignee | ||
Comment 4•11 years ago
|
||
Hm. So should we flag this stuff specially some how and not hoist it into the XBL scope?
Comment 5•11 years ago
|
||
Yes. just keeping its old NAC behavior is safest at this point.
Updated•11 years ago
|
Flags: sec-bounty?
Assignee | ||
Comment 6•11 years ago
|
||
(In reply to Olli Pettay [:smaug] from comment #5)
> Yes. just keeping its old NAC behavior is safest at this point.
Is there a way that we can distinguish this usage of AC from the others? I'd hope that we don't have to add another Node bit.
Comment 7•11 years ago
|
||
It is not AC, but NAC. Could we just keep the NAC behavior?
Assignee | ||
Comment 8•11 years ago
|
||
(In reply to Olli Pettay [:smaug] from comment #7)
> It is not AC, but NAC.
Really. Then why mariusz did Mariusz say that this was a regression from bug 986730, and not bug 825392? Moreover, why did the issue in bug 986730 comment 2 pop up in that bug, and not in bug 825392?
> Could we just keep the NAC behavior?
Do you mean the behavior where NAC lives in the content scope. If so, then not really...hoisting NAC was necessary to get rid of same-compartment security wrappers. We'd have to back out the SOW removal and a bunch of security wrapper simplifications :-(
We could more easily back out bug 986730, but I think that would be a bit of a shame.
Assignee | ||
Comment 9•11 years ago
|
||
(In reply to Bobby Holley (:bholley) from comment #8)
> Moreover, why did the issue in bug 986730
> comment 2 pop up in that bug, and not in bug 825392?
Er, sorry. Bug 986730 comment 7.
Comment 10•11 years ago
|
||
Oh, wait. AC it is.
Assignee | ||
Comment 11•11 years ago
|
||
(In reply to Olli Pettay [:smaug] from comment #10)
> Oh, wait. AC it is.
Ok. So we could back out bug 986730, but then:
* we lose the other security benefits of having all AC inaccessible to content
* marquee doesn't work when JS is disabled (bug 948000)
* we can't do the refactoring in bug 988842
So I'd like to do something smarter here.
Can we just turn off event handlers and script elements for these <use> things?
Comment 12•11 years ago
|
||
Does turning off event handlers and script elements bring back the old behavior?
Assignee | ||
Comment 13•11 years ago
|
||
(In reply to Olli Pettay [:smaug] from comment #12)
> Does turning off event handlers and script elements bring back the old
> behavior?
Behavior in what sense? We'd still be hoisting this content into the XBL scope. We just wouldn't be hoisting any content-defined script.
The alternative is of course to just not hoist this particular kind of AC. But then we have to detect it, and handle this case.
![]() |
||
Comment 14•11 years ago
|
||
FWIW I've definitely seen content that has event handlers under a <use> element. Not so sure about script elements, so I'd expect that to be very rare.
Assignee | ||
Updated•11 years ago
|
Assignee: nobody → bobbyholley
Assignee | ||
Comment 15•11 years ago
|
||
Attachment #8406402 -
Flags: review?(bugs)
Updated•11 years ago
|
Attachment #8406402 -
Flags: review?(bugs) → review+
Assignee | ||
Comment 16•11 years ago
|
||
Assignee | ||
Comment 17•11 years ago
|
||
(In reply to Bobby Holley (:bholley) from comment #16)
> https://tbpl.mozilla.org/?tree=Try&rev=70c38d7dadd4
This had some orange due to a missing null-check. I _think_ this should be good to go aside from that.
https://hg.mozilla.org/integration/mozilla-inbound/rev/bdccb863d2de
Comment 18•11 years ago
|
||
landed on m-c https://hg.mozilla.org/mozilla-central/rev/bdccb863d2de
Status: NEW → RESOLVED
Closed: 11 years ago
Flags: in-testsuite?
Resolution: --- → FIXED
Target Milestone: --- → mozilla31
Updated•11 years ago
|
Flags: sec-bounty? → sec-bounty+
Updated•11 years ago
|
tracking-firefox31:
? → ---
Comment 20•11 years ago
|
||
Bug file shows missing plugin icon when loaded, doesn't appear to do anything else. Can anyone explain how to run this sample? I'd like to verify the fix. Thank you.
Assignee | ||
Comment 21•11 years ago
|
||
(In reply to Matt Wobensmith from comment #20)
> Bug file shows missing plugin icon when loaded, doesn't appear to do
> anything else. Can anyone explain how to run this sample? I'd like to verify
> the fix. Thank you.
In the regression range, you should see a message about chromeOnlyContent displayed in the DOM.
Comment 22•11 years ago
|
||
Thank you, Bobby. Using builds from 2014-04-06 and onwards, I don't see any messages to this effect anywhere. I'm looking at the Console (for errors) and Inspector. Am I looking in the right place, or am I missing something critical (likely)?
Assignee | ||
Comment 23•11 years ago
|
||
(In reply to Matt Wobensmith from comment #22)
> Thank you, Bobby. Using builds from 2014-04-06 and onwards, I don't see any
> messages to this effect anywhere.
You need builds from the revision in bug 986730 comment 21, which would be the 7th or 8th.
> I'm looking at the Console (for errors)
> and Inspector. Am I looking in the right place, or am I missing something
> critical (likely)?
It should appear in the web page itself.
In general this does have an automated test, so I'm not super worried if we're having trouble manually reproducing the original testcase.
Comment 24•11 years ago
|
||
I built Fx31 with those revisions, no dice for me. Also tried several builds from post-checkin on the 6th through the 9th, no luck.
We'll rely on the existing test.
I'm marking [qa-] for posterity.
Thanks for the help.
Whiteboard: [qa-]
Assignee | ||
Updated•10 years ago
|
Flags: in-testsuite? → in-testsuite+
Updated•9 years ago
|
Group: core-security → core-security-release
Updated•9 years ago
|
Group: core-security-release
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
Updated•9 months ago
|
Keywords: reporter-external
You need to log in
before you can comment on or make changes to this bug.
Description
•