Closed Bug 393669 Opened 18 years ago Closed 18 years ago

Calling a function on a XOW doesn't call the original function (calls the one that overwrote it)

Categories

(Core :: XPConnect, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: Waldo, Assigned: mrbkap)

References

()

Details

(Whiteboard: [sg:high?] probably few sites vulnerable, is "moderate" more appropriate?)

Attachments

(1 file)

Calling an allAccess function on a window that's not same-origin with the caller calls the function that other window defined on itself, not the original. In other words, a window which redefines window.blur can screw with the expectations (maybe do worse) of any other window that blurs it, or the same for any other allAccess method, most likely. I ran into this while working on the patch for bug 387706.
Er, this happens in Firefox 2 as well. It doesn't happen in Safari, so it's not some web-compat idiocy I just don't know about, either.
Attached patch FixSplinter Review
I don't know how I missed this before, but we really can't forward when resolving for a XOW. This seems like the easiest way to do it.
Assignee: nobody → mrbkap
Status: NEW → ASSIGNED
Attachment #278207 - Flags: superreview?(jst)
Attachment #278207 - Flags: review?(jst)
Comment on attachment 278207 [details] [diff] [review] Fix This will also make it so that if someone uses an object with an outer window as the objects prototype, we won't be forwarding resolves etc in that case either. Not sure we care. r+sr=jst if you think we don't.
Attachment #278207 - Flags: superreview?(jst)
Attachment #278207 - Flags: superreview+
Attachment #278207 - Flags: review?(jst)
Attachment #278207 - Flags: review+
Attachment #278207 - Flags: approval1.9+
Actually, I don't think that's the case. Looking at the code in js_LookupPropertyWithFlags, it looks like we pass the 'current' objet when looking up the property. This contrasts sharply with the get/set property hooks, which take the original object and call the derived hook's method.
Fix checked into trunk. (Thanks for the approval jst, I totally forgot about it ;-)).
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
We'll want this on the 2.0 branch when we take XOW
Flags: wanted1.8.1.x+
Flags: blocking1.8.1.7?
Whiteboard: [sg:high?] probably few sites vulnerable, is "moderate" more appropriate?
Flags: blocking1.8.1.8? → blocking1.8.1.9?
Flags: blocking1.8.1.12? → blocking1.8.1.13?
This is tested by one of the tests in the recently-landed support for window.postMessage via bug 387706.
Flags: in-testsuite+
Flags: blocking1.8.1.13?
Group: core-security
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: