wiidening document.domain produces uncaught exception when readng form element value

RESOLVED WORKSFORME

Status

()

--
critical
RESOLVED WORKSFORME
16 years ago
16 years ago

People

(Reporter: crsng1, Assigned: john)

Tracking

Trunk
x86
Windows 2000
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

16 years ago
On Mozilla 1.1b Build ID: 2002072104 when widening document.domain, for example
setting document.domain="mydomain.com" in a page on server www.mydomain.com
produces the following error when trying to access the value of a form input
field, for example document.forms[0].elements[0].value :

Error: uncaught exception: Security Error: Content at
http://mydomain.com/page.htm may not load data from
http://www.mydomain.com/page.htm.

Here's a small example to repro bug (ajust mydomain.com). Just enter a value in
the input field and hit submit. Normally an alert box should display the element
value but instead it generates the error.

<html>
<head>
  <script language="JavaScript">
    document.domain = "mydomain.com"
  </script>
</head>
<body>
   <form onsubmit="alert (document.forms[0].elements[0].value);">
    <input name="test">
    <input type="submit">
  </form>
</body>
</html>

You can also try it out on http://www.netscript.com/extsnaps/mozilla/domain.htm

Comment 1

16 years ago
->
Assignee: rods → jkeiser
(Reporter)

Comment 2

16 years ago
Problem fixed in Mozilla 1.1 / 20020826
marking so.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 16 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.