Closed
Bug 931768
Opened 11 years ago
Closed 11 years ago
Arbitrary code execution using openDialog
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
VERIFIED
FIXED
mozilla28
Tracking | Status | |
---|---|---|
firefox26 | --- | unaffected |
firefox27 | + | verified |
firefox28 | + | verified |
firefox-esr17 | --- | unaffected |
firefox-esr24 | --- | unaffected |
b2g18 | --- | unaffected |
People
(Reporter: marius.mlynski, Assigned: peterv)
References
Details
(Keywords: regression, sec-critical)
Attachments
(2 files, 3 obsolete files)
(deleted),
text/html
|
Details | |
(deleted),
patch
|
peterv
:
review+
abillings
:
approval-mozilla-aurora+
abillings
:
sec-approval+
|
Details | Diff | Splinter Review |
This is a regression from bug 918345. The new implementation of nsGlobalWindow::OpenDialog doesn't check if it's called from chrome, which allows web content to open privileged windows.
The attached example launches C:\Windows\System32\calc.exe (Windows) or alerts Components.classes (other systems) in Nightly 27.0a1 (2013-10-28).
Updated•11 years ago
|
Keywords: sec-critical
Updated•11 years ago
|
status-b2g18:
--- → unaffected
status-firefox26:
--- → unaffected
status-firefox27:
--- → affected
status-firefox28:
--- → affected
status-firefox-esr17:
--- → unaffected
status-firefox-esr24:
--- → unaffected
tracking-firefox27:
--- → ?
tracking-firefox28:
--- → ?
Updated•11 years ago
|
Keywords: regression
Comment 1•11 years ago
|
||
Comment 2•11 years ago
|
||
Comment on attachment 823355 [details] [diff] [review]
Patch (v1)
[Security approval request comment]
How easily could an exploit be constructed based on the patch? The patch makes it clear that this is a chrome permission check, and hence exposes the bug, but coming up with the exploit in the test case here probably takes a bit more effort.
Do comments in the patch, the check-in comment, or tests included in the patch paint a bulls-eye on the security problem? See above.
Which older supported branches are affected by this flaw? Firefox 27, where bug 918345 landed.
If not all supported branches, which bug introduced the flaw? Bug 918345.
Do you have backports for the affected branches? If not, how different, hard to create, and risky will they be? N/A.
How likely is this patch to cause regressions; how much testing does it need? It should bring us back to the old behavior, so the risk for regressions should be minimal.
Attachment #823355 -
Flags: sec-approval?
Assignee | ||
Comment 3•11 years ago
|
||
Comment on attachment 823355 [details] [diff] [review]
Patch (v1)
Did you try the patch? I don't see how this could fix it, this is a non-scriptable method.
Attachment #823355 -
Flags: sec-approval?
Attachment #823355 -
Flags: sec-approval-
Attachment #823355 -
Flags: review?(peterv)
Attachment #823355 -
Flags: review-
Assignee | ||
Comment 4•11 years ago
|
||
We probably just need to mark openDialog ChromeOnly in the Window.webidl.
Assignee: ehsan → peterv
Assignee | ||
Comment 5•11 years ago
|
||
Working on an automated testcase, pretty sad that we didn't have one already.
Updated•11 years ago
|
Comment 6•11 years ago
|
||
Marking this as [ChromeOnly] will hide the method from regular content, which changes our existing behavior. Is that OK?
Assignee | ||
Comment 7•11 years ago
|
||
Calling it has always thrown so you'll just get a different kind of exception (ReferenceError vs a security exception). The only difference in behaviour is if it's used for browser detection ("openDialog in window"), but I think we should try it anyway.
Assignee | ||
Comment 8•11 years ago
|
||
And actually, until we switch completely to WebIDL for the Window object there won't be a difference at all, since we'll just fall back to XPConnect if the WebIDL property isn't installed.
Assignee | ||
Comment 9•11 years ago
|
||
Attachment #823355 -
Attachment is obsolete: true
Attachment #823447 -
Attachment is obsolete: true
Attachment #823504 -
Flags: review?(bzbarsky)
Comment 10•11 years ago
|
||
Comment on attachment 823504 [details] [diff] [review]
v1
r=me
Attachment #823504 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 11•11 years ago
|
||
[Security approval request comment]
How easily could an exploit be constructed based on the patch?
Fairly easily.
Do comments in the patch, the check-in comment, or tests included in the patch paint a bulls-eye on the security problem?
Yeah, we're specifically marking an accidentally exposed API as ChromeOnly.
Which older supported branches are affected by this flaw?
Firefox 27.
If not all supported branches, which bug introduced the flaw?
Bug 918345.
Do you have backports for the affected branches? If not, how different, hard to create, and risky will they be?
The patch will be identical.
How likely is this patch to cause regressions; how much testing does it need?
Very low risk, we're basically reverting to the previous behaviour.
Attachment #823577 -
Flags: sec-approval?
Attachment #823577 -
Flags: review+
Assignee | ||
Updated•11 years ago
|
Attachment #823504 -
Attachment is obsolete: true
Comment 12•11 years ago
|
||
If we haven't branched to make 27 Aurora and Central into 28 (effectively) yet, you can check this in without sec-approval. I thought the branching happened later today.
Otherwise, I'll give it sec-approval but we'll have to put it on Aurora if we go post-branching.
Comment 13•11 years ago
|
||
Comment on attachment 823577 [details] [diff] [review]
v1 with testcase
Looks like we just missed the branching. I'm giving sec-approval+ and approving for Aurora to get this in.
Attachment #823577 -
Flags: sec-approval?
Attachment #823577 -
Flags: sec-approval+
Attachment #823577 -
Flags: approval-mozilla-aurora+
Assignee | ||
Comment 14•11 years ago
|
||
Comment 15•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Comment 18•11 years ago
|
||
Confirmed issue on FF27, 2013-10-28.
Verified fixed, FF27 2013-11-20.
Verified fixed, FF28 2013-11-26.
Status: RESOLVED → VERIFIED
Keywords: verifyme
Updated•11 years ago
|
Flags: sec-bounty?
Updated•11 years ago
|
Flags: sec-bounty? → sec-bounty+
Updated•11 years ago
|
Attachment #8399667 -
Attachment description: Bounty Awarded $3000 → Bounty Awarded $3000 [paid] 4/9/14
Updated•10 years ago
|
Group: core-security
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
•