Vulnerability Note VU#885753

Mozilla browsers "location.hostname" cross-domain vulnerability

Original Release date: 15 Feb 2007 | Last revised: 09 Mar 2007


Mozilla-based browsers contain a cross-domain vulnerability, which may allow an attacker to access data in other sites.


Mozilla uses a same origin security model to maintain separation between browser frames from different sources. This model is designed to prevent code in one domain from accessing data in a different domain. From the same origin policy:

    Mozilla considers two pages to have the same origin if the protocol, port (if given), and host are the same for both pages.

Mozilla fails to properly handle location.hostname parameters that have embedded null characters, which can cause a cross-domain violation. Note that this only affects web sites that have specify the document.domain setting for relaxed same origin protection. This vulnerability appears to affect all Mozilla-based browsers, including Firefox.


By convincing a victim to view an HTML document (web page), an attacker could modify data in another domain. For example, web page script in one domain could set a cookie for a web page in another domain.


Apply an update
This vulnerability is addressed in Firefox, Firefox, and SeaMonkey 1.0.8, as specified in MFSA 2007-07.

Disable the ability to set location.hostname

This vulnerability can be mitigated by disabling the ability for a web site to set the location.hostname property. This can be accomplished by adding the following line to the user.js file:

    user_pref("capability.policy.default.Location.hostname.set", "noAccess");
Disable JavaScript

Disable JavaScript in your browser's preferences. Instructions for disabling JavaScript can be found in the Securing Your Web Browser document and the Malicious Web Scripts FAQ. Some Mozilla add-ons can simplify the ability to enable or disable JavaScript, or set up site-specific rules for doing so.

Systems Affected (Learn More)

VendorStatusDate NotifiedDate Updated
MozillaAffected15 Feb 200715 Feb 2007
If you are a vendor and your product is affected, let us know.

CVSS Metrics (Learn More)

Group Score Vector
Base N/A N/A
Temporal N/A N/A
Environmental N/A N/A



This vulnerability was publicly disclosed by Michal Zalewski.

This document was written by Will Dormann.

Other Information

  • CVE IDs: CVE-2007-0981
  • Date Public: 14 Feb 2007
  • Date First Published: 15 Feb 2007
  • Date Last Updated: 09 Mar 2007
  • Severity Metric: 6.76
  • Document Revision: 47


If you have feedback, comments, or additional information about this vulnerability, please send us email.