Closed
Bug 86147
Opened 23 years ago
Closed 23 years ago
SECURITY: should require same-origin when defining a getter/setter
Categories
(Core :: Security, defect, P1)
Core
Security
Tracking
()
VERIFIED
FIXED
mozilla0.9.3
People
(Reporter: jruderman, Assigned: jst)
Details
(Whiteboard: [PDT+])
Attachments
(2 files)
564 bytes,
text/html
|
Details | |
2.88 KB,
patch
|
Details | Diff | Splinter Review |
A page can define getters and setters for attribute of any object in another
domain as long as they can get a reference to the parent object. Putting a
getter on an object lets me give it a different value (as well as find out when
the page accesses that value), and putting a setter on an object lets me find
out what values the page tries to assign to that object.
Using this hole, I can find out what foopy is if the page does
passwd = foopy;
or
document.getElementById(foopy);
(by redefining document.getElementById to be a function defined by me)
or
document.frm.password = foopy;
(by redefining document.frm to be an object with a setter for the 'password'
property which is defined by me).
This bug exists with at least two methods of defining getter or setter:
* otherWindow.variable getter = function () { ... }; [deprecated syntax]
* otherWindow.__defineGetter__ ("variable", function () { ... });
Reporter | ||
Comment 1•23 years ago
|
||
Comment 2•23 years ago
|
||
I'm sure we've seen this before, and I thought we fixed it. Oh well. I'd
consider this an RTM stopper.
Keywords: nsBranch
Target Milestone: --- → mozilla0.9.3
Updated•23 years ago
|
Status: NEW → ASSIGNED
Priority: -- → P1
Comment 3•23 years ago
|
||
Adding nsBranch keyword as these bugs need to get into RTM.
Comment 4•23 years ago
|
||
Assigining the getter/setter cross-domain was blocked in 0.9, but not now, so
this is a regression. There used to be a callback from the JS engine when a
getter was assigned; maybe this got blown away by XPCDOM?
I am marking [PDT+] to track this security bug as RTM stopper as per Mitch's
comment on 6-20 17:17. Don't want to lose this bug in all of the nsbranch
keyword bugs.
Summary: should require same-origin when defining a getter/setter → SECURITY: should require same-origin when defining a getter/setter
Whiteboard: [PDT+]
Assignee | ||
Comment 6•23 years ago
|
||
Taking bug, I know how to fix this, we can re-introduce the old security check
that caught this in pre-XPCDOM builds.
OS: Windows NT → All
Hardware: PC → All
Assignee | ||
Comment 8•23 years ago
|
||
Assignee | ||
Comment 9•23 years ago
|
||
The attached patch fixes this problem, along with fixing a bug in the JS engine
which is required for the real fix for this problem. Mitchell, could you review?
Brendan, could you sr?
Status: NEW → ASSIGNED
Comment 10•23 years ago
|
||
Do you need to set *_retval unconditionally at the top of
nsDOMClassInfo::CheckAccess, or is it "inout" in the sense that it comes in with
a sane default value? Other than that, sr=brendan@mozilla.org.
/be
Assignee | ||
Comment 11•23 years ago
|
||
Brendan, *_retval is meant to be only an out parameter but jband and I decided
to default the value of *_retval to a sane value (PR_TRUE) in XPConnect so that
we wouldn't need to set it in all scriptable helper methods. We only need to set
it to false to indicate failure.
Thanks for the sr.
Assignee | ||
Updated•23 years ago
|
Keywords: mozilla0.9.3
Comment 12•23 years ago
|
||
Perfect...r=mstoltz
Assignee | ||
Comment 13•23 years ago
|
||
Fix checked in on both the trunk and the .92 branch.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Comment 14•23 years ago
|
||
Marking VERIFIED FIXED on:
-MacOS91 2001-07-10-03-0.9.2
-LinRH62 2001-07-10-08-0.9.2
-Win98SE 2001-07-10-05-0.9.2
Status: RESOLVED → VERIFIED
Reporter | ||
Comment 15•23 years ago
|
||
See also bug 90591, a security hole that allows me to get around this check.
You need to log in
before you can comment on or make changes to this bug.
Description
•