Closed
Bug 546573
Opened 15 years ago
Closed 14 years ago
It's possible to access an outer window's Function constructor (Universal XSS)
Categories
(Core :: Security, defect)
Tracking
()
People
(Reporter: moz_bug_r_a4, Assigned: mrbkap)
References
Details
(Whiteboard: [sg:high][critsmash-high:patch] fixed-in-tracemonkey)
Attachments
(5 files, 2 obsolete files)
329 bytes,
text/html
|
Details | |
310 bytes,
text/html
|
Details | |
8.23 KB,
patch
|
jst
:
review+
enndeakin
:
review+
|
Details | Diff | Splinter Review |
9.57 KB,
patch
|
Details | Diff | Splinter Review | |
511 bytes,
patch
|
Details | Diff | Splinter Review |
When an outer window has no inner window yet, it's possible to access the outer
window's Function constructor, which can be used to perform an XSS attack.
Reporter | ||
Comment 1•15 years ago
|
||
This tries to get cookies for www.mozilla.com.
Comment 2•15 years ago
|
||
Note to self: make sure 3rd-party cookies are not blocked when trying to reproduce this.
Assignee: nobody → mrbkap
blocking1.9.2: --- → ?
blocking2.0: --- → ?
status1.9.1:
--- → wanted
status1.9.2:
--- → wanted
Flags: wanted1.9.0.x+
Keywords: regression,
regressionwindow-wanted
Whiteboard: [sg:high]
Updated•15 years ago
|
Keywords: regression,
regressionwindow-wanted
Assignee | ||
Comment 3•15 years ago
|
||
I think this is all that's required to fix this bug. Basically, we need to make sure that by the time a window is exposed to script, it has an inner window. I *think* that this is all that's required to do that, but I'm not entirely sure.
This supports a previous argument that I've made that outer windows shouldn't be global objects at all (weird, huh?). At the very least it's extra confusing. At the most, it turns into stuff like this. (The fact that we have *two* Function constructors, one of which is never correct to use is something that we've had trouble with before.)
Attachment #427444 -
Flags: superreview?(bzbarsky)
Attachment #427444 -
Flags: review?(jst)
Updated•15 years ago
|
Attachment #427444 -
Flags: superreview?(bzbarsky) → superreview+
Comment 4•15 years ago
|
||
Comment on attachment 427444 [details] [diff] [review]
Proposed fix
sr=bzbarsky
Updated•15 years ago
|
blocking2.0: ? → beta1
Updated•15 years ago
|
Attachment #427444 -
Flags: review?(jst) → review+
Reporter | ||
Comment 5•15 years ago
|
||
Does that patch fix this?
Updated•15 years ago
|
blocking1.9.2: ? → needed
Assignee | ||
Updated•15 years ago
|
Attachment #427444 -
Attachment is obsolete: true
Attachment #427444 -
Flags: superreview+
Attachment #427444 -
Flags: review+
Assignee | ||
Comment 6•15 years ago
|
||
This is the only way I could figure out to EnsureInnerWindow for script that doesn't run for all windows (since we very eagerly create JSObjects for outer windows).
Attachment #429648 -
Flags: superreview?(bzbarsky)
Attachment #429648 -
Flags: review?(jst)
Comment 7•15 years ago
|
||
Comment on attachment 429648 [details] [diff] [review]
Proposed fix v2
Ok, but maybe we should just eagerly create inner windows and be done with it? Out of scope here, I know.
Attachment #429648 -
Flags: superreview?(bzbarsky) → superreview+
Updated•15 years ago
|
Attachment #429648 -
Flags: review?(jst) → review+
Assignee | ||
Comment 8•15 years ago
|
||
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 9•15 years ago
|
||
Had to back this out... it broke focus mochitests.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Updated•15 years ago
|
Attachment #429648 -
Attachment is obsolete: true
Assignee | ||
Comment 10•15 years ago
|
||
A sample for my reference:
s: moz2-linux-slave2639502 ERROR TEST-UNEXPECTED-FAIL | /tests/content/html/content/test/test_bug430351.html | <iframe xmlns="http://www.w3.org/1999/xhtml"></iframe> in <div xmlns="http://www.w3.org/1999/xhtml" id="parent"><iframe></iframe></div> should not be focusable - Didn't expect [object HTMLIFrameElement], but got it.
39503 ERROR TEST-UNEXPECTED-FAIL | /tests/content/html/content/test/test_bug430351.html | <iframe xmlns="http://www.w3.org/1999/xhtml" tabindex="-1"></iframe> in <div xmlns="http://www.w3.org/1999/xhtml" id="parent"><iframe tabindex="-1"></iframe></div> should not be focusable - Didn't expect [object HTMLIFrameElement], but got it.
39504 ERROR TEST-UNEXPECTED-FAIL | /tests/content/html/content/test/test_bug430351.html | <iframe xmlns="http://www.w3.org/1999/xhtml" tabindex="0"></iframe> in <div xmlns="http://www.w3.org/1999/xhtml" id="parent"><iframe tabindex="0"></iframe></div> should not be focusable - Didn't expect [object HTMLIFrameElement], but got it.
Assignee | ||
Comment 11•15 years ago
|
||
Neil, the test that started failing seems to be bogus: as far as I can tell, the only reason that, before this patch, <iframe>s weren't focusable was that nobody bothered to force an inner window (e.g. by looking up a property on it). It seems, then, like the test that failed is bogus; but I'm not entirely sure... Do you have an opinion?
Comment 12•15 years ago
|
||
I bet bug 546648 is related here, same problem it seems like.
Assignee | ||
Comment 13•15 years ago
|
||
This fixes the test too. Neil could you review the changes?
Attachment #444217 -
Flags: review?(jst)
Assignee | ||
Updated•15 years ago
|
Attachment #444217 -
Flags: review?(enndeakin)
Updated•15 years ago
|
Attachment #444217 -
Flags: review?(jst) → review+
Updated•15 years ago
|
Attachment #444217 -
Flags: review?(enndeakin) → review+
Assignee | ||
Comment 14•15 years ago
|
||
Status: REOPENED → RESOLVED
Closed: 15 years ago → 15 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 15•15 years ago
|
||
Backed out... more mochitest failures.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Updated•15 years ago
|
Whiteboard: [sg:high] → [sg:high][critsmash-high:patch]
Comment 16•15 years ago
|
||
Blake, eta on this? To be clear: Not as important as the sg:crits. Put this one last on your sg: to-be-fixed list.
Updated•15 years ago
|
blocking2.0: beta1+ → beta2+
Comment 17•15 years ago
|
||
Updated•15 years ago
|
Attachment #455041 -
Attachment is obsolete: true
Updated•15 years ago
|
Attachment #455041 -
Attachment is obsolete: false
Comment 18•15 years ago
|
||
We may not want the changes to docshell_helpers.js in that diff...
Comment 19•15 years ago
|
||
This fixes another test failure. With this fix I *think* we're down to one remaining consistent failure, and that looks like this in the logs:
TEST-UNEXPECTED-FAIL | chrome://mochikit/content/browser/browser/components/sessionstore/test/browser/browser_500328.js | Timed out
TEST-UNEXPECTED-FAIL | chrome://mochikit/content/browser/browser/components/sessionstore/test/browser/browser_500328.js | Found an unexpected tab at the end of test run: http://example.com/
But no indication about what actually fails there. I haven't had a chance to run that test locally yet...
Updated•15 years ago
|
blocking2.0: beta2+ → beta3+
Comment 20•15 years ago
|
||
What's keeping this from landing? Does it affect branches as well? Marked a b3 blocker 10 days ago, no activity since.
Comment 21•15 years ago
|
||
This is not going to make it for beta3, moving to beta4.
blocking2.0: beta3+ → beta4+
Assignee | ||
Comment 22•14 years ago
|
||
http://hg.mozilla.org/tracemonkey/rev/6ea9b217883a
This is actually fixed twice over. I'm going to get rid of CheckWindow in a separate patch. I'll investigate a less threatening patch (one that doesn't break docshell tests) for branches.
Whiteboard: [sg:high][critsmash-high:patch] → [sg:high][critsmash-high:patch] fixed-in-tracemonkey
Comment 23•14 years ago
|
||
Status: REOPENED → RESOLVED
Closed: 15 years ago → 14 years ago
Resolution: --- → FIXED
Comment 24•14 years ago
|
||
Time to work on a branch version of this one.
blocking1.9.1: --- → .13+
blocking1.9.2: needed → .10+
Comment 25•14 years ago
|
||
sg:high -> punt to next version.
blocking1.9.1: .14+ → needed
blocking1.9.2: .11+ → needed
Comment 26•14 years ago
|
||
It's the next version--mrbkap will you have time to backport this one now?
blocking1.9.1: needed → .15+
blocking1.9.2: needed → .12+
Updated•14 years ago
|
blocking1.9.1: .16+ → .17+
blocking1.9.2: .13+ → .14+
Comment 27•14 years ago
|
||
Punting to the next branch version as it Blake didn't get to this.
blocking1.9.1: .17+ → .18+
blocking1.9.2: .14+ → .15+
Comment 28•14 years ago
|
||
This bug is getting very bruised from all the kicking
Comment 29•14 years ago
|
||
Deferring to a future point release as we have run out of time. If this absolutely needs to be fixed and can land today or tomorrow, please send a note to release-drivers@mozilla.org
blocking1.9.1: .19+ → .20+
blocking1.9.2: .17+ → .18+
Comment 30•14 years ago
|
||
Is it even possible to fix this bug on the old branch?
blocking1.9.1: .20+ → needed
blocking1.9.2: .18+ → .19+
Updated•14 years ago
|
blocking1.9.2: .20+ → needed
Summary: It's possible to access an outer window's Function constructor → It's possible to access an outer window's Function constructor (Universal XSS)
Comment 31•14 years ago
|
||
Blake says there's no way to fix this on the 1.9.2 branch
Updated•13 years ago
|
blocking1.9.1: needed → -
blocking1.9.2: needed → -
Updated•9 years ago
|
Group: core-security → core-security-release
Updated•9 years ago
|
Group: core-security-release
You need to log in
before you can comment on or make changes to this bug.
Description
•