<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Microsoft RSS Blog : Security</title><link>http://blogs.msdn.com/rssteam/archive/tags/Security/default.aspx</link><description>Tags: Security</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Securing feed enclosures</title><link>http://blogs.msdn.com/rssteam/archive/2006/09/20/Securing-feed-enclosures.aspx</link><pubDate>Thu, 21 Sep 2006 01:25:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:763966</guid><dc:creator>rss</dc:creator><slash:comments>22</slash:comments><comments>http://blogs.msdn.com/rssteam/comments/763966.aspx</comments><wfw:commentRss>http://blogs.msdn.com/rssteam/commentrss.aspx?PostID=763966</wfw:commentRss><description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Greetings, 
&lt;P&gt;I am one of the developers on the RSS team, and to complement &lt;A href="http://blogs.msdn.com/rssteam/archive/2006/09/09/747111.aspx"&gt;Sean’s&lt;/A&gt; and &lt;A href="http://blogs.msdn.com/rssteam/archive/2006/08/07/691248.aspx"&gt;Walter’s&lt;/A&gt; recent postings on feed security, I would like to talk about one topic that didn’t get as much attention in recent discussions on feed security as perhaps it should have - feed enclosures. Enclosures are files “attached” to feed items, commonly used in &lt;A href="http://en.wikipedia.org/wiki/Podcasting"&gt;podcasting&lt;/A&gt; and often automatically downloaded to user’s machine by aggregators. 
&lt;P&gt;In IE7 and the Windows RSS Platform, we have taken a number of precautions to protect users and developers against feeds which may attempt to use enclosures in malicious ways. 
&lt;P&gt;To begin with, when a user subscribes to a feed in IE7 enclosure downloads are turned off by default. Users can easily opt-in to enclosure downloads via the feed properties. 
&lt;P&gt;We also treat enclosures as inherently un-trusted files – in many ways similar to email attachments. We decided not to permit directly-executable (i.e. any file that would execute arbitrary code when double-clicked) or other dangerous files to be downloaded as feed enclosures (there are no common scenarios that require this today, and if it is absolutely necessary, it is possible to wrap an executable file in another format, so that it is no longer directly executable). For this we use the most flexible mechanism possible, the &lt;A href="http://msdn.microsoft.com/security/productinfo/XPSP2/emailhandling.aspx"&gt;Attachment Execution Service&lt;/A&gt; (AES). In simple terms, the AES maintains a list of file extensions that are considered dangerous, including the directly-executable file types, which the RSS platform consults to decide whether or not to block a file. 
&lt;P&gt;Besides blocking the dangerous file types, AES also has a mechanism which allows security programs, such as anti-virus or anti-spyware, to integrate with it, allowing them to inspect files before we make them available to developers or users. &lt;A href="http://www.microsoft.com/athome/security/spyware/software/default.mspx"&gt;Windows Defender&lt;/A&gt; has implemented this integration, so on Windows Vista (or if the user has installed Windows Defender on Windows XP), the user will gain that additional level of protection from the malicious files. 
&lt;P&gt;IE also has a mechanism to block file downloads on a per-zone basis, so before fetching the enclosure we also verify that downloads are allowed for the URL. You can find this per-zone setting in your Internet Options, under Security tab. The simplest way to prevent enclosure downloads from a site is to add it to the Restricted Zone, where downloads are disabled by default. 
&lt;P&gt;If an enclosure download does get blocked for security reasons, this is reported in the feed view as well as through the RSS platform’s &lt;A href="http://windowssdk.msdn.microsoft.com/en-us/library/ms684724.aspx"&gt;LastDownloadError&lt;/A&gt; property. 
&lt;P&gt;Downloaded enclosures are stored in a subfolder of the Temporary Internet Files folder. The full path to the enclosures is different on every machine, preventing malicious feeds or other malicious code from using enclosure downloads as a vector to get known files on the system, as well as ensuring that other applications don’t unknowingly access enclosure files. If an application wants access to the downloaded enclosures it needs to &lt;A href="http://windowssdk.msdn.microsoft.com/en-us/library/ms684730.aspx"&gt;obtain the path from the RSS platform&lt;/A&gt;. 
&lt;P&gt;&lt;B&gt;To summarize&lt;/B&gt;: enclosures are treated as un-trusted files, and the following security mitigations are used: 
&lt;UL&gt;
&lt;LI&gt;Enclosure download is off by-default for all feeds. 
&lt;LI&gt;Directly-executable files are blocked from being downloaded, using the Windows Attachment Execution Service (AES). 
&lt;LI&gt;Anti-virus and Anti-spyware applications (like Windows Defender) can integrate with AES to dynamically block malicious files. 
&lt;LI&gt;Files are stored in a variable location on each PC, ensuring that applications must opt-in to consuming the enclosures.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;As before, we want to make sure all aggregator developers know that the tools we are using to make IE and the RSS platform more secure are available for their use as well: 
&lt;UL&gt;
&lt;LI&gt;AES can be utilized through the &lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/ifaces/iattachmentexecute/iattachmentexecute.asp"&gt;IAttachmentExecute&lt;/A&gt; interface. 
&lt;LI&gt;To determine if file downloads are allowed, applications can invoke the &lt;A href="http://windowssdk.msdn.microsoft.com/en-us/library/ms537136.aspx"&gt;ProcessUrlAction&lt;/A&gt; method to query for &lt;A href="http://msdn.microsoft.com/library/default.asp?url=/workshop/security/szone/reference/constants/urlaction.asp"&gt;URLACTION_SHELL_FILE_DOWNLOAD&lt;/A&gt;. &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Once again, we would like to reiterate our commitment to working with the community to improve feed security, and as always we are open for your feedback and questions. 
&lt;P&gt;Thank you, 
&lt;P&gt;Miladin&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Update 9/25/2006: Added a summary paragraph for clarity&lt;/EM&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=763966" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/rssteam/archive/tags/RSS+Platform/default.aspx">RSS Platform</category><category domain="http://blogs.msdn.com/rssteam/archive/tags/RSS+Support+in+IE/default.aspx">RSS Support in IE</category><category domain="http://blogs.msdn.com/rssteam/archive/tags/Security/default.aspx">Security</category></item><item><title>More on Feed Security</title><link>http://blogs.msdn.com/rssteam/archive/2006/09/09/More-on-Feed-Security.aspx</link><pubDate>Sat, 09 Sep 2006 03:31:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:747111</guid><dc:creator>rss</dc:creator><slash:comments>13</slash:comments><comments>http://blogs.msdn.com/rssteam/comments/747111.aspx</comments><wfw:commentRss>http://blogs.msdn.com/rssteam/commentrss.aspx?PostID=747111</wfw:commentRss><description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Shortly after the &lt;A href="http://www.spidynamics.com/"&gt;SPI Dynamics&lt;/A&gt; presentation&amp;nbsp;that sparked a renewed discussion on feed security in the community last month, &lt;A href="http://www.snellspace.com/"&gt;James Snell&lt;/A&gt; developed a suite of tests (based on an earlier set by &lt;A href="http://www.xn--8ws00zhy3a.com/"&gt;James Holderness&lt;/A&gt;), and generously made them available quietly to aggregator developers. He has now made the tests &lt;A href="http://www.snellspace.com/wp/?p=448"&gt;public&lt;/A&gt;. 
&lt;P&gt;I contacted James last month (via email&amp;nbsp;as he requested)&amp;nbsp;and he pointed me to the test suite, so we could test them against our own security mitigations. We have done full test passes using his test suite. 
&lt;P&gt;The result:&lt;B&gt; &lt;/B&gt;IE7 passed all of the tests&lt;B&gt; &lt;/B&gt;(which means that no script from the feeds executed successfully in IE, and that developers using the RSS platform would not have been vulnerable to the class of attacks in the tests). This confirms SPI Dynamic's findings that IE7 was not vulnerable to the attacks described in their paper. 
&lt;P&gt;I thought it might be useful to use this opportunity to talk about our commitment to security, the defense-in-depth strategy that we have taken, and how other aggregator developers might benefit from the work we have done. 
&lt;P&gt;&lt;I&gt;&lt;/I&gt;
&lt;P&gt;&lt;I&gt;Our commitment to security&lt;/I&gt; 
&lt;P&gt;To put it bluntly, we are&amp;nbsp;keenly aware that IE is a target for security researchers and hackers. We know we cannot afford to be lax in how we approach security. &lt;B&gt;It has therefore been&amp;nbsp;our #1 guiding principle that we would aim for a secure experience first -- sacrificing functionality, if necessary, to achieve it.&amp;nbsp;&lt;/B&gt; 
&lt;P&gt;Long-time readers may remember &lt;A href="http://blogs.msdn.com/rssteam/archive/2005/11/03/489065.aspx"&gt;this&lt;/A&gt; post from last November, in which we announced that we would only support well-formed XML in feeds -- the post was the direct result of a long internal discussion about ways to securely handle malicious feeds. Refusing to handle malformed XML eliminates a large class of potential attacks. 
&lt;P&gt;Walter &lt;A href="http://blogs.msdn.com/rssteam/archive/2006/08/07/691248.aspx"&gt;posted&lt;/A&gt; last month on the details of how IE7 and the Windows RSS Platform protect users and developers from script in feeds. To summarize what he wrote, IE7 employs a (roughly) two-level defense-in-depth strategy: 
&lt;UL&gt;
&lt;LI&gt;&lt;B&gt;Sanitization&lt;/B&gt;: First, the Windows RSS Platform uses several techniques to strip out script (and several other variations of malicious HTML) before storing the feed content. 
&lt;LI&gt;&lt;B&gt;Restricted Feed View&lt;/B&gt;: Second, &lt;I&gt;just in case&lt;/I&gt; the first step misses something, IE's feed view uses a variation on the &lt;A href="http://msdn.microsoft.com/library/default.asp?url=/workshop/security/szone/overview/overview.asp"&gt;Restricted Zone&lt;/A&gt; to show a feed, meaning that no script in a feed will run, even if made it through the previous step.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Each of the two defense-in-depth steps described above require a significant amount of code and investment, but security has been always important enough to us that they where the first major pieces of development that we did when we began implementing the RSS features. &lt;B&gt;In fact, these security features have been in place since&amp;nbsp;the &lt;/B&gt;&lt;A href="http://blogs.msdn.com/rssteam/archive/2006/02/02/522642.aspx"&gt;&lt;B&gt;first public release&lt;/B&gt;&lt;/A&gt;&lt;B&gt; of the IE7 RSS platform features last February&lt;/B&gt;.&lt;B&gt; &lt;/B&gt;
&lt;P&gt;To give you a sense of what is involved -- at one point in development, the sanitization code accounted for fully &lt;I&gt;one-third&lt;/I&gt; of all the code in the RSS platform. The code takes lessons from similar libraries used for years to clean the billions of messages that Hotmail receives, and used for a number of releases in various parts of Office.&amp;nbsp; It includes a number of feed-specific additions (for example, if an element is supposed to&amp;nbsp;only contain text, then we can remove all HTML, not just the script).&amp;nbsp;We validate and sanitize&amp;nbsp;every documented element in each format we support, as well as a set of common RSS extensions. This is all done before an item is ever stored on the system. 
&lt;P&gt;In IE itself, the "restricted feed view" was also a significant challenge because of the interactive nature of a feed view.&amp;nbsp;We designed and developed a feed view that required no javascript for the various controls (subscribing, filtering, sorting, or searching) to work. In fact, the IE7 feed view implementation is effectively that described by Nick Bradbury in his recent &lt;A href="http://nick.typepad.com/blog/2006/09/feed_security_a.html"&gt;post&lt;/A&gt;&amp;nbsp;on feed security (using a script-less page, and manipulating the view from the hosting code). 
&lt;P&gt;&lt;B&gt;The bottom line is that IE takes security &lt;I&gt;very&lt;/I&gt; seriously.&lt;/B&gt; We have invested a great deal of time in hardening IE7 across the board, and nowhere more seriously than in our RSS features. It is an ongoing process, however, and we deeply appreciate the efforts of those in the community who have developed additional security tests and allowed us to use them. 
&lt;P&gt;&lt;I&gt;Looking forward&lt;/I&gt; 
&lt;P&gt;We also look forward to continuing to work with the community to improve&amp;nbsp;the security of all aggregators.&amp;nbsp;To that end, we want to make a couple offers to developers of Windows aggregator developers:&amp;nbsp; 
&lt;UL&gt;
&lt;LI&gt;First,&amp;nbsp;you should feel free to &lt;A href="mailto:teamrss@microsoft.com"&gt;contact us&lt;/A&gt;&amp;nbsp;if you have questions that come up while implementing a fully restricted feed view using the techniques that Nick talked about in his post. If there is enough demand, we may write a blog post on how the IE feed view is built, so people can learn from what we’ve done.&amp;nbsp; 
&lt;LI&gt;Second, the&amp;nbsp;&lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/FeedsAPI/rss/rss_entry.asp"&gt;Feeds API&lt;/A&gt;&amp;nbsp;includes a utility function called &lt;A href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/FeedsAPI/rss/reference/ifaces/ifeedsmanager/normalize.asp?frame=true"&gt;Normalize&lt;/A&gt;(), which can be used to gain access to the platform's HTML sanitization code.&amp;nbsp;Contact us if you'd like more information on how you could use this to supplement your own sanitization code.&amp;nbsp; 
&lt;LI&gt;Finally, I’ll make the obvious point that the entire platform is available for your use, including not just the security features described here, but storage and a suite of&amp;nbsp;&lt;A href="http://blogs.msdn.com/rssteam/archive/2006/04/08/571509.aspx"&gt;bandwidth management&lt;/A&gt; features. I understand, of course, that for many existing aggregator developers, switching storage and download engines may be too significant a change in their applications, but I do want to encourage developers of new applications to consider it. &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Thanks for reading,&lt;BR&gt;Sean 
&lt;P&gt;PS. Of course, there will be some readers who see this post as a challenge and start looking for exploits in IE's RSS features. If you do find any, please let us know! :)&amp;nbsp;We know that no security is perfect, and that it is an on-going process.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=747111" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/rssteam/archive/tags/RSS+Platform/default.aspx">RSS Platform</category><category domain="http://blogs.msdn.com/rssteam/archive/tags/RSS+Support+in+IE/default.aspx">RSS Support in IE</category><category domain="http://blogs.msdn.com/rssteam/archive/tags/Security/default.aspx">Security</category></item><item><title>Script in Feeds</title><link>http://blogs.msdn.com/rssteam/archive/2006/08/07/Script-in-Feeds.aspx</link><pubDate>Mon, 07 Aug 2006 21:31:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:691248</guid><dc:creator>rss</dc:creator><slash:comments>21</slash:comments><comments>http://blogs.msdn.com/rssteam/comments/691248.aspx</comments><wfw:commentRss>http://blogs.msdn.com/rssteam/commentrss.aspx?PostID=691248</wfw:commentRss><description>&lt;P&gt;You might have read the c|net article "&lt;A href="http://news.com.com/Blog+feeds+may+carry+security+risk/2100-1002_3-6102171.html?tag=nl?"&gt;Blog feeds may carry security risk&lt;/A&gt;" which summarizes the &lt;A href="http://www.blackhat.com/html/bh-usa-06/bh-usa-06-speakers.html"&gt;presentation&lt;/A&gt; given by Robert Auger &lt;STRIKE&gt;and Caleb Sima&lt;/STRIKE&gt; of SPI Dynamics. The presentation points to potential dangers of malicious script&amp;nbsp;embedded in feeds. This has sparked &lt;A href="http://www.niallkennedy.com/blog/archives/2006/08/black-hat-prese.html"&gt;some&lt;/A&gt; &lt;A href="http://www.intertwingly.net/blog/2006/08/04/Feeds-As-Attack-Delivery-Systems"&gt;discussion&lt;/A&gt; in the community. &lt;/P&gt;
&lt;P&gt;We think it's good for the RSS community and users that the potential dangers of malicious script in feeds&amp;nbsp;are pointed out and thereby can be addressed by application developers before any attacks materialize. &lt;/P&gt;
&lt;P&gt;In IE7 and the Windows RSS Platform we've implemented several mitigations that specifically address potentially malicious scripts in feeds: &lt;/P&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;P&gt;&lt;STRONG&gt;Sanitization &lt;BR&gt;&lt;/STRONG&gt;When downloading feeds, the RSS Platform passes the feed through a sanitization process which among other things removes script from HTML fields like the description&amp;nbsp;element. Also, text fields, like the title element, are treated as text and not as HTML, so HTML tags are entity encoded. These steps are performed before the feed content is accessible by application including IE7's Feed View. Further, the feed content is persisted in the Feed Store in the sanitized form, so that applications accessing the feed data benefit from the sanitization. &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Feed View in Restricted zone &lt;BR&gt;&lt;/STRONG&gt;The IE7 Feed View displays feeds in the &lt;A href="http://msdn.microsoft.com/workshop/security/szone/overview/overview.asp?frame=true"&gt;Restricted security zone&lt;/A&gt;, no matter where the feed originated, even if for example the feed came from a site in the &lt;EM&gt;Trusted Sites &lt;/EM&gt;zone. By default script is disabled in the &lt;EM&gt;Restricted&lt;/EM&gt; zone. In addition, the Feed View disallows &lt;A href="http://msdn.microsoft.com/workshop/security/szone/overview/overview.asp?frame=true"&gt;URL Actions&lt;/A&gt; including script and active content.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;We designed and implemented the RSS features using the principles of the &lt;A href="http://msdn.microsoft.com/msdnmag/issues/05/11/SDL/"&gt;Secure Development Lifecycle&lt;/A&gt; as embraced by Microsoft.&amp;nbsp; One of the principles is &lt;EM&gt;defense in depth&lt;/EM&gt;. The idea being, even if script somehow were to sneak by the first layer of defense, the impact that the script could have is restricted, if not entirely negated. &lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;STRONG&gt;Hosting IE in Applications &lt;BR&gt;&lt;/STRONG&gt;The second mitigation above can be of interest to application developers who are hosting MSHTML inside their applications. When using MSHTML to render feeds, we recommend that the host application implements a &lt;A href="http://msdn.microsoft.com/workshop/security/szone/overview/impl_secmanager.asp"&gt;custom security manager&lt;/A&gt;, which allows the application to control which URL Actions are permissible. In order to reduce the attack surface of the application it is advisable to limit the permissible URL Actions to the smallest number possible. &lt;/P&gt;
&lt;P&gt;I hope this will spark even more discussion about security and RSS which will ultimately benefit users. &lt;/P&gt;
&lt;P&gt;- Walter vonKoch &lt;/P&gt;
&lt;P&gt;[Update 8/16] Peter Plamondon of SPI Dynamics provided the &lt;A href="http://www.spidynamics.com/assets/documents/HackingFeeds.pdf"&gt;link&lt;/A&gt; to the paper itself in the comments.&lt;/P&gt;
&lt;P&gt;[Update 8/17] As noted by Sean Kerner in the comments, the presentation was given by Bob Auger solo. I've correct the intro above. Thanks.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=691248" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/rssteam/archive/tags/RSS+Platform/default.aspx">RSS Platform</category><category domain="http://blogs.msdn.com/rssteam/archive/tags/RSS+Support+in+IE/default.aspx">RSS Support in IE</category><category domain="http://blogs.msdn.com/rssteam/archive/tags/Security/default.aspx">Security</category></item></channel></rss>