Closed Bug 408639 Opened 17 years ago Closed 17 years ago

XPCCrossOriginWrapper calls untrusted functions during construction

Categories

(Core :: XPConnect, defect, P2)

x86
Windows XP
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: moz_bug_r_a4, Assigned: mrbkap)

Details

(Whiteboard: [patch])

Attachments

(1 file, 1 obsolete file)

XPCCrossOriginWrapper has the same problem as XPCNativeWrapper (bug 407289). An attacker can perform an XSS attack against a web page that accesses top.location, etc. Also, an attacker can run arbitrary code with chrome privileges, since even when chrome accesses content via XPCNativeWrapper, XPCCrossOriginWrapper can be created internally.
Attached file testcase 1 - XSS
This tries to get cookies for www.google.com. This uses bug 344495's trick. This works on trunk.
This uses bug 344495's trick. This works on trunk.
Flags: blocking1.9?
Assignee: nobody → mrbkap
Flags: blocking1.9? → blocking1.9+
Priority: -- → P2
Attached patch Simple fix (obsolete) — Splinter Review
This is the easiest way to fix the bug: always just use the currently running script as a scope to figure out what prototype to use (note: it doesn't matter, we null out the prototype later anyway). The actual problem is that we are trying to stash the document's wrapper on the window at an inopportune time. Fixing that is "hard," however, so I went with this.
Attachment #294515 - Flags: superreview?(brendan)
Attachment #294515 - Flags: review?(jst)
Comment on attachment 294515 [details] [diff] [review] Simple fix A note in a comment here would be good (i.e. update the comment talking about severing the prototype link etc). r=jst
Attachment #294515 - Flags: review?(jst) → review+
I added a comment above the JS_NewObject call that says: // Note that we create outerObj with a null parent here. We set it // later so that we find our nominal prototype in the same scope as // the one that is calling us.
Whiteboard: [patch]
Comment on attachment 294515 [details] [diff] [review] Simple fix How about adding a "FIXME: bug 408871" comment and sr=me? /be
Attachment #294515 - Flags: superreview?(brendan) → superreview+
Attachment #294515 - Attachment is obsolete: true
Fix checked in.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Flags: in-testsuite?
Group: core-security
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: