<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">EricLaw's IEInternals</title><subtitle type="html">A look at Internet Explorer from the inside out.</subtitle><id>http://blogs.msdn.com/ieinternals/atom.xml</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/ieinternals/default.aspx" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/ieinternals/atom.xml" /><generator uri="http://communityserver.org" version="2.1.61025.2">Community Server</generator><updated>2009-09-18T02:18:00Z</updated><entry><title>Understanding the Protected Mode Elevation Dialog</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/ieinternals/archive/2009/12/01/Understanding-Internet-Explorer-Security-Protected-Mode-Elevation-Dialog.aspx" /><id>http://blogs.msdn.com/ieinternals/archive/2009/12/01/Understanding-Internet-Explorer-Security-Protected-Mode-Elevation-Dialog.aspx</id><published>2009-12-01T02:56:00Z</published><updated>2009-12-01T02:56:00Z</updated><content type="html">&lt;P&gt;Internet Explorer 7 introduced Protected Mode, a feature which helps ensure that the browser and its add-ons run with a minimal set of permissions. Code running inside the “Low Rights” process doesn’t have permission to write to your user-profile’s folders or registry keys, which helps to constrain the damage if a bad guy manages to find a vulnerability within the browser or its add-ons. &lt;/P&gt;
&lt;P&gt;To help ensure compatibility, Protected Mode employs a system of virtualization to help ensure that code that runs within Protected Mode will continue to work even when its permissions are restricted. &lt;/P&gt;
&lt;P&gt;In some cases, virtualization can lead to surprising outcomes, some of which Mark Russinovich describes in his blog post &lt;A href="http://blogs.technet.com/markrussinovich/archive/2009/02/03/3174194.aspx" mce_href="http://blogs.technet.com/markrussinovich/archive/2009/02/03/3174194.aspx"&gt;The Case of the Phantom Desktop Files&lt;/A&gt;. Beyond such surprises, some functions just cannot be virtualized effectively—for instance, if you want to offer a feature that sets the current user’s Desktop wallpaper, your code simply &lt;EM&gt;must &lt;/EM&gt;write to their user-profile. &lt;/P&gt;
&lt;P&gt;How does IE resolve the tradeoff between security and functionality? The answer is “by using brokers.” The idea is that Internet Explorer (and some add-ons like Flash and Java) will run a broker process with “Medium Rights” that can use the current user’s permissions to take actions that would otherwise be prohibited when rendering content inside the Protected Mode sandbox. A broker process must be carefully designed to accept untrusted input (since its caller could be malicious code trying to escape the sandbox), sanitizing data and confirming any security-sensitive actions with the user directly before making changes. &lt;/P&gt;
&lt;P&gt;When an add-on running inside Protected Mode attempts to launch a broker process (or any other program), the &lt;A href="http://msdn.microsoft.com/en-us/library/bb250462(VS.85).aspx#wpm_elebp" mce_href="http://msdn.microsoft.com/en-us/library/bb250462(VS.85).aspx#wpm_elebp"&gt;ElevationPolicy&lt;/A&gt; registry key (HKLM\Software\Microsoft\Internet Explorer\Low Rights\ElevationPolicy) is checked to determine how the process should be launched. One of four policy values may be specified:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;TABLE border=1 cellSpacing=0 cellPadding=2 width=601&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD vAlign=top width=42&gt;&lt;STRONG&gt;Policy&lt;/STRONG&gt;&lt;/TD&gt;
&lt;TD vAlign=top width=557&gt;&lt;STRONG&gt;Result&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD vAlign=top width=42&gt;0&lt;/TD&gt;
&lt;TD vAlign=top width=557&gt;Protected mode prevents the process from launching.&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD vAlign=top width=42&gt;1&lt;/TD&gt;
&lt;TD vAlign=top width=557&gt;Protected mode silently launches the broker as a low integrity process.&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD vAlign=top width=42&gt;2&lt;/TD&gt;
&lt;TD vAlign=top width=557&gt;Protected Mode prompts the user for permission to launch the process. If permission is granted, the process is launched as a medium integrity process.&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD vAlign=top width=42&gt;3&lt;/TD&gt;
&lt;TD vAlign=top width=557&gt;Protected Mode silently launches the broker as a medium integrity process.&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The problem arises when a broker process fails to properly register an elevation policy. If no ElevationPolicy is specified, then the default policy is #2, and the user sees a prompt for permission to launch the process. In the case of a broker process, this can lead to a very confusing user-experience. For instance, if Flash’s Broker’s elevation policy is missing from the registry, any page that uses Flash will trigger the following prompt:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;IMG alt="Protected Mode Elevation Prompt" src="http://www.enhanceie.com/images/blog/PMElevationDialog.png" mce_src="http://www.enhanceie.com/images/blog/PMElevationDialog.png"&gt;&lt;/BLOCKQUOTE&gt;
&lt;P mce_keep="true"&gt;Now, keeping in mind that average users (and most super users) don’t have any idea what a broker is or why they’re seeing this dialog, it’s understandable that they might click either “Allow” or “Don’t allow” just to get rid of it. However, the next time the add-on attempts to launch the broker process, the user will be presented with the same prompt.&amp;nbsp; As you might imagine, they will quickly get tired of this!&lt;/P&gt;
&lt;P&gt;Users tired of banging the “Don’t allow” button (not really understanding what the broker is and why it exists) are likely to try checking the “Do not show me the warning for this program again” box before clicking the “Don’t allow” button.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;IMG alt="Protected Mode Elevation Prompt with Don't Ask, Deny Always" src="http://www.enhanceie.com/images/blog/PMElevationDialogDeny.png" mce_src="http://www.enhanceie.com/images/blog/PMElevationDialogDeny.png"&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Unfortunately, this exercise is doomed—the “Do not show” checkbox only takes effect when you push the “Allow” button—you cannot automatically deny access for a given process. &lt;/P&gt;
&lt;P&gt;Why not? Because it would break things unexpectedly, and there would be no way for a normal person to figure out what went wrong and subsequently fix it. An add-on that tried to launch its broker would &lt;EM&gt;always &lt;/EM&gt;fail, and might try repeatedly (hanging the browser). Worse still, there’s no way for the user to go back and change their mind—there was no reasonably affordable way to build a UI that would allow for such reversals.&lt;/P&gt;
&lt;P&gt;Add-on developers should take care to ensure that the ElevationPolicy for their broker process is properly set at install time (and may wish to confirm that it’s set properly if the broker ever fails to launch due to an Access Denied error, and notify the user accordingly). &lt;/P&gt;
&lt;P&gt;End-users encountering unexpected Protected Mode Elevation prompts should consider either reinstalling whatever add-on is triggering the prompt (it’s often obvious) or disabling any unrecognized or unwanted add-ons. Beyond reducing attack surface and prompts, disabling unwanted add-ons will often improve browser performance.&lt;/P&gt;
&lt;P&gt;-Eric&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9930532" width="1" height="1"&gt;</content><author><name>EricLaw</name><uri>http://blogs.msdn.com/members/EricLaw.aspx</uri></author><category term="ActiveX" scheme="http://blogs.msdn.com/ieinternals/archive/tags/ActiveX/default.aspx" /><category term="Best-Practices" scheme="http://blogs.msdn.com/ieinternals/archive/tags/Best-Practices/default.aspx" /><category term="UAC" scheme="http://blogs.msdn.com/ieinternals/archive/tags/UAC/default.aspx" /><category term="add-ons" scheme="http://blogs.msdn.com/ieinternals/archive/tags/add-ons/default.aspx" /></entry><entry><title>The JVM Install Prompt</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/ieinternals/archive/2009/11/27/Java-Applets-Cause-Misleading-ActiveX-Security-Warning.aspx" /><id>http://blogs.msdn.com/ieinternals/archive/2009/11/27/Java-Applets-Cause-Misleading-ActiveX-Security-Warning.aspx</id><published>2009-11-27T20:37:00Z</published><updated>2009-11-27T20:37:00Z</updated><content type="html">&lt;P&gt;Many years ago, Microsoft developed an implementation of a &lt;A href="http://en.wikipedia.org/wiki/Java_Virtual_Machine" mce_href="http://en.wikipedia.org/wiki/Java_Virtual_Machine"&gt;Java Virtual Machine&lt;/A&gt; to run Java content. Internet Explorer 5 included code that would download and install the JVM (if needed) when a user encountered Java content on the web. After some time, &lt;A href="http://www.microsoft.com/mscorp/java/default.mspx" mce_href="http://www.microsoft.com/mscorp/java/default.mspx"&gt;support was discontinued&lt;/A&gt; for the Microsoft JVM, and no further updates were made available. The Microsoft JVM should no longer be used, as security patches are no longer released for it-- installation is blocked on Vista and Windows 7.&lt;/P&gt;
&lt;P&gt;To help ensure that Internet Explorer users still are able to recognize when a page requires a JVM, the existing Microsoft JVM install code in IE was replaced with a dialog box that helps direct the user toward an available JVM (namely, Sun Microsystems’ implementation).&lt;/P&gt;
&lt;P&gt;That dialog box looks like this:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;IMG alt="Install Java Prompt" src="http://www.enhanceie.com/images/blog/UsesJava.png" mce_src="http://www.enhanceie.com/images/blog/UsesJava.png"&gt; &lt;/BLOCKQUOTE&gt;
&lt;P&gt;If you click the “More Info” button, you are taken to a &lt;A href="http://go.microsoft.com/fwlink/?LinkID=58658" mce_href="http://go.microsoft.com/fwlink/?LinkID=58658"&gt;web page&lt;/A&gt; explaining how to install the Sun Java Virtual Machine.&lt;/P&gt;
&lt;P&gt;When you check the “Do not show this message again” box, Internet Explorer stores this preference in the registry. It does so by creating a registry string named {08B0e5c0-4FCB-11CF-AAA5-00401C608501} inside the &lt;STRONG&gt;HKCU\Software\Microsoft\Active Setup\Declined Install On Demand IEv5\ &lt;/STRONG&gt;branch.&lt;/P&gt;
&lt;P&gt;If you decide not to install a JVM, you may quickly grow tired of this modal dialog box and thus tick the “Do not show this message again” box. Subsequently, IE will never show this prompt again.&lt;/P&gt;
&lt;P&gt;Unfortunately, depending on how pages using Java Applets are constructed, this may result in a confusing user-experience. Consider, for instance, &lt;A href="http://www.natice.noaa.gov/ims/loop/nhem-1mo-loop.html" mce_href="http://www.natice.noaa.gov/ims/loop/nhem-1mo-loop.html"&gt;this National Ice Center page&lt;/A&gt; which requires Java. When you visit this page without a JVM installed, you will see the following information bar:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;IMG alt="Misleading Information Bar" src="http://www.enhanceie.com/images/blog/ConfusingAXWarning.png" mce_src="http://www.enhanceie.com/images/blog/ConfusingAXWarning.png"&gt; &lt;/BLOCKQUOTE&gt;
&lt;P&gt;The text of this information bar is misleading—the page doesn’t use an ActiveX control—the prompt is merely a side-effect of how Applet support was built into IE. Unfortunately, there’s no indication that this prompt is really related to Java. If you choose “Install This Add-on” from the Information bar’s menu, you’ll see another misleading dialog box:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;IMG alt="Misleading Authenticode Dialog" src="http://www.enhanceie.com/images/blog/ConfusingAuthenticode.png" mce_src="http://www.enhanceie.com/images/blog/ConfusingAuthenticode.png"&gt; &lt;/BLOCKQUOTE&gt;
&lt;P&gt;Fortunately, the National Ice Center page also includes some fallback text in the Applet tag so that if the Applet cannot be rendered, the page itself will explain that Java is required:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT size=2 face="Lucida Console"&gt;&amp;lt;APPLET&amp;gt; &lt;BR&gt;&amp;lt;PARAM&amp;gt;&amp;lt;/PARAM&amp;gt; &amp;lt;PARAM&amp;gt;&amp;lt;/PARAM&amp;gt;&amp;lt;PARAM&amp;gt;&amp;lt;/PARAM&amp;gt; &lt;BR&gt;&lt;FONT color=#ff0000&gt;&amp;lt;b&amp;gt;You must install Java to use this page!&amp;lt;/b&amp;gt; &lt;BR&gt;&lt;/FONT&gt;&amp;lt;/APPLET&amp;gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Additionally, if you develop your page &lt;A href="http://deletethis.net/dave/qbp/" mce_href="http://deletethis.net/dave/qbp/"&gt;using an OBJECT tag with an APPLET tag embedded within&lt;/A&gt;, Internet Explorer will show only the “You need Java” dialog, and will not display the misleading ActiveX information bar.&lt;/P&gt;
&lt;P&gt;-Eric&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9929505" width="1" height="1"&gt;</content><author><name>EricLaw</name><uri>http://blogs.msdn.com/members/EricLaw.aspx</uri></author><category term="ActiveX" scheme="http://blogs.msdn.com/ieinternals/archive/tags/ActiveX/default.aspx" /><category term="problems" scheme="http://blogs.msdn.com/ieinternals/archive/tags/problems/default.aspx" /><category term="dev" scheme="http://blogs.msdn.com/ieinternals/archive/tags/dev/default.aspx" /></entry><entry><title>Troubleshooting Authentication with Fiddler</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/ieinternals/archive/2009/11/22/Clipboard-Paste-Bug-in-Windows-7-Password-Prompt.aspx" /><id>http://blogs.msdn.com/ieinternals/archive/2009/11/22/Clipboard-Paste-Bug-in-Windows-7-Password-Prompt.aspx</id><published>2009-11-22T20:54:00Z</published><updated>2009-11-22T20:54:00Z</updated><content type="html">&lt;P&gt;Over the last few weeks, I’ve been exchanging mail with a webmaster (Vladimir)&amp;nbsp;in Russia who reported that his customers were having problems using IE8 on Windows 7 to log into his website. His site uses HTTP Basic Authentication, so users are prompted to enter their credentials using the following dialog:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;IMG alt="CredUI HTTP Authentication Prompt" src="http://www.enhanceie.com/images/blog/CredUIHTTPAuth.png" mce_src="http://www.enhanceie.com/images/blog/CredUIHTTPAuth.png"&gt; &lt;/BLOCKQUOTE&gt;
&lt;P&gt;I asked the webmaster to submit some HTTP Traffic Logs collected by the lightweight network traffic capture tool known as &lt;A href="http://www.fiddlercap.com/" mce_href="http://www.fiddlercap.com"&gt;FiddlerCap&lt;/A&gt;. He obliged, and I used Fiddler to take a look at the captured .SAZ traffic log.&lt;/P&gt;
&lt;P&gt;Fiddler includes an “Auth” Inspector that allows you to easily look at the HTTP Authentication credentials sent for a given request. I opened the .SAZ file captured with FiddlerCap. In the failing case, he had entered the username &lt;STRONG&gt;test&lt;/STRONG&gt; and the password &lt;STRONG&gt;ABCDEFG&lt;/STRONG&gt;. The Auth inspector, however, showed that the password wasn’t being sent:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;IMG alt="Fiddler Auth Inspector view of HTTP Authentication; password blank" src="http://www.enhanceie.com/images/blog/AuthNoPassword.png" mce_src="http://www.enhanceie.com/images/blog/AuthNoPassword.png"&gt; &lt;/BLOCKQUOTE&gt;
&lt;P&gt;As you can see, the base64-obfuscated string is quite short, and the decoded &lt;EM&gt;username:password&lt;/EM&gt; string contains only the username and the colon, but no password at all.&lt;/P&gt;
&lt;P&gt;Now, I didn’t have ready access to the customer’s test page, but wanted to try to reproduce the problem myself. I don't have a server that required Basic auth handy, but Fiddler makes it simple to simulate scenarios such as this. I simply used the AutoResponder tab to create a rule that responds to any request for a&amp;nbsp;URL that contains the string “AUTH” with a HTTP/401 response&amp;nbsp;that demands Basic authentication:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;IMG alt="Using Fiddler's AutoResponder to demand HTTP Authentication" src="http://www.enhanceie.com/images/blog/AutoResponderDemandAuth.png" mce_src="http://www.enhanceie.com/images/blog/AutoResponderDemandAuth.png"&gt; &lt;/BLOCKQUOTE&gt;
&lt;P&gt;Fiddler includes about a dozen sample responses like the 401_AuthBasic.dat, and you can easily use Fiddler to capture other responses, or even create your own using any text editor.&lt;/P&gt;
&lt;P&gt;With this AutoResponse rule in place, I can request any&amp;nbsp;invented URL containing the word&amp;nbsp;"auth" and get an authentication prompt in response. I tried &lt;U&gt;http://www.example.com/auth&lt;/U&gt; and received the expected authentication prompt. I typed in some credentials, submitted them, and took a look in the response inspector. I found that the credentials were submitted perfectly: &lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;IMG alt="Fiddler Auth Inspector view of HTTP Authentication" src="http://www.enhanceie.com/images/blog/AuthWithPassword.png" mce_src="http://www.enhanceie.com/images/blog/AuthWithPassword.png"&gt; &lt;/BLOCKQUOTE&gt;
&lt;P&gt;As you can see, the base64-obfuscated string is longer, and the decoded username:password string contains both the username and password, split by the colon. So, I wasn’t able to reproduce the behavior reported by the web developer, despite trying a number of different reproduction cases. However, he was fortunately quite persistent and did some additional research, determining that the problem only existed when the password was pasted from the clipboard. &lt;/P&gt;
&lt;P&gt;This was an interesting finding, and narrowed down the problem substantially. &lt;/P&gt;
&lt;P&gt;First, a bit of background. In Windows 7, WinINET was updated to call&amp;nbsp;the &lt;A href="http://msdn.microsoft.com/en-us/library/aa375178(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/aa375178(VS.85).aspx"&gt;CredUIPromptForWindowsCredentials&lt;/A&gt; function to collect HTTP Authentication credentials. The function shows a new CredUI dialog that offers an improved UI over the legacy password prompt, and its use is recommended for use on Windows Vista and later (although IE8 only uses it when running on Windows 7). &lt;/P&gt;
&lt;P&gt;Now, experienced developers in the audience know that any time anything is changed, there’s always a chance of regression, so, coupled with the fact that the problem was narrowed down to just the password-paste case, we had some leads. At first, I thought it likely that the problem was related to the Russian version of Windows 7, because I didn’t have any problems with pasting in the password with CTRL+V on the English OS. So, I asked Vladimir to collect screenshots of all of the different formats on his clipboard. This is easily done with a free little utility called &lt;A href="http://www.codeproject.com/KB/clipboard/clipspy.aspx" mce_href="http://www.codeproject.com/KB/clipboard/clipspy.aspx"&gt;ClipSpy&lt;/A&gt;. I suspected that perhaps there was a codepage-related problem where the password characters were perhaps being mangled because the system codepage was Cyrillic. However, the output of the ClipSpy tool didn’t reveal anything interesting; Vladimir's clipboard's bytes looked just like my&amp;nbsp;clipboard's. &lt;/P&gt;
&lt;P&gt;At this point, I was stumped. I wasn’t able to reproduce this problem in-house, and had tried on many different Windows 7 computers, using a variety of different sites and passwords. Then, Vladimir saved the day by forwarding along &lt;A href="http://www.broadbandreports.com/forum/r22863001-WIN7-logging-into-router-with-IE8" mce_href="http://www.broadbandreports.com/forum/r22863001-WIN7-logging-into-router-with-IE8"&gt;a posting on a message board&lt;/A&gt; where a customer complained of exactly the same problem. The response from “auggy” indicated that the user should try using CTRL+V to paste rather than using the context menu. &lt;/P&gt;
&lt;P&gt;I had &lt;EM&gt;always &lt;/EM&gt;been pasting with CTRL+V and had never tried using the context menu;&amp;nbsp;Vladimir's repro steps hadn't mentioned the context menu, and it didn't even occur to me that it could make a difference--&amp;nbsp;typically the context menu and CTRL+V behave identically.&lt;/P&gt;
&lt;P&gt;After playing with the context menu’s Paste option, I was very quickly able to reproduce the problem. It turns out that there is a tiny bug in the CredUI dialog on Windows 7.&amp;nbsp;If you use the CredUI dialog's&amp;nbsp;context menu to paste into the username or password dialog box without pressing any key in the box (e.g. tab, CTRL+V, CTRL+A, etc) then, while the text &lt;EM&gt;appears &lt;/EM&gt;to be updated, the internal data structures are not updated. The internal username or password data remains unchanged from its original value until a key is pressed. In the failing cases, the boxes started out empty, so when the user used the context&amp;nbsp;menu to paste into the password box, the password data was never updated away from the blank value.&lt;/P&gt;
&lt;P&gt;I’ve passed this bug along to the CredUI team for further investigation. I’d like to thank Vladimir for his patience as we hunted down the core problem and for his willingness to provide network captures and other information.&lt;/P&gt;
&lt;P&gt;Hopefully, this post has shown you a few ways that you can use Fiddler to find the root cause of problems (and eliminate confounding variables from the repro) and reiterates the value of providing painstaking detail when sharing bug repro steps.&lt;/P&gt;
&lt;P&gt;-Eric&lt;/P&gt;
&lt;P&gt;PS: My "Debugging with Fiddler" talk at the Microsoft PDC is &lt;A href="http://microsoftpdc.com/Sessions/CL25" mce_href="http://microsoftpdc.com/Sessions/CL25"&gt;now available for online viewing&lt;/A&gt;. &lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9926998" width="1" height="1"&gt;</content><author><name>EricLaw</name><uri>http://blogs.msdn.com/members/EricLaw.aspx</uri></author><category term="problems" scheme="http://blogs.msdn.com/ieinternals/archive/tags/problems/default.aspx" /><category term="Win7" scheme="http://blogs.msdn.com/ieinternals/archive/tags/Win7/default.aspx" /><category term="ie8" scheme="http://blogs.msdn.com/ieinternals/archive/tags/ie8/default.aspx" /><category term="bugs" scheme="http://blogs.msdn.com/ieinternals/archive/tags/bugs/default.aspx" /><category term="troubleshooting" scheme="http://blogs.msdn.com/ieinternals/archive/tags/troubleshooting/default.aspx" /></entry><entry><title>Inline AutoComplete</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/ieinternals/archive/2009/11/11/IE8-Removed-Inline-AutoComplete-for-the-Address-Bar.aspx" /><id>http://blogs.msdn.com/ieinternals/archive/2009/11/11/IE8-Removed-Inline-AutoComplete-for-the-Address-Bar.aspx</id><published>2009-11-11T08:30:00Z</published><updated>2009-11-11T08:30:00Z</updated><content type="html">&lt;P&gt;Internet Explorer 8 removed support for one of my&amp;nbsp;favorite browser features: Inline AutoComplete (IAC)&amp;nbsp;for the address bar. This feature was off-by-default, but&amp;nbsp;for almost a decade the first thing&amp;nbsp;I did when setting up a new computer was enable IAC using the checkbox Tools &amp;gt; Internet Options &amp;gt;&amp;nbsp;Advanced &amp;gt; Use&amp;nbsp;inline AutoComplete.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For IE8, we introduced a new &lt;A href="http://blogs.msdn.com/ie/archive/2009/06/12/ie8-smart-address-bar-what-s-new.aspx" mce_href="http://blogs.msdn.com/ie/archive/2009/06/12/ie8-smart-address-bar-what-s-new.aspx"&gt;Smart Address Bar&lt;/A&gt; which offers a bunch of &lt;A href="http://blogs.msdn.com/ie/archive/2008/09/12/the-ie8-smart-address-bar-part-ii-a-few-more-features.aspx" mce_href="http://blogs.msdn.com/ie/archive/2008/09/12/the-ie8-smart-address-bar-part-ii-a-few-more-features.aspx"&gt;improvements&lt;/A&gt;&amp;nbsp;including better and more relevant suggestions in the new flyout window.&amp;nbsp;The feature also includes&amp;nbsp;keyboard tips, which show how to take advantage of keyboard combos to open pages in new tabs,&amp;nbsp;background tabs, etc. Unfortunately, as a consequence of the rewrite, we lost the legacy AutoComplete behavior&amp;nbsp;&lt;A href="http://msdn.microsoft.com/en-us/library/bb759862%28VS.85%29.aspx" mce_href="http://msdn.microsoft.com/en-us/library/bb759862%28VS.85%29.aspx"&gt;provided by the Shell&lt;/A&gt;. The consensus was that, while IAC had some vocal proponents (myself especially), the fact that it was off-by-default and most users didn't have it enabled meant that it was a reasonable sacrifice&amp;nbsp;when compared to the benefits&amp;nbsp;brought by the new address bar. The most important improvement for keyboard lovers was&amp;nbsp;the SHIFT+Enter hotkey, which navigates to the "best match" in the results list; there have long been &lt;A href="http://blogs.msdn.com/oldnewthing/archive/2005/11/02/488163.aspx" mce_href="http://blogs.msdn.com/oldnewthing/archive/2005/11/02/488163.aspx"&gt;complaints and debates&lt;/A&gt; about whether the&amp;nbsp;default behavior of IAC was suboptimal. With the relevance engine added to IE8, we have good reason to believe that SHIFT+Enter is a great feature for most folks to more quickly get to the best result. &lt;/P&gt;
&lt;P&gt;Nevertheless,&amp;nbsp;I expected that we'd hear from vocal proponents of&amp;nbsp;IAC during the IE8 beta cycles. The initial &lt;A href="http://blogs.msdn.com/ie/archive/2008/03/11/address-bar-improvements-in-internet-explorer-8-beta-1.aspx" mce_href="http://blogs.msdn.com/ie/archive/2008/03/11/address-bar-improvements-in-internet-explorer-8-beta-1.aspx"&gt;blog post&lt;/A&gt; announcing the change had a few&amp;nbsp;heated comments, and one bug with a meager 16 votes was filed on &lt;A href="http://connect.microsoft.com/IE/feedback/ViewFeedback.aspx?FeedbackID=331695" mce_href="http://connect.microsoft.com/IE/feedback/ViewFeedback.aspx?FeedbackID=331695"&gt;Connect&lt;/A&gt;, but we didn't receive nearly the level of feedback I was expecting. After two betas and one release-candidate which were used by many millions of users, I could only count a handful of supporters for IAC. Since we shipped the final version of IE8, I've received&amp;nbsp;more mail asking why IAC was removed. The gist of much of&amp;nbsp;the feedback was "&lt;EM&gt;You already had the feature, it wouldn't have cost you anything to keep it.&lt;/EM&gt;" Unfortunately, that's simply not true-- IE8 is no longer using the standard controls that support AutoComplete, and even if was, the "free" AutoComplete behavior wouldn't work as expected with the matches in the Smart Address Bar's&amp;nbsp;dropdown.&lt;/P&gt;
&lt;P&gt;IE8 has been my default browser for quite a while now, and I've largely adjusted to the change.&amp;nbsp;Beyond&amp;nbsp;getting used to the SHIFT+Enter&amp;nbsp;shortcut, I also heavily use &lt;A href="http://www.bayden.com/slickrun/" mce_href="http://www.bayden.com/slickrun/"&gt;SlickRun&lt;/A&gt;, a&amp;nbsp;keyboard-lovers' utility I wrote a long time ago which makes heavy use of command aliasing and offers Inline AutoComplete.&lt;/P&gt;
&lt;P mce_keep="true"&gt;As we build future versions of IE, I encourage you to provide feedback early and often. We've already&amp;nbsp;received some great suggestions from the web developers out there, but we're very interested in UI&amp;nbsp;suggestions as well!&lt;/P&gt;
&lt;P mce_keep="true"&gt;thanks!&lt;/P&gt;
&lt;P&gt;-Eric&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9921113" width="1" height="1"&gt;</content><author><name>EricLaw</name><uri>http://blogs.msdn.com/members/EricLaw.aspx</uri></author><category term="Q&amp;amp;A" scheme="http://blogs.msdn.com/ieinternals/archive/tags/Q_2600_amp_3B00_A/default.aspx" /><category term="problems" scheme="http://blogs.msdn.com/ieinternals/archive/tags/problems/default.aspx" /></entry><entry><title>Security Intelligence Report Volume 7 Released</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/ieinternals/archive/2009/11/03/Real-Web-Security-Statistics.aspx" /><id>http://blogs.msdn.com/ieinternals/archive/2009/11/03/Real-Web-Security-Statistics.aspx</id><published>2009-11-03T00:19:00Z</published><updated>2009-11-03T00:19:00Z</updated><content type="html">&lt;P&gt;Security researchers at Microsoft release a biannual "Intelligence Report" containing statistics about the software-related security incidents over the past 6 months.&amp;nbsp;This report is called the &lt;A href="http://www.microsoft.com/security/portal/Threat/SIR.aspx" mce_href="http://www.microsoft.com/security/portal/Threat/SIR.aspx"&gt;SIR&lt;/A&gt;, and the latest version can be found &lt;A href="http://go.microsoft.com/?linkid=9693456" mce_href="http://go.microsoft.com/?linkid=9693456"&gt;here&lt;/A&gt;. There are many interesting charts and data points in the report, but I have&amp;nbsp;two favorites from the latest edition.&lt;/P&gt;
&lt;P&gt;As browser code quality improves, add-ons become a more appealing target:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;IMG alt="Most browser attacks are against 3rd party (addon) code" src="http://www.enhanceie.com/images/blog/SIR7-BrowserAttacks.png"&gt; &lt;/BLOCKQUOTE&gt;
&lt;P&gt;Here's a chart of the types of malicious downloads that SmartScreen has blocked over the last six months:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;IMG alt="SmartScreen blocks a wide range of malicious downloads" src="http://www.enhanceie.com/images/blog/SIR7-SmartScreenBlocks.png"&gt; &lt;/BLOCKQUOTE&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Microsoft remains committed to help protect you on the web--&amp;nbsp;IE8's SmartScreen&amp;nbsp;and &lt;A href="http://blogs.msdn.com/ieinternals/archive/2009/10/06/Free-antivirus-and-antimalware-scanner-from-Microsoft.aspx" mce_href="http://blogs.msdn.com/ieinternals/archive/2009/10/06/Free-antivirus-and-antimalware-scanner-from-Microsoft.aspx"&gt;Microsoft Security Essentials&lt;/A&gt; are making a significant impact against the bad guys.&lt;/P&gt;
&lt;P&gt;-Eric&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9916489" width="1" height="1"&gt;</content><author><name>EricLaw</name><uri>http://blogs.msdn.com/members/EricLaw.aspx</uri></author><category term="Security" scheme="http://blogs.msdn.com/ieinternals/archive/tags/Security/default.aspx" /><category term="phishing" scheme="http://blogs.msdn.com/ieinternals/archive/tags/phishing/default.aspx" /></entry><entry><title>Using Meddler to Simulate Web Traffic</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/ieinternals/archive/2009/10/13/Using-Meddler-to-Simulate-HTTP.aspx" /><id>http://blogs.msdn.com/ieinternals/archive/2009/10/13/Using-Meddler-to-Simulate-HTTP.aspx</id><published>2009-10-13T21:53:00Z</published><updated>2009-10-13T21:53:00Z</updated><content type="html">&lt;P&gt;As &lt;A href="http://blogs.msdn.com/ieinternals/archive/2009/07/27/Bugs-in-the-IE8-Lookahead-Downloader.aspx" mce_href="http://blogs.msdn.com/ieinternals/archive/2009/07/27/Bugs-in-the-IE8-Lookahead-Downloader.aspx"&gt;mentioned back in July&lt;/A&gt;, IE8’s new lookahead downloader has a number of bugs which cause it to issue incorrect speculative download requests.&lt;/P&gt;
&lt;P&gt;The “BASE Bug” caused the speculative downloader to only respect the &amp;lt;BASE&amp;gt; element for the &lt;EM&gt;first&lt;/EM&gt; speculatively downloaded script file. Subsequent relative SCRIPT SRCs would be combined without respecting the specified BASE, which resulted in spurious requests being sent to the server. Eventually, the main parser would catch up and request the proper URLs, but the spurious requests waste bandwidth and could cause problems for some servers.&lt;/P&gt;
&lt;P&gt;When first investigating the speculative downloader problems, I decided to use the &lt;A href="http://www.fiddler2.com/Meddler/" mce_href="http://www.fiddler2.com/Meddler/"&gt;Meddler HTTP Traffic Generation&lt;/A&gt; tool to build some test cases. Meddler is a simple little tool that allows you to write JavaScript.NET scripts to emulate a web server. Meddler allows for precisely timed delivery of responses, and includes classes to enable basic fuzzing scenarios. The best part of Meddler is that you can use a single MeddlerScript (.ms) file to contain an entire test case, even if that test case is made up of multiple pages, images, scripts, and other resources. These .ms files can be shared with others, run across multiple operating systems, and attached to bugs or test harnesses for future regression testing. The test machine only requires the .NET Framework and Meddler installed, and does not need IIS, Apache, Perl, ASP.NET, etc.&lt;/P&gt;
&lt;P&gt;Because the base issue was so simple, I was able to quickly build a simple MeddlerScript which demonstrates the BASE Bug. If you’d like, you can follow along using my MeddlerScript: &lt;A href="http://www.enhanceie.com/meddler/scripts/PreParserBaseBug.ms" mce_href="http://www.enhanceie.com/meddler/scripts/PreParserBaseBug.ms"&gt;PreParserBaseBug.ms&lt;/A&gt;. &lt;/P&gt;
&lt;P&gt;The test script generates the following sample HTML:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;&amp;lt;base href="&lt;/FONT&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;http://ipv4.fiddler:8088/pass/"&lt;/FONT&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;&amp;gt;&amp;lt;/base&amp;gt; &lt;BR&gt;&amp;lt;script type="text/javascript" src="inc/1.js"&amp;gt;&amp;lt;/script&amp;gt; &lt;BR&gt;&amp;lt;script type="text/javascript" src="inc/2.js"&amp;gt;&amp;lt;/script&amp;gt; &lt;BR&gt;&amp;lt;script type="text/javascript" src="inc/3.js"&amp;gt;&amp;lt;/script&amp;gt; &lt;BR&gt;&amp;lt;script type="text/javascript" src="inc/4.js"&amp;gt;&amp;lt;/script&amp;gt; &lt;BR&gt;&amp;lt;script type="text/javascript" src="inc/5.js"&amp;gt;&amp;lt;/script&amp;gt; &lt;BR&gt;&amp;lt;script type="text/javascript" src="inc/6.js"&amp;gt;&amp;lt;/script&amp;gt; &lt;BR&gt;&amp;lt;script type="text/javascript" src="inc/7.js"&amp;gt;&amp;lt;/script&amp;gt; &lt;BR&gt;&amp;lt;script type="text/javascript" src="inc/8.js"&amp;gt;&amp;lt;/script&amp;gt; &lt;BR&gt;&amp;lt;script type="text/javascript" src="inc/9.js"&amp;gt;&amp;lt;/script&amp;gt; &lt;BR&gt;&amp;lt;/head&amp;gt; &lt;BR&gt;&amp;lt;body&amp;gt; Test page.&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Note that I plan to watch the network traffic with &lt;A href="http://www.fiddler2.com/" mce_href="http://www.fiddler2.com/"&gt;Fiddler&lt;/A&gt;, and because &lt;A href="http://www.fiddler2.com/Fiddler/help/hookup.asp#Q-LocalTraffic" mce_href="http://www.fiddler2.com/Fiddler/help/hookup.asp#Q-LocalTraffic"&gt;traffic sent to localhost isn’t proxied&lt;/A&gt;, I will use “ipv4.fiddler” as an alias to 127.0.0.1. &lt;/P&gt;
&lt;P&gt;When visiting the Meddler test page, the traffic from IE is as follows:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;IMG alt="Screenshot of original incorrect network traffic" src="http://www.enhanceie.com/images/blog/Preparser-Fails-To-Respect-Base.png" mce_src="http://www.enhanceie.com/images/blog/Preparser-Fails-To-Respect-Base.png"&gt; &lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;As you can see, there are spurious download requests containing the wrong path; these are shown in red as the MeddlerScript is designed to return failure for such requests. Later, the correct URLs are downloaded as the main parser encounters the script tags and correctly combines the URLs.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/ie/archive/2009/10/13/ie-october-2009-security-update-now-available.aspx" mce_href="http://blogs.msdn.com/ie/archive/2009/10/13/ie-october-2009-security-update-now-available.aspx"&gt;Today's IE8 Cumulative Update&lt;/A&gt; (&lt;A href="http://www.microsoft.com/downloads/en/results.aspx?pocId=&amp;amp;freetext=KB974455&amp;amp;DisplayLang=en" mce_href="http://www.microsoft.com/downloads/en/results.aspx?pocId=&amp;amp;freetext=KB974455&amp;amp;DisplayLang=en"&gt;KB974455&lt;/A&gt;) fixes the BASE Bug. After installing the update, loading the sample HTML results in no spurious requests-- each script URL is correctly relative to the specified BASE. &lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;IMG alt="Screenshot of corrected network traffic" src="http://www.enhanceie.com/images/blog/Preparser-Fixed-To-Respect-Base.png" mce_src="http://www.enhanceie.com/images/blog/Preparser-Fixed-To-Respect-Base.png"&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Please note that while the BASE bug is fixed, the “4k Bug” is not fixed by this update. If you want to view that bug in action, try this script: &lt;A href="http://www.enhanceie.com/meddler/scripts/PreParser4kBug.ms" mce_href="http://www.enhanceie.com/meddler/scripts/PreParser4kBug.ms"&gt;PreParser4kBug.ms&lt;/A&gt;. As it is a timing issue, you may need to reload the “hammer” page a few times to encounter the problem.&lt;/P&gt;
&lt;P&gt;While Meddler is rather simplistic, it can be very useful for sharing test cases and simulating the behavior of web servers. You can use Meddler to build reduced test cases that reliably generate problematic HTTP responses.&lt;/P&gt;
&lt;P&gt;Until next time, &lt;/P&gt;
&lt;P&gt;-Eric &lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9906859" width="1" height="1"&gt;</content><author><name>EricLaw</name><uri>http://blogs.msdn.com/members/EricLaw.aspx</uri></author><category term="http" scheme="http://blogs.msdn.com/ieinternals/archive/tags/http/default.aspx" /><category term="fixes" scheme="http://blogs.msdn.com/ieinternals/archive/tags/fixes/default.aspx" /><category term="problems" scheme="http://blogs.msdn.com/ieinternals/archive/tags/problems/default.aspx" /><category term="networking" scheme="http://blogs.msdn.com/ieinternals/archive/tags/networking/default.aspx" /><category term="parser" scheme="http://blogs.msdn.com/ieinternals/archive/tags/parser/default.aspx" /><category term="tools" scheme="http://blogs.msdn.com/ieinternals/archive/tags/tools/default.aspx" /><category term="troubleshooting" scheme="http://blogs.msdn.com/ieinternals/archive/tags/troubleshooting/default.aspx" /></entry><entry><title>Capturing Crash Dumps for Analysis</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/ieinternals/archive/2009/10/12/Collecting-Internet-Explorer-Crash-Dumps.aspx" /><id>http://blogs.msdn.com/ieinternals/archive/2009/10/12/Collecting-Internet-Explorer-Crash-Dumps.aspx</id><published>2009-10-12T11:01:00Z</published><updated>2009-10-12T11:01:00Z</updated><content type="html">&lt;P&gt;Sometimes, folks report crashes to the IE team that we are unable to reproduce internally. That’s usually because, as mentioned often, most crashes are caused by buggy browser add-ons.&lt;/P&gt;
&lt;P&gt;In some cases, however, crashes occur even when running with &lt;A href="http://www.enhanceie.com/ie/troubleshoot.asp#crash" mce_href="http://www.enhanceie.com/ie/troubleshoot.asp#crash"&gt;browser add-ons off&lt;/A&gt;, and if we cannot reproduce the problem, the next best thing is a crash dump file from the affected machine.&lt;/P&gt;
&lt;P&gt;Collecting crash dumps isn’t hard:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Install WinDBG from &lt;A href="http://www.microsoft.com/whdc/devtools/debugging/installx86.mspx#ERB" mce_href="http://www.microsoft.com/whdc/devtools/debugging/installx86.mspx#ERB"&gt;http://www.microsoft.com/whdc/devtools/debugging/installx86.mspx#ERB&lt;/A&gt; &lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;Configure WinDBG to run whenever a crash occurs: In an elevated command prompt, run WinDBG with the -I (case-sensitive) parameter.&amp;nbsp; For instance:&amp;nbsp; &lt;BR&gt;&lt;BR&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;C:\debuggers\windbg.exe –I &lt;BR&gt;&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;When the crash occurs, WinDBG opens.&amp;nbsp; Type the following command to generate a .DMP file: &lt;BR&gt;&lt;BR&gt;&lt;FONT color=#008000 size=2 face="Courier New"&gt;dump /ma %USERPROFILE%\Desktop\IECrash.dmp&lt;/FONT&gt; &lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;Dump files tend to be dozens to hundreds of megabytes in size, so they typically cannot be readily passed around via email (although they often compress well). If a DMP file is requested, the person asking for the file will typically tell you how to return the file to them.&lt;/P&gt;
&lt;P&gt;Depending on the problem reported, we may also want to get a &lt;A href="http://www.fiddlercap.com/" mce_href="http://www.fiddlercap.com"&gt;network traffic log&lt;/A&gt; or a &lt;A href="http://blogs.msdn.com/ieinternals/archive/2009/07/20/IE8-Performance-and-Speed-Tips.aspx" mce_href="http://blogs.msdn.com/ieinternals/archive/2009/07/20/IE8-Performance-and-Speed-Tips.aspx"&gt;Process Monitor log&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;-Eric&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9905905" width="1" height="1"&gt;</content><author><name>EricLaw</name><uri>http://blogs.msdn.com/members/EricLaw.aspx</uri></author><category term="problems" scheme="http://blogs.msdn.com/ieinternals/archive/tags/problems/default.aspx" /><category term="dev" scheme="http://blogs.msdn.com/ieinternals/archive/tags/dev/default.aspx" /><category term="tools" scheme="http://blogs.msdn.com/ieinternals/archive/tags/tools/default.aspx" /><category term="troubleshooting" scheme="http://blogs.msdn.com/ieinternals/archive/tags/troubleshooting/default.aspx" /></entry><entry><title>Understanding DEP/NX</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/ieinternals/archive/2009/10/10/Understanding-Data-Execution-Prevention-Crashes-in-IE8.aspx" /><id>http://blogs.msdn.com/ieinternals/archive/2009/10/10/Understanding-Data-Execution-Prevention-Crashes-in-IE8.aspx</id><published>2009-10-10T18:51:00Z</published><updated>2009-10-10T18:51:00Z</updated><content type="html">&lt;H3&gt;&lt;/H3&gt;
&lt;P&gt;Despite being one&amp;nbsp;of the crucial security features of modern browsers, Data Execution Prevention / No Execute (DEP/NX) is not well understood by most users, even technical experts&amp;nbsp;without a&amp;nbsp;security background. &lt;/P&gt;
&lt;P&gt;In this post, I’ll try to provide some insight into how DEP/NX works, explain why you might encounter a DEP/NX crash, and convince you that turning off DEP/NX is almost never the right decision.&lt;/P&gt;
&lt;P&gt;More than anything else, I hope you take away two important facts from reading this post:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;In many cases where you encounter a DEP/NX crash, the browser would have crashed anyway.&lt;/LI&gt;
&lt;LI&gt;The vast majority of DEP/NX crashes are caused by browser add-ons. If you run IE in &lt;A href="http://www.enhanceie.com/ie/troubleshoot.asp#crash" mce_href="http://www.enhanceie.com/ie/troubleshoot.asp#crash"&gt;No Add-ons Mode&lt;/A&gt;, it’s very unlikely that you will encounter a DEP/NX crash. &lt;/LI&gt;&lt;/UL&gt;
&lt;H2&gt;Background&lt;/H2&gt;
&lt;P&gt;I’ll begin by providing some background information on DEP/NX and how the browser makes use of it.&lt;/P&gt;
&lt;H3&gt;What is DEP/NX?&lt;/H3&gt;
&lt;P&gt;DEP/NX is a feature of modern CPUs that allows marking of memory pages as Executable or non-Executable. This allows the CPU to help prevent execution of malicious data placed into memory by an attacker. If the CPU detects that it is about to jump to (begin execution of) data which is in a memory page which is not marked as Executable, the CPU will &lt;A href="http://support.microsoft.com/kb/875352" mce_href="http://support.microsoft.com/kb/875352"&gt;raise an exception&lt;/A&gt; which results in termination of the process. &lt;/P&gt;
&lt;P&gt;Stated another way, if DEP/NX determines that if a potentially dangerous jump is about to be made, the process is intentionally “safely crashed” to prevent a potential security exploit.&lt;/P&gt;
&lt;H3&gt;Checking Your Protection&lt;/H3&gt;
&lt;P&gt;You can see which processes are protected by DEP/NX using Task Manager’s Process tab. On Windows XP, you need to use &lt;A href="http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx" mce_href="http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx"&gt;Process Explorer&lt;/A&gt; instead. In either case, ensure that the “Data Execution Prevention box” is checked in the View &amp;gt; Select Columns menu, and a column in the process list will show the DEP/NX protection status.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;IMG alt="Process Explorer showing DEP Permanent for iexplore.exe" src="http://www.enhanceie.com/images/blog/DEP-Enabled.png" mce_src="http://www.enhanceie.com/images/blog/DEP-Enabled.png"&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;As &lt;A href="http://blogs.msdn.com/ie/archive/2008/04/08/ie8-security-part-I_3A00_-dep-nx-memory-protection.aspx" mce_href="http://blogs.msdn.com/ie/archive/2008/04/08/ie8-security-part-I_3A00_-dep-nx-memory-protection.aspx"&gt;mentioned last year&lt;/A&gt;, Internet Explorer 8 enables DEP/NX protection by default. In IE7 and earlier, DEP/NX was disabled by default due to compatibility concerns that were resolved in IE8.&lt;/P&gt;
&lt;H3&gt;Opting-in to DEP/NX &lt;/H3&gt;
&lt;P&gt;Internet Explorer 8 uses the &lt;A href="http://msdn.microsoft.com/en-us/library/bb736299(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/bb736299(VS.85).aspx"&gt;SetProcessDEPPolicy()&lt;/A&gt; API to enable DEP/NX. This provides the following benefits versus using the &lt;A href="http://msdn.microsoft.com/en-us/library/ms235442(VS.80).aspx" mce_href="http://msdn.microsoft.com/en-us/library/ms235442(VS.80).aspx"&gt;/NXCOMPAT linker flag&lt;/A&gt;:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;It allows us to offer an Internet Control Panel checkbox and Group Policy option to disable DEP/NX if desired. &lt;/LI&gt;
&lt;LI&gt;It enables DEP/NX on Windows XP SP3. The Windows XP loader does not check the &lt;STRONG&gt;NX Compatible&lt;/STRONG&gt; bit. &lt;/LI&gt;
&lt;LI&gt;It ensures that ATL_THUNK_EMULATION, an important compatibility feature, works properly. &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;EM&gt;Note: New applications without 3rd-party code compatibility concerns, targeted for use on Vista and later, should simply use the /NXCOMPAT linker flag.&lt;/EM&gt;&lt;/P&gt;
&lt;H3&gt;Recognizing a DEP/NX Crash in Internet Explorer&lt;/H3&gt;
&lt;P&gt;When Internet Explorer 8 recovers from a DEP/NX-induced crash, it will not automatically recover the current tabs. This is a security measure designed to help prevent a malicious site from having multiple attempts to exploit a vulnerability. Instead of reloading the tabs, the browser will show the following error page:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;IMG alt="Error page for DEP/NX Crash Recovery" src="http://www.enhanceie.com/images/blog/DEP-CrashPage.png" mce_src="http://www.enhanceie.com/images/blog/DEP-CrashPage.png"&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Unfortunately, the nature of DEP/NX crashes makes it infeasible for the browser to “pin the blame” on the specific add-on that is responsible for the problem. &lt;/P&gt;
&lt;H2&gt;Why do DEP/NX Crashes Occur in the Real World?&lt;/H2&gt;
&lt;P&gt;Now, let’s take a look at why users encounter DEP/NX crashes in the real-world.&lt;/P&gt;
&lt;P&gt;When the CPU is about to jump to a non-Executable memory page, there are three possible types of data in that page: malicious code, non-malicious code, and garbage data. I’ll discuss each of these in the following sections.&lt;/P&gt;
&lt;H3&gt;Jump Target: Malicious code&lt;/H3&gt;
&lt;P&gt;This is the scenario where DEP/NX shines. In this scenario, an attacker has put malicious data in memory that will be executed as x86 instructions if he can get the CPU to jump to it. The attacker then exploits some vulnerability to induce the CPU to jump to his data, typically using a memory-related vulnerability in an add-on or the browser itself.&lt;/P&gt;
&lt;P&gt;In this scenario, the CPU notes that the attacker’s code is not in an executable memory page and prevents the interpretation of the attacker-supplied data as instructions. The attack is foiled and the user’s machine is protected. If not for DEP/NX, the attacker would have been able to execute his instructions and potentially infect the user’s machine with malware, steal their data, or achieve some other nefarious goal.&lt;/P&gt;
&lt;P&gt;Now, the obvious next question is: &lt;EM&gt;What if the attacker can somehow get his data marked as executable?&lt;/EM&gt; &lt;/P&gt;
&lt;P&gt;The answer is that doing so is intentionally difficult. &lt;A href="http://blogs.msdn.com/ieinternals/archive/2009/10/09/DotNet-UserControls-Do-Not-Load-in-IE8-Internet-Zone.aspx" mce_href="http://blogs.msdn.com/ieinternals/archive/2009/10/09/DotNet-UserControls-Do-Not-Load-in-IE8-Internet-Zone.aspx"&gt;IE8 blocks the best known trick&lt;/A&gt; used to get the attacker’s data in an executable page. That means that the attacker must find some other way to get the memory page containing his instructions marked as executable. &lt;/P&gt;
&lt;P&gt;The obvious choice would be for the attacker to call &lt;A href="http://msdn.microsoft.com/en-us/library/aa366898(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/aa366898(VS.85).aspx"&gt;VirtualProtect()&lt;/A&gt; directly, passing &lt;A href="http://msdn.microsoft.com/en-us/library/aa366786(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/aa366786(VS.85).aspx"&gt;PAGE_EXECUTE_READ&lt;/A&gt; as the flNewProtect flag. However, thanks to &lt;A href="http://blogs.msdn.com/michael_howard/archive/2006/05/26/address-space-layout-randomization-in-windows-vista.aspx" mce_href="http://blogs.msdn.com/michael_howard/archive/2006/05/26/address-space-layout-randomization-in-windows-vista.aspx"&gt;Address Space Layout Randomization (ASLR)&lt;/A&gt; it is difficult for the attacker to guess where the VirtualProtect function is in memory. If he guesses wrong (and he almost always will), the process will crash and not execute his attack instructions.&lt;/P&gt;
&lt;H3&gt;Jump Target: Non-malicious code&lt;/H3&gt;
&lt;P&gt;In this scenario, a browser add-on is designed in such a way that it &lt;EM&gt;expects &lt;/EM&gt;to be able to execute data from memory pages which are not marked as executable, or otherwise makes a bad assumption. &lt;/P&gt;
&lt;P&gt;There are a number of possible cases where this may happen.&lt;/P&gt;&lt;EM&gt;&lt;/EM&gt;
&lt;H4&gt;&lt;/H4&gt;
&lt;P&gt;&lt;EM&gt;Case #1: Code Generation&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;In the first case, the add-on (or the technology it is built upon) depends on the ability to execute dynamically generated instructions at runtime. Examples of this are the Java Virtual Machine (JVM) and the Active Template Library (&lt;A href="http://msdn2.microsoft.com/en-us/library/t9adwcde(VS.80).aspx" mce_href="http://msdn2.microsoft.com/en-us/library/t9adwcde(VS.80).aspx"&gt;ATL&lt;/A&gt;). These frameworks generate (“JIT compile”)&amp;nbsp;executable code at runtime and jump to it. Older versions of these frameworks did not mark the memory pages containing the generated code as executable and would hence crash when DEP/NX was enabled. The Java team fixed this problem in the JVM years ago, and the ATL team also fixed this problem several versions ago. &lt;/P&gt;
&lt;P&gt;Because ATL is so commonly used to build Internet Explorer add-ons, additional work was done to allow Windows to “emulate” the ATL Thunk code which violated DEP/NX, so that even if an add-on was compiled against an ancient version of ATL, ATL Thunk Emulation will ensure that the code runs properly inside Internet Explorer with DEP/NX enabled.&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Case #2: Code Rewriting&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;In another common case, the add-on depends on “thunking” or modifying an existing Internet Explorer API or Windows function at runtime by rewriting the instructions in the existing function’s memory page. In order to accomplish this, the add-on uses VirtualProtect() to change the memory protection of the target page to allow Write and then update the memory with new instructions that point to some code that the add-on would like to have run inside the target function. &lt;/P&gt;
&lt;P&gt;If the add-on fails to subsequently call VirtualProtect() to revert the memory protection back to allow Execute, the process will crash with a DEP/NX violation the next time that function is called. &lt;/P&gt;
&lt;P&gt;More commonly, the add-on &lt;EM&gt;will&lt;/EM&gt; later&amp;nbsp;change the memory protection back to allow Execute, but the developer ignores the fact that it’s entirely unsafe to perform modification of shared code while any&amp;nbsp;other threads are executing.&amp;nbsp;While an add-on thread is modifying the code in a memory page, if &lt;EM&gt;any&lt;/EM&gt; thread attempts to call any function in the same memory page, the process will crash. Internet Explorer makes extensive use of threads, so such crashes are likely if an add-on uses thunking.&lt;/P&gt;
&lt;P&gt;Because timing is a critical factor here, the add-on may seem to “work fine” on one machine (e.g. a slower single-core machine) and always crash on another (e.g. a fast multi-core machine). This problem is just one of the major reasons why function thunking by Add-ons is not supported and is strongly discouraged. &lt;/P&gt;
&lt;H3&gt;Jump Target: Garbage data&lt;/H3&gt;
&lt;P&gt;In this scenario, inadvertent memory corruption has occurred such that the CPU is about to jump to arbitrary data somewhere in memory. This scenario is probably the most common source of DEP/NX crashes, particularly when the crash occurs at a seemingly random time, or when a browser tab is closed.&lt;/P&gt;
&lt;P&gt;This arbitrary data isn't usually chosen by an&amp;nbsp;attacker, and usually doesn’t even represent sensible x86 instructions. For instance, the jump may be to an address near 0x000000 where no code is loaded (&lt;EM&gt;near-null jump)&lt;/EM&gt;, if a virtual function was called off an object pointer which has been nulled. Or, the jump may be to some other address where code used to exist (&lt;EM&gt;stale pointer)&lt;/EM&gt; but that memory was later freed and potentially reused for another purpose.&lt;/P&gt;
&lt;P&gt;In this “garbage data” scenario, the process will almost always crash, even if DEP/NX were not enabled. That’s because the CPU is very unlikely to reliably execute arbitrary data as sensible x86 instructions. Most likely, the process will crash within a microsecond with an exception like “Access Violation”, “Invalid Instruction”,&amp;nbsp; “Divide by 0” or similar.&lt;/P&gt;
&lt;P&gt;Attackers look for this type of memory corruption to use as an entry point in their attacks; they may, for instance, “&lt;A href="http://en.wikipedia.org/wiki/Heap_spraying" mce_href="http://en.wikipedia.org/wiki/Heap_spraying"&gt;spray the heap&lt;/A&gt;” with many copies of their malicious data, then trigger the memory corruption vulnerability with the hope that the CPU will jump into a copy of their malicious code.&lt;/P&gt;
&lt;H2&gt;Resolving DEP/NX Problems&lt;/H2&gt;
&lt;P&gt;Your best bet to resolve DEP/NX problems in Internet Explorer is to first confirm that the problem is caused by a buggy browser add-on. You can do this by running IE in &lt;A href="http://www.enhanceie.com/ie/troubleshoot.asp#crash" mce_href="http://www.enhanceie.com/ie/troubleshoot.asp#crash"&gt;No Add-ons Mode&lt;/A&gt;. After confirming that the problem is related to an add-on, you should use the browser’s Manage Add-Ons feature to disable unwanted add-ons and find updated versions of any add-ons that you wish to keep.&lt;/P&gt;
&lt;P&gt;If you find that you’re encountering DEP/NX crashes in multiple software applications, it’s possible that you have malicious or buggy system software installed (e.g. malware or a buggy anti-virus product). You should &lt;A href="http://www.enhanceie.com/ie/troubleshoot.asp#malware" mce_href="http://www.enhanceie.com/ie/troubleshoot.asp#malware"&gt;check your system for malware&lt;/A&gt; and ensure that you install the latest updates for your system software.&lt;/P&gt;
&lt;P&gt;Frequent DEP/NX crashes also suggest that your computer might have a hardware problem (e.g. bad system memory). To help rule out hardware failure, you can use &lt;A href="http://oca.microsoft.com/en/windiag.asp" mce_href="http://oca.microsoft.com/en/windiag.asp"&gt;the Windows Memory Diagnostic&lt;/A&gt;.&lt;/P&gt;
&lt;H2&gt;Conclusion&lt;/H2&gt;
&lt;P&gt;DEP/NX provides an important defense against malicious websites that may try to exploit vulnerabilities in your add-ons or web browser. By ensuring that you are running the latest version of add-ons and system software, you can improve your security and minimize the incidence of DEP/NX crashes. If you're currently using an older version (6 or 7)&amp;nbsp;of Internet Explorer that does not have DEP/NX protections enabled by default, you should upgrade to IE8 as soon as possible.&lt;/P&gt;
&lt;P&gt;Thanks for reading!&lt;/P&gt;
&lt;P&gt;-Eric&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9905773" width="1" height="1"&gt;</content><author><name>EricLaw</name><uri>http://blogs.msdn.com/members/EricLaw.aspx</uri></author><category term="ActiveX" scheme="http://blogs.msdn.com/ieinternals/archive/tags/ActiveX/default.aspx" /><category term="Security" scheme="http://blogs.msdn.com/ieinternals/archive/tags/Security/default.aspx" /><category term="Best-Practices" scheme="http://blogs.msdn.com/ieinternals/archive/tags/Best-Practices/default.aspx" /><category term="problems" scheme="http://blogs.msdn.com/ieinternals/archive/tags/problems/default.aspx" /><category term="dev" scheme="http://blogs.msdn.com/ieinternals/archive/tags/dev/default.aspx" /><category term="add-ons" scheme="http://blogs.msdn.com/ieinternals/archive/tags/add-ons/default.aspx" /><category term="ie8" scheme="http://blogs.msdn.com/ieinternals/archive/tags/ie8/default.aspx" /></entry><entry><title>DotNet UserControls Restricted in IE8</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/ieinternals/archive/2009/10/09/DotNet-UserControls-Do-Not-Load-in-IE8-Internet-Zone.aspx" /><id>http://blogs.msdn.com/ieinternals/archive/2009/10/09/DotNet-UserControls-Do-Not-Load-in-IE8-Internet-Zone.aspx</id><published>2009-10-09T05:17:00Z</published><updated>2009-10-09T05:17:00Z</updated><content type="html">&lt;P&gt;In the past, Internet Explorer supported a really easy way to host &lt;A href="http://msdn.microsoft.com/en-us/magazine/cc301932.aspx" mce_href="http://msdn.microsoft.com/en-us/magazine/cc301932.aspx"&gt;.NET UserControls&lt;/A&gt; in HTML. These controls worked much like ActiveX controls, but because they ran with limited permissions, sandboxed by the .NET Framework, they would download and run without security prompts.&lt;/P&gt;
&lt;P&gt;It was a very cool technology, but didn’t see much use in the real-world, partly because the .NET Framework wasn’t broadly deployed when the feature was introduced. Later, ClickOnce, WPF, and other technologies took center stage, leaving this relic around, mostly unused beyond&amp;nbsp;developer demonstration pages and tutorials.&lt;/P&gt;
&lt;P&gt;Until the summer of 2008, that is. At BlackHat 2008, security researchers &lt;A href="http://taossa.com/archive/bh08sotirovdowd.pdf" mce_href="http://taossa.com/archive/bh08sotirovdowd.pdf"&gt;Dowd and Sotirov&lt;/A&gt; revealed that the loader for UserControls enabled bypass of &lt;A href="http://blogs.msdn.com/ie/archive/2008/04/08/ie8-security-part-I_3A00_-dep-nx-memory-protection.aspx" mce_href="http://blogs.msdn.com/ie/archive/2008/04/08/ie8-security-part-I_3A00_-dep-nx-memory-protection.aspx"&gt;memory-protection&lt;/A&gt; mechanisms, meaning that browser vulnerabilities could be exploited with improved reliability.&lt;/P&gt;
&lt;P&gt;While Protected Mode and other features are useful to constrain the impact of vulnerabilities, DEP/NX and ASLR memory protection are a very important part of the overall mitigation strategy. After investigating the options, crawling the web to examine use “in the wild,” and consulting with the .NET team, we elected to disable UserControls in the Internet Zone by default for IE8.&lt;/P&gt;
&lt;P&gt;Now, since the UserControls feature was first introduced, IE’s security settings allowed disabling ".NET Framework-reliant components," but the existing settings were overly broad. They controlled not only UserControls, but also out-of-process features like &lt;A href="http://msdn.microsoft.com/en-us/library/t71a733d(VS.80).aspx" mce_href="http://msdn.microsoft.com/en-us/library/t71a733d(VS.80).aspx"&gt;ClickOnce&lt;/A&gt;. Because out-of-process use of .NET is not a vector for memory-protection-bypass in the browser, we chose to create a new URLAction that would restrict only use of UserControls.&lt;/P&gt;
&lt;P&gt;IE8 introduced the &lt;A href="http://msdn.microsoft.com/en-us/library/ms537178(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/ms537178(VS.85).aspx"&gt;URLACTION_DOTNET_USERCONTROLS&lt;/A&gt; setting, which allows .NET UserControls to load only from Intranet and Trusted pages by default. On Internet pages, the controls are blocked as if they had failed to download. This setting is not exposed in the Internet Options dialog or in the Group Policy editor; it can only be controlled via the registry keys. &lt;/P&gt;
&lt;P&gt;Reducing attack surface by removing an extensibility feature was painful decision, but ultimately a good one. Not long&amp;nbsp;after we made this change, the new URLAction would cleanly &lt;A href="http://blogs.technet.com/srd/archive/2009/03/23/released-build-of-internet-explorer-8-blocks-dowd-sotirov-aslr-dep-net-bypass.aspx" mce_href="http://blogs.technet.com/srd/archive/2009/03/23/released-build-of-internet-explorer-8-blocks-dowd-sotirov-aslr-dep-net-bypass.aspx"&gt;block exploitation&lt;/A&gt; of a browser vulnerability that was unveiled at the CanSecWest security conference.&lt;/P&gt;
&lt;P&gt;IE8 includes a number of important security features and defense-in-depth changes that raise the bar against the bad guys. If you haven’t upgraded yet, you should do so today!&lt;/P&gt;
&lt;P&gt;thanks,&lt;/P&gt;
&lt;P&gt;-Eric&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9905231" width="1" height="1"&gt;</content><author><name>EricLaw</name><uri>http://blogs.msdn.com/members/EricLaw.aspx</uri></author><category term="Security" scheme="http://blogs.msdn.com/ieinternals/archive/tags/Security/default.aspx" /></entry><entry><title>The User-Agent String: Use and Abuse</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/ieinternals/archive/2009/10/08/Extending-the-User-Agent-String-Problems-and-Alternatives.aspx" /><id>http://blogs.msdn.com/ieinternals/archive/2009/10/08/Extending-the-User-Agent-String-Problems-and-Alternatives.aspx</id><published>2009-10-08T05:19:00Z</published><updated>2009-10-08T05:19:00Z</updated><content type="html">&lt;P&gt;When I first joined the IE team five years ago, I became responsible for the User-Agent string. While I’ve owned significantly more “important” features over the years, on a byte-for-byte basis, few have proved as complicated as the “simple” UA string. &lt;/P&gt;
&lt;P&gt;I (&lt;A href="http://blogs.msdn.com/ie/archive/2008/02/27/the-rss-platform-ie8-user-agent-string.aspx" mce_href="http://blogs.msdn.com/ie/archive/2008/02/27/the-rss-platform-ie8-user-agent-string.aspx"&gt;and&lt;/A&gt; &lt;A href="http://blogs.msdn.com/ie/archive/2004/09/02/224902.aspx" mce_href="http://blogs.msdn.com/ie/archive/2004/09/02/224902.aspx"&gt;others&lt;/A&gt;) have written a &lt;A href="http://blogs.msdn.com/ie/archive/2008/02/21/the-internet-explorer-8-user-agent-string.aspx" mce_href="http://blogs.msdn.com/ie/archive/2008/02/21/the-internet-explorer-8-user-agent-string.aspx"&gt;lot&lt;/A&gt; &lt;A href="http://blogs.msdn.com/ie/archive/2005/04/27/412813.aspx" mce_href="http://blogs.msdn.com/ie/archive/2005/04/27/412813.aspx"&gt;about&lt;/A&gt; &lt;A href="http://blogs.msdn.com/ie/archive/2005/09/01/459541.aspx" mce_href="http://blogs.msdn.com/ie/archive/2005/09/01/459541.aspx"&gt;the&lt;/A&gt; &lt;A href="http://blogs.msdn.com/ie/archive/2006/02/03/524256.aspx" mce_href="http://blogs.msdn.com/ie/archive/2006/02/03/524256.aspx"&gt;UA&lt;/A&gt; &lt;A href="http://blogs.msdn.com/ie/archive/2006/09/20/763891.aspx" mce_href="http://blogs.msdn.com/ie/archive/2006/09/20/763891.aspx"&gt;string&lt;/A&gt; &lt;A href="http://blogs.msdn.com/ie/archive/2005/03/12/394526.aspx" mce_href="http://blogs.msdn.com/ie/archive/2005/03/12/394526.aspx"&gt;over&lt;/A&gt; &lt;A href="http://blogs.msdn.com/ie/archive/2009/01/09/the-internet-explorer-8-user-agent-string-updated-edition.aspx" mce_href="http://blogs.msdn.com/ie/archive/2009/01/09/the-internet-explorer-8-user-agent-string-updated-edition.aspx"&gt;the&lt;/A&gt; &lt;A href="http://blogs.msdn.com/ie/archive/2008/08/27/introducing-compatibility-view.aspx" mce_href="http://blogs.msdn.com/ie/archive/2008/08/27/introducing-compatibility-view.aspx"&gt;years&lt;/A&gt;. This post largely assumes that you’re familiar with what the user-agent string is and what it’s commonly (mis)used for.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;In this post, I’ll try to summarize why the UA string causes so many problems (beyond &lt;A href="http://my.opera.com/ODIN/blog/perils-browser-sniffing" mce_href="http://my.opera.com/ODIN/blog/perils-browser-sniffing"&gt;browser version sniffing&lt;/A&gt;), and expose the complex tradeoff between compatibility and extensibility.&lt;/P&gt;
&lt;H3&gt;Background&lt;/H3&gt;
&lt;P&gt;First things first-- you can check the UA string currently sent by your browser using my &lt;A title=http://www.enhanceie.com/ua.aspx href="http://www.enhanceie.com/ua.aspx" mce_href="http://www.enhanceie.com/ua.aspx"&gt;User-Agent string test page&lt;/A&gt;. &lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Do you see anything in there that you weren’t expecting?&lt;/EM&gt;&lt;/P&gt;
&lt;H3&gt;Changing the User-Agent String at Runtime&lt;/H3&gt;
&lt;P&gt;For IE8, we fixed significant bugs in the &lt;A href="http://msdn.microsoft.com/en-us/library/ms775125(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/ms775125(VS.85).aspx"&gt;UrlMkSetSessionOption&lt;/A&gt; API, which allows setting of the User-Agent for the current process. Before IE8, calling this API inside IE would (depending on timing) set the User-Agent sent to the server by WinINET, &lt;EM&gt;or &lt;/EM&gt;set the User-Agent property in the DOM, but &lt;EM&gt;never&lt;/EM&gt; properly set both. &lt;/P&gt;
&lt;P&gt;I developed a simple &lt;A href="http://www.enhanceie.com/ietoys/uapick.asp" mce_href="http://www.enhanceie.com/ietoys/uapick.asp"&gt;User-Agent Picker Add-on&lt;/A&gt; for IE8 that allows you to change your User-Agent string to whatever you like. You can then easily see how websites react to various UA strings. For instance, try sending the GoogleBot UA string to &lt;A href="http://msdn.microsoft.com/" mce_href="http://msdn.microsoft.com/"&gt;MSDN&lt;/A&gt; to see how that site is optimized for search.&lt;/P&gt;
&lt;P&gt;Internally, the add-on simply exercises the URLMon API: &lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;UrlMkSetSessionOption(URLMON_OPTION_USERAGENT, szNewUA, strlen(szNewUA), 0)&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Alternatively, Web Browser Control hosts can change the User-Agent string sent by hyperlink navigations by overriding the OnAmbientProperty method for &lt;A href="http://support.microsoft.com/kb/183412" mce_href="http://support.microsoft.com/kb/183412"&gt;DISPID_AMBIENT_USERAGENT&lt;/A&gt;. However, the overridden property is not used when programmatically calling the Navigate method, and it will not impact the &lt;A href="http://msdn.microsoft.com/en-us/library/cc197025(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/cc197025(VS.85).aspx"&gt;userAgent property&lt;/A&gt; of the DOM's &lt;A href="http://msdn.microsoft.com/en-us/library/ms535867(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/ms535867(VS.85).aspx"&gt;navigator&lt;/A&gt; or &lt;A href="http://msdn.microsoft.com/en-us/library/ms535860(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/ms535860(VS.85).aspx"&gt;clientInformation&lt;/A&gt; objects.&lt;/P&gt;
&lt;H3&gt;Extending the User-Agent String in the Registry&lt;/H3&gt;
&lt;P&gt;It’s trivial to add tokens to the User-Agent string using &lt;A href="http://msdn.microsoft.com/en-us/library/ms537503(VS.85).aspx#UARegistry" mce_href="http://msdn.microsoft.com/en-us/library/ms537503(VS.85).aspx#UARegistry"&gt;simple registry modifications&lt;/A&gt;. Tokens added to the registry keys are sent by all requests from Internet Explorer and other hosts of the Web Browser control. These registry keys have been supported since IE5, meaning that all currently supported IE versions will send these tokens.&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Other browsers (Firefox, Chrome, etc) do not&amp;nbsp;offer the same degree of ease in extending the UA string, so it’s uncommon for software to extend&amp;nbsp;the UA string in non-IE browsers.&lt;/EM&gt;&lt;/P&gt;
&lt;H3&gt;The Fiasco&lt;/H3&gt;
&lt;P&gt;Unfortunately, the ease of extending IE’s UA string means that it’s a very common practice. That, in turn, leads to a number of major problems that impact normal folks who don’t even know what a UA string is.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;A few of the problems include:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Many websites will return only error pages upon receiving a UA header over a fixed length (often 256 characters). &lt;/LI&gt;
&lt;LI&gt;In IE7 and below, if the UA string grows to over 260 characters, the navigator.userAgent property &lt;A href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=362923" mce_href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=362923"&gt;is incorrectly computed.&lt;/A&gt; &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://www.codeproject.com/KB/aspnet/mobiledetect.aspx?msg=3119599#xx3119599xx" mce_href="http://www.codeproject.com/KB/aspnet/mobiledetect.aspx?msg=3119599#xx3119599xx"&gt;Poorly designed UA-sniffing code&lt;/A&gt; may be confused and misinterpret tokens in the UA. &lt;/LI&gt;
&lt;LI&gt;Poorly designed browser add-ons are known to misinterpret how the registry keys are used, and shove an entire UA string into one of the tokens, resulting in a “nested” UA string. &lt;/LI&gt;
&lt;LI&gt;Because UA strings are sent for &lt;EM&gt;every &lt;/EM&gt;HTTP request, they entail a significant performance cost. In &lt;A href="http://brianary.blogspot.com/2009/07/internet-explorer-user-agent-spam.html" mce_href="http://brianary.blogspot.com/2009/07/internet-explorer-user-agent-spam.html"&gt;degenerate cases&lt;/A&gt;, sending the UA string might consume 50% of the overall request bandwidth. &lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;Two real-world examples:&lt;/P&gt;
&lt;P&gt;My bank has problem #1. They have security software on their firewall looking for “suspicious” requests, and the developers assumed that they’d never see a UA over 256 bytes.&lt;/P&gt;
&lt;P&gt;Some major sites are using super-liberal UA parsing code (problem #3) to detect mobile browsers. Unfortunately, for instance, Creative Labs adds the token “Creative AutoU&lt;STRONG&gt;pda&lt;/STRONG&gt;te” to the UA string. Naive server code sees the characters &lt;STRONG&gt;pda &lt;/STRONG&gt;inside that token and decides that the user must be on a mobile browser. The server might then return &lt;A href="http://msdn.microsoft.com/en-us/library/bb415528.aspx" mce_href="http://msdn.microsoft.com/en-us/library/bb415528.aspx"&gt;WML&lt;/A&gt; content that the desktop browser will not even render, or provide an otherwise degraded experience. Worse still, some sites don’t send a &lt;FONT face="Courier New"&gt;Vary: User-Agent&lt;/FONT&gt; response header when returning the mobile content, meaning that network proxies will sometimes start sending &lt;EM&gt;everyone&lt;/EM&gt; content designed for mobile devices.&lt;/P&gt;
&lt;P&gt;Ultimately, the problem is what economists call the &lt;A href="http://en.wikipedia.org/wiki/Tragedy_of_the_commons" mce_href="http://en.wikipedia.org/wiki/Tragedy_of_the_commons"&gt;Tragedy of the Commons&lt;/A&gt;, although personally I prefer the &lt;A href="http://despair.com/ir.html" mce_href="http://despair.com/ir.html"&gt;visual representation&lt;/A&gt;. You might remember that the extensibility of the &lt;A href="http://blogs.msdn.com/ieinternals/archive/2009/07/01/IE-and-the-Accept-Header.aspx" mce_href="http://blogs.msdn.com/ieinternals/archive/2009/07/01/IE-and-the-Accept-Header.aspx"&gt;Accept header&lt;/A&gt; leads to the same problem, although that header is sent so unreliably that no sane website would depend upon it.&lt;/P&gt;
&lt;H3&gt;Standards&lt;/H3&gt;
&lt;P&gt;It’s tempting to look to the standards for restrictions on the UA string. Unfortunately, the &lt;A href="http://www.ietf.org/rfc/rfc2616.txt" mce_href="http://www.ietf.org/rfc/rfc2616.txt"&gt;RFC for HTTP&lt;/A&gt; has little to say on the topic:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;14.43 User-Agent &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;The User-Agent request-header field contains information about the user agent originating the request. This is for statistical purposes, the tracing of protocol violations, and automated recognition of user agents for the sake of tailoring responses to avoid particular user agent limitations. User agents SHOULD include this field with requests. The field can contain multiple product tokens (section 3.8) and comments identifying the agent and any subproducts which form a significant part of the user agent. By convention, the product tokens are listed in order of their significance for identifying the application. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;User-Agent = "User-Agent" ":" 1*( product | comment ) &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;Example: &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New"&gt;User-Agent: CERN-LineMode/2.15 libwww/2.17b3&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Notably, the RFC does not define a maximum length for the header value, and does not provide much guidance into what “subproducts which form a significant part of the user agent” means. It suggests a few broad uses of the UA string on the server-side, without discussion of what problems such usage might introduce. &lt;/P&gt;
&lt;H3&gt;Motivations for UA Modification&lt;/H3&gt;
&lt;P&gt;OEMs and ISVs have a number of motivations for adding to the UA string.&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;STRONG&gt;Metrics. &lt;/STRONG&gt;Every server on the web can easily tell if your software is installed. &lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Client capability detection. &lt;/STRONG&gt;JavaScript can easily detect if your (ActiveX control / Protocol Handler / Client application / etc) is available. &lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;User Tracking. &lt;/STRONG&gt;I don’t know of any current offenders, but at some point in the past some software would add a &lt;A href="http://msdn.microsoft.com/en-us/library/aa373931(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/aa373931(VS.85).aspx"&gt;GUID&lt;/A&gt; token to the UA string. This token would effectively act as an invisible “super-cookie” that would be sent to every site the user ever visited. &lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;Now, scenario #3 is clearly evil, and we have no desire to support it. Scenarios #1 and #2 aren’t inherently bad—but advertising to every site in the world that a given piece of software is available on the client is probably the wrong design.&lt;/P&gt;
&lt;H3&gt;Known UA Tokens&lt;/H3&gt;
&lt;P&gt;Here are some explanations of common tokens found in &lt;A href="http://www.useragentstring.com/pages/Internet%20Explorer/" mce_href="http://www.useragentstring.com/pages/Internet%20Explorer/"&gt;real-world IE UA strings&lt;/A&gt;.&lt;/P&gt;
&lt;TABLE border=1&gt;
&lt;THEAD&gt;
&lt;TR&gt;
&lt;TD&gt;&lt;STRONG&gt;Token&lt;/STRONG&gt; &lt;/TD&gt;
&lt;TD&gt;&lt;STRONG&gt;Meaning&amp;nbsp;/ Component&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/THEAD&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;SV1&lt;/TD&gt;
&lt;TD&gt;&lt;EM&gt;Security Version 1&lt;/EM&gt;- Indicates that&amp;nbsp;XP SP2 was installed. Removed from IE7.&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;SLCC1&lt;/TD&gt;
&lt;TD&gt;&lt;EM&gt;Software Licensing Commerce Client&lt;/EM&gt;- Indicates Vista+ &lt;A href="http://support.microsoft.com/kb/930379" mce_href="http://support.microsoft.com/kb/930379"&gt;AnyTime Upgrade component&lt;/A&gt; is available.&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;MS-RTC LM 8&lt;/TD&gt;
&lt;TD&gt;&lt;EM&gt;Microsoft Real Time Conferencing Live Meeting&lt;/EM&gt; version 8&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;InfoPath.2&lt;/TD&gt;
&lt;TD&gt;InfoPath XML MIME Filter&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;GTB6&lt;/TD&gt;
&lt;TD&gt;Google Toolbar&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Creative AutoUpdate&lt;/TD&gt;
&lt;TD&gt;Creative AutoUpdate software&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Trident/4.0&lt;/TD&gt;
&lt;TD&gt;IE8 version of HTML Renderer installed&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Zune 3.0&lt;/TD&gt;
&lt;TD&gt;Zune Software client&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Media Center PC 6.0&lt;/TD&gt;
&lt;TD&gt;It's a Media Center PC&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Tablet PC 2.0&lt;/TD&gt;
&lt;TD&gt;It's a TabletPC&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;.NET CLR 3.5.30729&lt;/TD&gt;
&lt;TD&gt;The &lt;A href="http://www.hanselman.com/blog/TheNETFrameworkAndTheBrowsersUserAgentString.aspx"&gt;.NET Common Language Runtime&lt;/A&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;chromeframe&lt;/TD&gt;
&lt;TD&gt;Google ChromeFrame addon&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;fdm&lt;/TD&gt;
&lt;TD&gt;FreeDownloadManager.org add-on&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Comcast Install 1.0&lt;/TD&gt;
&lt;TD&gt;Comcast High-speed Internet installer&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;OfficeLiveConnector.1.3&lt;/TD&gt;
&lt;TD&gt;??&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;OfficeLivePatch.0.0&lt;/TD&gt;
&lt;TD&gt;Comcast browser installer&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;WOW64&lt;/TD&gt;
&lt;TD&gt;Running in &lt;A href="http://blogs.msdn.com/ie/archive/2009/01/09/the-internet-explorer-8-user-agent-string-updated-edition.aspx"&gt;32bit IE on 64bit Windows&lt;/A&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Win64; x64&lt;/TD&gt;
&lt;TD&gt;Running in 64bit IE&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;msn OptimizedIE8&lt;/TD&gt;
&lt;TD&gt;Installed with MSN branding and services&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;yie8&lt;/TD&gt;
&lt;TD&gt;Installed with Yahoo! branding and services&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;H3&gt;Alternatives to UA Modification&lt;/H3&gt;
&lt;P&gt;In many cases, allowing client-side script to detect a capability without forcing the browser to send that information to the server would be sufficient. While new APIs might be proposed for this purpose, we need an alternative that already works in all versions of IE. &lt;/P&gt;
&lt;P&gt;You probably know that &lt;A href="http://msdn.microsoft.com/en-us/library/ms537512(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/ms537512(VS.85).aspx"&gt;Conditional Comments&lt;/A&gt; can be used to detect the IE version, but they can also be used to detect custom information about any component listed in the registry’s &lt;STRONG&gt;version vector &lt;/STRONG&gt;key. For instance, Windows 7 uses the new &lt;STRONG&gt;WindowsVersion &lt;/STRONG&gt;entry to allow script to detect the &lt;A href="http://msdn.microsoft.com/en-us/library/aa394239(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/aa394239(VS.85).aspx"&gt;OperatingSystemSKU&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;To expose your capabilities via conditional comments, simply create a &lt;FONT face="Courier New"&gt;REG_SZ&lt;/FONT&gt; inside &lt;FONT face="Courier New"&gt;HKLM\SOFTWARE\Microsoft\Internet Explorer\Version Vector&lt;/FONT&gt;. The new entry should be named uniquely (e.g. &lt;FONT color=#008000 face="Courier New"&gt;EricLaw-SampleAddon&lt;/FONT&gt;) and contain a string in the format x.xxxx (e.g. &lt;FONT color=#008000 face="Courier New"&gt;1.0002&lt;/FONT&gt;).&lt;/P&gt;
&lt;P&gt;You can then detect the version (or absence) of your component using conditional comments:&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#008000 face="Courier New"&gt;&amp;lt;!--[if !&lt;FONT color=#008000 face="Courier New"&gt;EricLawSampleAddon&lt;/FONT&gt;]&amp;gt;&amp;lt;script&amp;gt;alert("&lt;/FONT&gt;&lt;FONT color=#008000 face="Courier New"&gt;You don’t have my IE add-on yet. Go install it!");&amp;lt;/script&amp;gt;&amp;lt;![endif]--&amp;gt; &lt;BR&gt;&lt;FONT color=#008000 face="Courier New"&gt;&amp;lt;!--[if lt &lt;FONT color=#008000 face="Courier New"&gt;EricLawSampleAddon 1.0002&lt;/FONT&gt;]&amp;gt;&amp;lt;b&amp;gt;&lt;/FONT&gt;&lt;FONT color=#008000 face="Courier New"&gt;You have an outdated version. Go upgrade!&amp;lt;/b&amp;gt;&amp;lt;![endif]--&amp;gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;These conditional comments are hidden from non-IE browsers, and will work properly in IE5 and above.&lt;/P&gt;
&lt;H3&gt;Conclusions?&lt;/H3&gt;
&lt;P&gt;Extensibility is an important aspect for any major software project, but can also be the source of severe compatibility problems that are extremely painful to fix in the future. As we increase the power of the web platform, we need to find ways to ensure that extension points and the tragedy of the commons don’t destroy the user’s experience.&lt;/P&gt;
&lt;P&gt;Until next time,&lt;/P&gt;
&lt;P&gt;-Eric&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9904696" width="1" height="1"&gt;</content><author><name>EricLaw</name><uri>http://blogs.msdn.com/members/EricLaw.aspx</uri></author><category term="design" scheme="http://blogs.msdn.com/ieinternals/archive/tags/design/default.aspx" /><category term="Best-Practices" scheme="http://blogs.msdn.com/ieinternals/archive/tags/Best-Practices/default.aspx" /><category term="problems" scheme="http://blogs.msdn.com/ieinternals/archive/tags/problems/default.aspx" /><category term="hosting" scheme="http://blogs.msdn.com/ieinternals/archive/tags/hosting/default.aspx" /><category term="dev" scheme="http://blogs.msdn.com/ieinternals/archive/tags/dev/default.aspx" /><category term="add-ons" scheme="http://blogs.msdn.com/ieinternals/archive/tags/add-ons/default.aspx" /><category term="networking" scheme="http://blogs.msdn.com/ieinternals/archive/tags/networking/default.aspx" /></entry><entry><title>Good News: Microsoft Security Essentials Released</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/ieinternals/archive/2009/10/06/Free-antivirus-and-antimalware-scanner-from-Microsoft.aspx" /><id>http://blogs.msdn.com/ieinternals/archive/2009/10/06/Free-antivirus-and-antimalware-scanner-from-Microsoft.aspx</id><published>2009-10-06T18:08:00Z</published><updated>2009-10-06T18:08:00Z</updated><content type="html">&lt;P&gt;Microsoft’s free new anti-virus / anti-malware realtime scanner is now available as &lt;A href="http://www.microsoft.com/security_essentials/" mce_href="http://www.microsoft.com/security_essentials/"&gt;a free download&lt;/A&gt;. Installing MSE, a traditional&amp;nbsp;signature-based scanner, alongside IE8’s URL Reputation-based &lt;A href="http://blogs.msdn.com/ie/archive/2009/08/13/real-world-protection-with-ie8-s-smartscreen-filter.aspx" mce_href="http://blogs.msdn.com/ie/archive/2009/08/13/real-world-protection-with-ie8-s-smartscreen-filter.aspx"&gt;SmartScreen Filter&lt;/A&gt; yields comprehensive protection to help keep your computers safe from malicious software. &lt;/P&gt;
&lt;P&gt;There are a few things I like about MSE over other scanners:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;You won’t see advertisements trying to “upsell” you to a professional version.&lt;/LI&gt;
&lt;LI&gt;You won’t see “scareware” style warnings trying to convince you that MSE is providing value-- &lt;EM&gt;“oh my gosh, we found a cookie! Panic!”&lt;/EM&gt;&lt;/LI&gt;
&lt;LI&gt;Signature updates are free—there’s no “subscription” that will expire and leave you unprotected.&lt;/LI&gt;
&lt;LI&gt;The product doesn’t install a bunch of 3rd party toolbars or other such nonsense— unfortunately, a common business model for other “free” products.&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;The product has been getting some &lt;A href="http://www.winsupersite.com/win7/mse.asp" mce_href="http://www.winsupersite.com/win7/mse.asp"&gt;great&lt;/A&gt; &lt;A href="http://www.computerworld.com/s/article/9134753/Antivirus_testing_outfit_Microsoft_Security_Essentials_makes_the_grade?intsrc=it_blogwatch" mce_href="http://www.computerworld.com/s/article/9134753/Antivirus_testing_outfit_Microsoft_Security_Essentials_makes_the_grade?intsrc=it_blogwatch"&gt;reviews&lt;/A&gt;.&amp;nbsp; I’ll definitely be installing this on my parent’s computer the next time I’m home.&amp;nbsp; :-)&lt;/P&gt;
&lt;P&gt;-Eric&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9903767" width="1" height="1"&gt;</content><author><name>EricLaw</name><uri>http://blogs.msdn.com/members/EricLaw.aspx</uri></author><category term="Security" scheme="http://blogs.msdn.com/ieinternals/archive/tags/Security/default.aspx" /><category term="tools" scheme="http://blogs.msdn.com/ieinternals/archive/tags/tools/default.aspx" /></entry><entry><title>Internet Explorer Cannot Download https://something</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/ieinternals/archive/2009/10/02/Internet-Explorer-cannot-download-over-HTTPS-when-no-cache.aspx" /><id>http://blogs.msdn.com/ieinternals/archive/2009/10/02/Internet-Explorer-cannot-download-over-HTTPS-when-no-cache.aspx</id><published>2009-10-03T00:55:00Z</published><updated>2009-10-03T00:55:00Z</updated><content type="html">&lt;P&gt;Earlier today, I was asked to troubleshoot a secure site where file downloads were always failing. Having seen this problem many times often over the years, I immediately suspected that the web developer wasn’t aware that &lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;STRONG&gt;if a user tries to download&lt;/STRONG&gt;&lt;EM&gt;*&lt;/EM&gt;&lt;STRONG&gt; a file over a HTTPS connection, any response headers that prevent caching will cause the file download process to fail.&lt;/STRONG&gt; &lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;EM&gt;* Note that this applies to “downloaded” files that open in programs other than IE. It does not apply to resources that render&lt;/EM&gt; inside &lt;EM&gt;IE’s HTML rendering engine, like images/script/css/etc&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;When Internet Explorer encounters a HTTPS download that will not be cached, the download is aborted with the following dialog box:&lt;/P&gt;
&lt;P&gt;&lt;IMG alt="Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found." src="http://www.enhanceie.com/images/blog/DownloadFail.png" mce_src="http://www.enhanceie.com/images/blog/DownloadFail.png"&gt; &lt;/P&gt;
&lt;P&gt;The &lt;A href="http://www.fiddler2.com/" mce_href="http://www.fiddler2.com/"&gt;Fiddler&lt;/A&gt; web debugger allows you to easily check to see whether a download contains headers that prevent caching.&lt;/P&gt;
&lt;P&gt;Cache-preventing headers include:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;A &lt;STRONG&gt;Cache-Control&lt;/STRONG&gt; header with the tokens &lt;STRONG&gt;no-cache&lt;/STRONG&gt;, &lt;STRONG&gt;no-store&lt;/STRONG&gt;, or &lt;STRONG&gt;max-age=0&lt;/STRONG&gt; &lt;/LI&gt;
&lt;LI&gt;An &lt;STRONG&gt;Expires&lt;/STRONG&gt; header that specifies a time in the past &lt;/LI&gt;
&lt;LI&gt;A &lt;STRONG&gt;Vary &lt;/STRONG&gt;header that specifies &lt;A href="http://blogs.msdn.com/ieinternals/archive/2009/06/17/Vary-Header-Prevents-Caching-in-IE.aspx" mce_href="http://blogs.msdn.com/ieinternals/archive/2009/06/17/Vary-Header-Prevents-Caching-in-IE.aspx"&gt;almost anything&lt;/A&gt;&amp;nbsp; &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Without changing the site’s code, you can easily confirm that the problem is caused by cache-prevention headers using Fiddler’s Filters tab:&lt;/P&gt;
&lt;P&gt;&lt;IMG alt="Fiddler Filter UI: Remove Cache-Control Header" src="http://www.enhanceie.com/images/blog/RemoveCacheControl.png" mce_src="http://www.enhanceie.com/images/blog/RemoveCacheControl.png"&gt;&lt;/P&gt;
&lt;P&gt;Fiddler allowed me to determine that today’s instance was caused by cache-preventing headers. After the web developer updates these headers to allow local caching (e.g. &lt;STRONG&gt;Cache-Control: private, max-age=15&lt;/STRONG&gt;) the file download process will work correctly.&lt;/P&gt;
&lt;P&gt;-Eric&lt;/P&gt;
&lt;P&gt;PS: In the unlikely event that the user has checked the &lt;STRONG&gt;Do not save encrypted pages to disk&lt;/STRONG&gt; option inside Tools / Internet Options &amp;gt; Advanced, this error dialog may be shown for &lt;EM&gt;any &lt;/EM&gt;file downloads from secure sites, regardless of caching headers. I recommend that folks avoid enabling this option, and use the &lt;STRONG&gt;Delete Browser History on Exit &lt;/STRONG&gt;feature instead.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9902596" width="1" height="1"&gt;</content><author><name>EricLaw</name><uri>http://blogs.msdn.com/members/EricLaw.aspx</uri></author><category term="caching" scheme="http://blogs.msdn.com/ieinternals/archive/tags/caching/default.aspx" /><category term="https" scheme="http://blogs.msdn.com/ieinternals/archive/tags/https/default.aspx" /><category term="problems" scheme="http://blogs.msdn.com/ieinternals/archive/tags/problems/default.aspx" /><category term="networking" scheme="http://blogs.msdn.com/ieinternals/archive/tags/networking/default.aspx" /></entry><entry><title>New Tool: Compare IE Security Settings</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/ieinternals/archive/2009/10/02/IE-Zone-Comparer-Tool-Released.aspx" /><id>http://blogs.msdn.com/ieinternals/archive/2009/10/02/IE-Zone-Comparer-Tool-Released.aspx</id><published>2009-10-02T00:11:00Z</published><updated>2009-10-02T00:11:00Z</updated><content type="html">&lt;P&gt;“IE Zone Comparer” was designed to&amp;nbsp;provide additional visibility into URLMon's&amp;nbsp;security zone settings.&amp;nbsp; Pick any two collections of security zone settings, and IE Zone Comparer displays the values of those settings, highlighting any differences between the two collections.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Note: Updated on 11/7/2009 to offer details on "Effective" policy.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.technet.com/fdcc/archive/2009/11/07/viewing-and-comparing-ie-security-zone-settings-enhanced.aspx" mce_href="http://blogs.technet.com/fdcc/archive/2009/11/07/viewing-and-comparing-ie-security-zone-settings-enhanced.aspx"&gt;http://blogs.technet.com/fdcc/archive/2009/11/07/viewing-and-comparing-ie-security-zone-settings-enhanced.aspx&lt;/A&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9902152" width="1" height="1"&gt;</content><author><name>EricLaw</name><uri>http://blogs.msdn.com/members/EricLaw.aspx</uri></author><category term="Security" scheme="http://blogs.msdn.com/ieinternals/archive/tags/Security/default.aspx" /><category term="tools" scheme="http://blogs.msdn.com/ieinternals/archive/tags/tools/default.aspx" /><category term="Zones" scheme="http://blogs.msdn.com/ieinternals/archive/tags/Zones/default.aspx" /></entry><entry><title>Understanding Domain Names in Internet Explorer</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/ieinternals/archive/2009/09/19/Private-Domain-Names-and-Public-Suffixes-in-Internet-Explorer.aspx" /><id>http://blogs.msdn.com/ieinternals/archive/2009/09/19/Private-Domain-Names-and-Public-Suffixes-in-Internet-Explorer.aspx</id><published>2009-09-19T03:01:00Z</published><updated>2009-09-19T03:01:00Z</updated><content type="html">&lt;P&gt;Web browsers use domain names for a variety of purposes, but how they’re used is much more complicated than most developers realize. In this post, I’ll attempt to cover the most important aspects of this topic.&lt;/P&gt;
&lt;H2&gt;Definitions&lt;/H2&gt;
&lt;P&gt;When talking about “domains” the terminology alone is confusing (and contentious).&amp;nbsp; So, let’s start with some simplistic definitions for terms used in this post:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;A &lt;A href="http://en.wikipedia.org/wiki/DNS_label#Parts_of_a_domain_name" mce_href="http://en.wikipedia.org/wiki/DNS_label#Parts_of_a_domain_name"&gt;label&lt;/A&gt; is a single component of a &lt;A href="http://en.wikipedia.org/wiki/Domain_name" mce_href="http://en.wikipedia.org/wiki/Domain_name"&gt;domain name&lt;/A&gt; string, delimited by periods. For instance, “&lt;EM&gt;www&lt;/EM&gt;” “&lt;EM&gt;microsoft&lt;/EM&gt;” and “&lt;EM&gt;com&lt;/EM&gt;” are the three labels in the domain name “&lt;EM&gt;www.microsoft.com&lt;/EM&gt;” &lt;/LI&gt;
&lt;LI&gt;A &lt;STRONG&gt;plainhostname&lt;/STRONG&gt; is an unqualified, single label hostname like “&lt;EM&gt;Payroll&lt;/EM&gt;”, which typically refers to a server on a local intranet. &lt;/LI&gt;
&lt;LI&gt;A &lt;A href="http://en.wikipedia.org/wiki/Fqdn" mce_href="http://en.wikipedia.org/wiki/Fqdn"&gt;FQDN&lt;/A&gt; is an absolute, fully-qualified domain name, like “&lt;EM&gt;www.microsoft.com&lt;/EM&gt;” &lt;/LI&gt;
&lt;LI&gt;A &lt;A href="http://publicsuffix.org/" mce_href="http://publicsuffix.org/"&gt;Public Suffix&lt;/A&gt; is the suffix portion of a FQDN under which independent entities may register subdomains. For example, &lt;EM&gt;ltd.co.im &lt;/EM&gt;is a Public Suffix. A Public Suffix contains one or more labels. Sometimes the term “&lt;A href="https://wiki.mozilla.org/Gecko:Effective_TLD_List" mce_href="https://wiki.mozilla.org/Gecko:Effective_TLD_List"&gt;effective TLD&lt;/A&gt;” is used as a synonym. &lt;/LI&gt;
&lt;LI&gt;A &lt;STRONG&gt;&lt;A href="http://en.wikipedia.org/wiki/Top-level_domain" mce_href="http://en.wikipedia.org/wiki/Top-level_domain"&gt;TLD&lt;/A&gt; &lt;/STRONG&gt;is a top-level-domain, the right-most label of a domain name &lt;/LI&gt;
&lt;LI&gt;A &lt;STRONG&gt;&lt;A href="http://en.wikipedia.org/wiki/Generic_top-level_domain" mce_href="http://en.wikipedia.org/wiki/Generic_top-level_domain"&gt;gTLD&lt;/A&gt; &lt;/STRONG&gt;is a generic TLD, like ".&lt;EM&gt;com&lt;/EM&gt;”, “.&lt;EM&gt;net&lt;/EM&gt;”, “.&lt;EM&gt;gov&lt;/EM&gt;”, etc &lt;/LI&gt;
&lt;LI&gt;A &lt;STRONG&gt;&lt;A href="http://en.wikipedia.org/wiki/Cctld" mce_href="http://en.wikipedia.org/wiki/Cctld"&gt;ccTLD&lt;/A&gt; &lt;/STRONG&gt;is a country-code TLD, like “.&lt;EM&gt;us&lt;/EM&gt;” or “.&lt;EM&gt;ru&lt;/EM&gt;” &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://en.wikipedia.org/wiki/Internet_Corporation_for_Assigned_Names_and_Numbers" mce_href="http://en.wikipedia.org/wiki/Internet_Corporation_for_Assigned_Names_and_Numbers"&gt;ICANN&lt;/A&gt; (the Internet Corporation for Assigned Names and Numbers) is responsible for the creation and management of TLDs &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;When web developers talk about “the domain,” they’re often referring to what this post calls the Private Domain:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;A &lt;STRONG&gt;Private Domain &lt;/STRONG&gt;is a single label with a Public Suffix appended. &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;For instance, the two Private Domains “&lt;EM&gt;Acme.ltd.co.im”&lt;/EM&gt; and “&lt;EM&gt;Bayden.ltd.co.im”&lt;/EM&gt;, are each independently operated subdomains of Public Suffix “&lt;EM&gt;ltd.co.im”. &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Okay, now on to the fun stuff.&lt;/P&gt;
&lt;H2&gt;Domains and the IURI Interface&lt;/H2&gt;
&lt;P&gt;&lt;EM&gt;First, some foreshadowing…&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;IE7 and above use a &lt;A href="http://blogs.msdn.com/ie/archive/2005/08/15/452006.aspx" mce_href="http://blogs.msdn.com/ie/archive/2005/08/15/452006.aspx"&gt;Consolidated URI&lt;/A&gt; handling feature which exposes the &lt;A href="http://msdn.microsoft.com/en-us/library/ms775038(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/ms775038(VS.85).aspx"&gt;IURI interface&lt;/A&gt;.&amp;nbsp; Let’s have a quick look at a partial list of IURI property values from a sample URI: &lt;STRONG&gt;http://www.example.com/path/file.ext?query=val#frag&lt;/STRONG&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;TABLE border=0 cellSpacing=0 cellPadding=1 width=631&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD vAlign=top width=200&gt;Uri_PROPERTY_ABSOLUTE_URI&lt;/TD&gt;
&lt;TD vAlign=top width=429&gt;"http://www.example.com/path/file.ext?query=val#frag"&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD vAlign=top width=200&gt;Uri_PROPERTY_DISPLAY_URI&lt;/TD&gt;
&lt;TD vAlign=top width=429&gt;"http://www.example.com/path/file.ext?query=val#frag" &lt;BR&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD vAlign=top width=200&gt;Uri_PROPERTY_RAW_URI&lt;/TD&gt;
&lt;TD vAlign=top width=429&gt;"http://www.example.com/path/file.ext?query=val#frag"&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD vAlign=top width=200&gt;Uri_PROPERTY_SCHEME_NAME&lt;/TD&gt;
&lt;TD vAlign=top width=429&gt;"http"&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD vAlign=top width=200&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/ms775016(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/ms775016(VS.85).aspx"&gt;Uri_PROPERTY_DOMAIN &lt;BR&gt;&lt;/A&gt;&lt;FONT color=#008000&gt;&lt;EM&gt;aka Private Domain&lt;/EM&gt;&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD vAlign=top width=429&gt;"example.com"&amp;nbsp; &lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD vAlign=top width=200&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/ms775019(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/ms775019(VS.85).aspx"&gt;Uri_PROPERTY_HOST&lt;/A&gt; &lt;BR&gt;&lt;FONT color=#008000&gt;&lt;EM&gt;aka FQDN or Plainhostname&lt;/EM&gt;&lt;/FONT&gt;&lt;/TD&gt;
&lt;TD vAlign=top width=429&gt;"www.example.com"&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD vAlign=top width=200&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/ms775020(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/ms775020(VS.85).aspx"&gt;Uri_PROPERTY_HOST_TYPE&lt;/A&gt;&lt;/TD&gt;
&lt;TD vAlign=top width=429&gt;1&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD vAlign=top width=200&gt;Uri_PROPERTY_PORT&lt;/TD&gt;
&lt;TD vAlign=top width=429&gt;80&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD vAlign=top width=200&gt;Uri_PROPERTY_PATH&lt;/TD&gt;
&lt;TD vAlign=top width=429&gt;"/path/file.ext"&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD vAlign=top width=200&gt;Uri_PROPERTY_QUERY&lt;/TD&gt;
&lt;TD vAlign=top width=429&gt;"?query=val"&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It’s important to note that if the URI contains only a plainhostname (e.g. “&lt;EM&gt;http://&lt;STRONG&gt;example&lt;/STRONG&gt;/”&lt;/EM&gt;) or a Public Suffix (e.g. “&lt;EM&gt;http://&lt;STRONG&gt;co.uk&lt;/STRONG&gt;/&lt;/EM&gt;”), then Uri_PROPERTY_DOMAIN is &lt;EM&gt;null&lt;/EM&gt;.&lt;/P&gt;
&lt;H2&gt;Why Do Browsers Care About Domains?&lt;/H2&gt;
&lt;P&gt;Every browser must be able to determine the Private Domain for &lt;A href="http://publicsuffix.org/learn/" mce_href="http://publicsuffix.org/learn/"&gt;a number of uses&lt;/A&gt;, but in this post I’ll concentrate on IE’s use of this information.&lt;/P&gt;
&lt;H5&gt;&lt;STRONG&gt;1. &lt;/STRONG&gt;Domain Highlighting&lt;STRONG&gt; in the Address Bar&lt;/STRONG&gt;&lt;/H5&gt;
&lt;P&gt;IE8’s &lt;A href="http://blogs.msdn.com/ie/archive/2008/03/11/address-bar-improvements-in-internet-explorer-8-beta-1.aspx" mce_href="http://blogs.msdn.com/ie/archive/2008/03/11/address-bar-improvements-in-internet-explorer-8-beta-1.aspx"&gt;Domain Highlighting&lt;/A&gt; feature renders the Private Domain in black text and the rest of the URL in gray to help prevent the use of misleading URLs in spoofing attacks. &lt;/P&gt;
&lt;P&gt;If the URL contains a plainhostname, the address bar will render the plainhostname in black instead.&lt;/P&gt;
&lt;H5&gt;&lt;STRONG&gt;2. Quota management for &lt;/STRONG&gt;Local Storage&lt;/H5&gt;
&lt;P&gt;IE8 applies a &lt;A href="http://msdn.microsoft.com/en-us/library/cc197062(VS.85).aspx#_quota" mce_href="http://msdn.microsoft.com/en-us/library/cc197062(VS.85).aspx#_quota"&gt;per-Private Domain quota&lt;/A&gt; to values stored using the HTML5 Local Storage API.&lt;/P&gt;
&lt;P&gt;If the Uri_PROPERTY_DOMAIN is null (because the URL contains a plainhostname) the browser will enforce the quota against Uri_PROPERTY_HOST instead.&lt;/P&gt;
&lt;H5&gt;3. document.domain relaxation&lt;/H5&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/ieinternals/archive/2009/08/28/Explaining-Same-Origin-Policy-Part-1-Deny-Read.aspx" mce_href="http://blogs.msdn.com/ieinternals/archive/2009/08/28/Explaining-Same-Origin-Policy-Part-1-Deny-Read.aspx"&gt;Same-Origin-Policy&lt;/A&gt; typically means that two pages must have exactly-matching FQDNs in order to script against each others’ DOM. However, HTML allows a page to &lt;A href="http://msdn.microsoft.com/en-us/library/ms533028(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/ms533028(VS.85).aspx"&gt;relax its document.domain&lt;/A&gt; property to a suffix of its current value to enable cross host DOM communication within a single Private Domain. Script is not permitted to change its &lt;A href="http://msdn.microsoft.com/en-us/library/cc196989(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/cc196989(VS.85).aspx"&gt;document.domain property&lt;/A&gt; to a string shorter than the private domain. This prevents sites from unrelated organizations from intentionally or inadvertently scripting against each others’ DOM.&lt;/P&gt;
&lt;H5&gt;4. HTTP Cookies&lt;/H5&gt;
&lt;P&gt;When setting a cookie, a website may specify which hosts the cookie should be sent to using the domain attribute. The browser must block attempts to set a cookie where the domain attribute does not end with the current page’s Private Domain. Failure to do so results in privacy and security concerns.&lt;/P&gt;
&lt;P&gt;Privacy: Allowing unrelated domains to share cookies can result in “super-cookies”-- cookies which are sent to multiple unrelated organizations that happen to share a Public Suffix.&lt;/P&gt;
&lt;P&gt;Security: Session-fixation attacks, where a good site and an evil site share a Public Suffix, and the evil site sets a malicious cookie on the Public Suffix so that the Good site is sent the evil cookie.&lt;/P&gt;
&lt;H5&gt;5. Security Zones – Mapping Domains to Zones&lt;/H5&gt;
&lt;P&gt;Because Public Suffixes are typically shared by multiple unrelated organizations, URLMon &lt;A href="http://support.microsoft.com/default.aspx/kb/259493" mce_href="http://support.microsoft.com/default.aspx/kb/259493"&gt;does not permit&lt;/A&gt; users to add all sites in a given public-suffix to a security zone. &lt;/P&gt;
&lt;P&gt;We are aware that there are scenarios where such assignments may be desirable to some organizations (e.g. perhaps I would like to assign *.mil to the Trusted Sites Zone).&lt;/P&gt;
&lt;H5&gt;6. Security Zones – Automatic Zone Determination&lt;/H5&gt;
&lt;P&gt;URLMon (subject to &lt;A href="http://blogs.msdn.com/ie/archive/2005/12/07/501075.aspx" mce_href="http://blogs.msdn.com/ie/archive/2005/12/07/501075.aspx"&gt;some caveats&lt;/A&gt;) is configured by default to &lt;A href="http://msdn.microsoft.com/en-us/library/bb250483(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/bb250483(VS.85).aspx"&gt;map&lt;/A&gt; plainhostnames to the Intranet zone. &lt;/P&gt;
&lt;H5&gt;7. Per-site ActiveX&lt;/H5&gt;
&lt;P&gt;When the user uses the Information Bar to allow an ActiveX control to run, Internet Explorer 8’s &lt;A href="http://msdn.microsoft.com/en-us/library/dd433050(VS.85).aspx" mce_href="http://msdn.microsoft.com/en-us/library/dd433050(VS.85).aspx"&gt;Per-Site ActiveX feature&lt;/A&gt; adds the current Private Domain to the Allow list for that control.&lt;/P&gt;
&lt;H5&gt;8. Compatibility View&lt;/H5&gt;
&lt;P&gt;Internet Explorer 8’s &lt;A href="http://blogs.msdn.com/ie/archive/2008/08/27/introducing-compatibility-view.aspx" mce_href="http://blogs.msdn.com/ie/archive/2008/08/27/introducing-compatibility-view.aspx"&gt;Compatibility View button&lt;/A&gt; adds the current Private Domain to the compatibility view list. &lt;/P&gt;
&lt;H5&gt;9. XSS Filter&lt;/H5&gt;
&lt;P&gt;IE8’s &lt;A href="http://blogs.msdn.com/ie/archive/2008/07/01/ie8-security-part-iv-the-xss-filter.aspx" mce_href="http://blogs.msdn.com/ie/archive/2008/07/01/ie8-security-part-iv-the-xss-filter.aspx"&gt;XSS Filter&lt;/A&gt; uses the Private Domain to determine whether a given navigation crosses from one Private Domain to another. &lt;/P&gt;
&lt;H5&gt;10. InPrivate Filtering&lt;/H5&gt;
&lt;P&gt;IE8’s &lt;A href="http://community.winsupersite.com/blogs/paul/archive/2009/04/03/ie8-ad-blocking-with-the-inprivate-filter.aspx" mce_href="http://community.winsupersite.com/blogs/paul/archive/2009/04/03/ie8-ad-blocking-with-the-inprivate-filter.aspx"&gt;InPrivate Filtering&lt;/A&gt; feature uses Private Domain information to help determine whether a given request is being sent to a 3rd party site.&lt;/P&gt;
&lt;H5&gt;11. Preserve Favorite Website Data&lt;/H5&gt;
&lt;P&gt;IE8’s Delete Browsing History feature includes a new “Preserve Favorites website data” option. As I described back in &lt;A href="http://blogs.msdn.com/ieinternals/archive/2009/06/30/IE8-Privacy-APIs-for-Addons.aspx" mce_href="http://blogs.msdn.com/ieinternals/archive/2009/06/30/IE8-Privacy-APIs-for-Addons.aspx"&gt;this post from June&lt;/A&gt;, this feature relies on the Private Domain to help determine whether stored data is related to one of the user’s favorite websites. &lt;/P&gt;
&lt;H2&gt;The Challenge of ccTLDs&lt;/H2&gt;
&lt;P&gt;In the early days of the web, most ccTLDs were organized in such a way that it was relatively easy to heuristically determine the Public Suffix of any FQDN. Over time, however, different ccTLDs decided that they wanted to create new Public Suffixes within their ccTLD, or decided to allow registration of Private Domains that the heuristics would incorrectly treat as Public Suffixes. Some nations (like &lt;A href="http://en.wikipedia.org/wiki/Tuvalu" mce_href="http://en.wikipedia.org/wiki/Tuvalu"&gt;Tuvalu&lt;/A&gt;) have outsourced registration of subdomains and allow anyone to obtain Private Domains within their ccTLD (&lt;A href="http://www.verisign.tv/" mce_href="http://www.verisign.tv/"&gt;.TV&lt;/A&gt;).&lt;/P&gt;
&lt;P&gt;Prior to IE8, there was no one codepath in IE where the Private Domain was calculated, so over time several point-fixes were made to liberalize &lt;A href="http://support.microsoft.com/kb/310676" mce_href="http://support.microsoft.com/kb/310676"&gt;cookie setting in certain ccTLDs&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;The heuristic Private Domain determination algorithm in IE5+ is: &lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT color=#008040 size=1&gt;1&amp;gt; If the final label is empty, drop it for the purposes of this algorithm&amp;nbsp; &lt;BR&gt;&lt;FONT color=#808080&gt;Otherwise "www.example.com." would have four labels "www", "example", "com", "".&amp;nbsp; Instead, we drop the final label.&lt;/FONT&gt; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#008040 size=1&gt;2&amp;gt; Name the labels Ln,...,L3,L2,L1; decreasing from start (Leftmost=Ln) to finish (Rightmost=L1).&amp;nbsp; &lt;BR&gt;&lt;FONT color=#808080&gt;If at any point in this algorithm the result demands &amp;gt;n labels, getPrivateDomain returns "". &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#008040 size=1&gt;3&amp;gt; Check n &amp;gt; 1.&amp;nbsp; If not, there's no PublicSuffix, just a plainhostname. Return ""; exit.&amp;nbsp; &lt;BR&gt;&lt;FONT color=#808080&gt;Dotless FQDNs consist of a host only, there is no domain. &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#008040 size=1&gt;4&amp;gt; Check L1 == "tv".&amp;nbsp; If so, getPrivateDomain returns L2.L1; exit.&amp;nbsp; &lt;BR&gt;&lt;FONT color=#808080&gt;"tv" is a special-case "completely flat" ccTLD for historical reasons.&lt;/FONT&gt; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#008040 size=1&gt;5&amp;gt; Check Len(L1) &amp;gt; 2.&amp;nbsp; If so, getPrivateDomain returns L2.L1; exit.&amp;nbsp; &lt;BR&gt;&lt;FONT color=#808080&gt;Len(L1)&amp;gt;2 suggests L1 is a gTLD rather than a ccTLD.&amp;nbsp; &lt;BR&gt;If Len(L1)&amp;lt;=2 we assume L1 is a part of a ccTLD.&lt;/FONT&gt; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#008040 size=1&gt;6&amp;gt; Check if L2 in gTLD list "com,edu,net,org,gov,mil,int".&amp;nbsp; If so, getPrivateDomain returns L3.L2.L1; exit.&amp;nbsp; &lt;BR&gt;&lt;FONT color=#808080&gt;gTLDs, when they appear immediately left of a ccTLD (modulo exception in step 4), are considered a part of the Public Suffix.&lt;/FONT&gt; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#008040 size=1&gt;7&amp;gt; If L1 is in the list "GR,PL" AND L2 is NOT in the gTLD list, getPrivateDomain returns L2.L1; exit.&amp;nbsp; &lt;BR&gt;&lt;FONT color=#808080&gt;GR and PL are considered "flat" ccTLDs EXCEPT when a gTLD appears in L2.&amp;nbsp; &lt;BR&gt;getPrivateDomain("a.pl") returns "a.pl"&amp;nbsp; &lt;BR&gt;getPrivateDomain("a.uk") returns ""&lt;/FONT&gt; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#008040 size=1&gt;8&amp;gt; If Len(L2) &amp;lt; 3 getPrivateDomain returns L3.L2.L1; exit.&amp;nbsp; &lt;BR&gt;&lt;FONT color=#808080&gt;getPrivateDomain("aa.bb.cc") returns "aa.bb.cc"&lt;/FONT&gt; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size=1&gt;&lt;FONT color=#008040&gt;9&amp;gt; Otherwise, getPrivateDomain returns L2.L1&amp;nbsp; &lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#808080&gt;getPrivateDomain("aa.bbb.cc") returns "bbb.cc" &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;While this heuristic worked pretty well for many years (and still works reasonably well in general) it clearly was becoming increasingly complicated due to the fact that each ccTLD established different operating practices (and those, in turn, changed over time).&lt;/P&gt;
&lt;H2&gt;Changes in Internet Explorer 8&lt;/H2&gt;
&lt;P&gt;For IE8, we’ve updated major codepaths to use CURI’s Uri_PROPERTY_DOMAIN for Private Domain determination, helping to ensure consistency throughout the various browser components. &lt;/P&gt;
&lt;P&gt;IE8's version of URLMon maintains a list of special-cases which are used as exceptions to the default heuristics that CURI uses. You can click &lt;A href="res://urlmon.dll/ietldlist.xml" mce_href="res://urlmon.dll/ietldlist.xml"&gt;this link&lt;/A&gt; to view the list&amp;nbsp;maintained as an XML resource inside URLMon.dll. The list contains elements which should be treated as Public Suffixes (the XML nodes named “tld”) and elements which should be treated as private domains (the XML nodes named “domain”).&lt;/P&gt;
&lt;P&gt;From a browser architecture perspective, lists like this one are the option of last resort, for a number of important reasons. However, there’s no currently no standard that promises relief. One proposal which has been discussed in a few forums is to allow the DNS itself to indicate (via a new record) which names are part of a Public Suffix and which are part of a Private Domain, but that approach is &lt;A href="http://www.mail-archive.com/dnsop@ietf.org/msg01002.html" mce_href="http://www.mail-archive.com/dnsop@ietf.org/msg01002.html"&gt;not without problems&lt;/A&gt;.&lt;/P&gt;
&lt;H2&gt;The (Coming) Challenges with gTLDS&lt;/H2&gt;
&lt;P&gt;ICANN &lt;A href="http://news.bbc.co.uk/2/hi/technology/7475986.stm" mce_href="http://news.bbc.co.uk/2/hi/technology/7475986.stm"&gt;recently voted&lt;/A&gt; to allow organizations to create new generic TLDs. Introduction of new gTLDs may introduce additional problems, because previously most of the “special cases” were found only in ccTLDs. Other parties (like Certificate Authorities) would also likely be significantly impacted by this liberalization of gTLDs.&lt;/P&gt;
&lt;P&gt;As this area is still developing, it will likely be the topic of a future post.&lt;/P&gt;
&lt;P&gt;Until then…&lt;/P&gt;
&lt;P&gt;-Eric &lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9897015" width="1" height="1"&gt;</content><author><name>EricLaw</name><uri>http://blogs.msdn.com/members/EricLaw.aspx</uri></author><category term="design" scheme="http://blogs.msdn.com/ieinternals/archive/tags/design/default.aspx" /><category term="Security" scheme="http://blogs.msdn.com/ieinternals/archive/tags/Security/default.aspx" /><category term="standards" scheme="http://blogs.msdn.com/ieinternals/archive/tags/standards/default.aspx" /><category term="ie8" scheme="http://blogs.msdn.com/ieinternals/archive/tags/ie8/default.aspx" /><category term="cookies" scheme="http://blogs.msdn.com/ieinternals/archive/tags/cookies/default.aspx" /><category term="webdev" scheme="http://blogs.msdn.com/ieinternals/archive/tags/webdev/default.aspx" /></entry><entry><title>Two New Tools Available from the SDL Team</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/ieinternals/archive/2009/09/18/BinScope-and-MiniFuzz-Released-by-the-SDL-Team.aspx" /><id>http://blogs.msdn.com/ieinternals/archive/2009/09/18/BinScope-and-MiniFuzz-Released-by-the-SDL-Team.aspx</id><published>2009-09-18T04:18:00Z</published><updated>2009-09-18T04:18:00Z</updated><content type="html">&lt;P&gt;Yesterday, IE Team alumnus Jeremy Dallman posted over on the Security Development Lifecycle team’s blog, announcing the &lt;A href="http://blogs.msdn.com/sdl/archive/2009/09/16/two-new-security-tools-for-your-sdl-tool-belt-bonus-a-7-easy-steps-whitepaper.aspx" mce_href="http://blogs.msdn.com/sdl/archive/2009/09/16/two-new-security-tools-for-your-sdl-tool-belt-bonus-a-7-easy-steps-whitepaper.aspx"&gt;release of BinScope and MiniFuzz&lt;/A&gt;. These two tools are part of the toolset that the Internet Explorer team uses to help verify the security of our product code. &lt;/P&gt;
&lt;P&gt;If you’re building an Internet Explorer add-on (or any other product really), they’re great (free) additions to your toolbox to help ensure that the bad guys can’t abuse your code. The SDL team also posted two demo videos (&lt;A href="http://edge.technet.com/Media/binscope-overview-and-demo/" mce_href="http://edge.technet.com/Media/binscope-overview-and-demo/"&gt;BinScope video&lt;/A&gt; &amp;amp; &lt;A href="http://edge.technet.com/Media/minifuzz-overview-and-demo/" mce_href="http://edge.technet.com/Media/minifuzz-overview-and-demo/"&gt;MiniFuzz video&lt;/A&gt;) explaining the tools, and a &lt;A href="http://go.microsoft.com/?linkid=9683340" mce_href="http://go.microsoft.com/?linkid=9683340"&gt;whitepaper&lt;/A&gt; on how to integrate the SDL into an existing VSTS project.&lt;/P&gt;
&lt;P&gt;-Eric&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9896606" width="1" height="1"&gt;</content><author><name>EricLaw</name><uri>http://blogs.msdn.com/members/EricLaw.aspx</uri></author><category term="Security" scheme="http://blogs.msdn.com/ieinternals/archive/tags/Security/default.aspx" /><category term="Best-Practices" scheme="http://blogs.msdn.com/ieinternals/archive/tags/Best-Practices/default.aspx" /><category term="dev" scheme="http://blogs.msdn.com/ieinternals/archive/tags/dev/default.aspx" /></entry></feed>