The Mark of the Web (MOTW) is a feature of Windows Internet Explorer that enhances security by enabling Internet Explorer to force webpages to run in the security zone of the location the page was saved from—as long as that security zone is more restrictive than the Local Machine zone—instead of the Local Machine zone. When you are developing webpages, the MOTW enables you to test your HTML documents in the security zone where you intend the pages to run. Adding the MOTW to your webpages also enables you to fully test their compatibility with users' security settings.
This topic contains the following sections.
The MOTW is a comment added to the HTML markup for a webpage. When a user opens the webpage from a local machine, Internet Explorer references this comment to determine the security zone in which it should run the page. Following is an example of a valid MOTW comment.
<!-- saved from url=(0023)http://www.contoso.com/ -->To be valid, a MOTW comment must follow some simple rules.
<!-- saved from url=
--> For situations where the domain is not yet known, Internet Explorer recognizes two generic comments. The about:internet comment specifies the Internet zone and should be formatted as follows.
<!-- saved from url=(0014)about:internet -->The http://localhost comment specifies the Local Intranet zone and is properly formatted as follows.
<!-- saved from url=(0016)http://localhost -->The HTML comment must be properly formatted for Internet Explorer to parse the information correctly. Proper format includes inserting a space immediately following the opening delimiter " <!-- " and just before the closing delimiter " --> ". The line must end in CR LF. Some HTML editors insert only a LF.
The MOTW feature is recognized by Microsoft Internet Explorer 4.0 and later. Beginning with Internet Explorer 6 for Windows XP Service Pack 2 (SP2), you can also add the comment to multipart HTML (MHT) files and to XML files. Note that earlier versions of Internet Explorer will not recognize a MOTW comment tag in either MHT or XML files.
There are two ways the MOTW can be added to an HTML document:
The following example show a properly formatted MOTW.
<!doctype html>
<!-- saved from url=(0023)http://www.contoso.com/ -->
<html>
<head>
<title>A Mark of the Web Example.</title>
</head>
<body>
<p>Hello, World</p>
</body>
</html>
To determine the current zone of a webpage that is displayed in Internet Explorer, right-click the page and then click Properties. The Zone field reports the zone used to display the current webpage.
When a user opens a locally hosted HTML file, Internet Explorer looks for the MOTW and carries out the following steps:
<!-- saved from url= In cases where the generic MOTW (<!-- saved from url=(0014)about:internet -->) is used because the domain name is unknown, the "about:internet" forces Internet Explorer to host the webpage in the Internet zone.
You should add a MOTW to every HTML document whose contents would be restricted by Internet Explorer's Local Machine zone lockdown security feature. Following are examples of when to insert a MOTW:
Many HTML pages contain content such as script, Microsoft ActiveX controls, or binary behaviors. These pages are known as active HTML documents. Prior to Windows XP SP2, the content on a user's local file system—except for content cached by Internet Explorer—was regarded as trusted and was therefore assigned to the Local Machine security zone. The Local Machine zone allowed files to run in Internet Explorer with few restrictions. Attackers found that they could exploit the Local Machine zone and its looser restrictions to access a user's computer. By using controls that are restricted to trusted zones, an attacker could elevate privileges and compromise the user's computer. The attacker would then have unrestricted access to the computer's content.
To mitigate this security risk, Internet Explorer "locks down" the Local Machine zone. When the user opens an HTML document, Internet Explorer prohibits active content from running and displays an Information bar. The user must then decide whether to permit the action that triggered the Information bar. The Local Machine zone lockdown prevents the user's computer from automatically executing any scripts, and from using any ActiveX and other controls. See About URL Security Zones for more information on the Local Machine zone.
Because the Local Machine zone has so few security restrictions, active HTML documents running on the local machine have access to the computer's entire file system. The MOTW aids Internet Explorer in protecting the user from the risks of running these documents in the Local Machine zone. By referencing the MOTW, Internet Explorer can force these webpages into a zone that has more restrictions, such as the Internet zone. At the same time, the MOTW cannot be used to elevate webpages to a zone with fewer restrictions. Forced out of the Local Machine zone, the active content has no access to the computer's file system.
Additionally, cross-domain requests both to and from the active HTML documents fail, so that code running from these webpages cannot access the user's hard disk.