<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="www.w3.org/2005/Atom" xmlns:sy="purl.org/rss/1.0/modules/syndication/" xmlns:dc="purl.org/dc/elements/1.1/" xmlns:content="purl.org/rss/1.0/modules/content/" xmlns:wfw="wellformedweb.org/CommentAPI/" xmlns:slash="purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>random dross</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/dross/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/dross/feed.xml</link>
    <description>Web security and beyond...</description>
    <lastBuildDate>Wed, 17 Apr 2019 03:20:30 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>My blog has moved...</title>
      <link>https://docs.microsoft.com/archive/blogs/dross/my-blog-has-moved</link>
      <pubDate>Mon, 04 Aug 2014 13:06:03 GMT</pubDate>
      <dc:creator><![CDATA[dross]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/dross/2014/08/04/my-blog-has-moved/</guid>
      <description><![CDATA[My blog has moved to randomdross.blogspot.com. &nbsp;Please update your RSS readers, etc.]]></description>
      <content:encoded><![CDATA[<p>My blog has moved to <a title="randomdross.blogspot.com" href="https://randomdross.blogspot.com">randomdross.blogspot.com</a>. &nbsp;Please update your RSS readers, etc.</p>]]></content:encoded>
    </item>
    <item>
      <title>Hyperlink Spoofing and the Modern Web</title>
      <link>https://docs.microsoft.com/archive/blogs/dross/hyperlink-spoofing-and-the-modern-web</link>
      <pubDate>Thu, 26 Apr 2012 12:11:22 GMT</pubDate>
      <dc:creator><![CDATA[dross]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/dross/2012/04/26/hyperlink-spoofing-and-the-modern-web/</guid>
      <description><![CDATA[Over the past six months or so I&rsquo;ve been looking at hyperlink spoofing threats as a bit of a...]]></description>
      <content:encoded><![CDATA[<p>Over the past six months or so I&rsquo;ve been looking at hyperlink spoofing threats as a bit of a part-time project.&nbsp; I&rsquo;ve primarily been interested in how the design of social networking platforms impacts the ability of their users to make good trust decisions regarding hyperlinks.&nbsp; The interaction between social networking services and short-link services has also shown to be worthy of some analysis.</p>
<p>While the issues in this space don&rsquo;t tend to rank highly &ldquo;on a scale of one to l33t,&rdquo; I found it to be an interesting area because existing design practices appear inconsistent and suboptimal with regard to security.</p>
<p>As social networking platforms are changing very rapidly, the specific examples in this write-up will become dated quickly, if that isn&rsquo;t already the case.&nbsp; I'm more hopeful that the enumeration of issue types as well as the conclusions / recommendations in this write-up will stay relevant in the future.</p>
<p><a title="Hyperlink Spoofing and the Modern Web" href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/47/30/5340.Hyperlink%20Spoofing%20and%20the%20Modern%20Web%20(final).pdf" original-url="blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-47-30/5340.Hyperlink-Spoofing-and-the-Modern-Web-_2800_final_2900_.pdf">Hyperlink Spoofing and the Modern Web</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Creating XSS</title>
      <link>https://docs.microsoft.com/archive/blogs/dross/creating-xss</link>
      <pubDate>Wed, 25 Apr 2012 14:56:00 GMT</pubDate>
      <dc:creator><![CDATA[dross]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/dross/2012/04/25/creating-xss/</guid>
      <description><![CDATA[I&rsquo;ve seen MS10-002 pop up a few times in discussion recently.&nbsp; This is a reference to the...]]></description>
      <content:encoded><![CDATA[<p>I&rsquo;ve seen <a title="MS10-002" href="https://technet.microsoft.com/en-us/security/bulletin/MS10-002">MS10-002</a> pop up a few times in discussion recently.&nbsp; This is a reference to the legendary issue that David Lindsay and Eduardo Vela Nava discovered, where neutering for a given <a title="heuristic" href="blogs.technet.com/b/srd/archive/2008/08/19/ie-8-xss-filter-architecture-implementation.aspx">heuristic</a> actually enabled XSS, assuming attacker control of data inside a properly quoted HTML attribute.&nbsp;&nbsp;I'd like to share&nbsp;some&nbsp;detail&nbsp;about the tools the&nbsp;XSS Filter has at its disposal as they&nbsp;apply to defeating this sort of attack in a general sense.</p>
<p>The XSS Filter&rsquo;s approach has always relied on taking great care not to neuter characters which can alter context.&nbsp; For example, if we were to neuter a double quote, that could have the unintended side-effect of activating script otherwise safely contained within a javascript string in some other part of the page.&nbsp; The bug addressed&nbsp;by&nbsp;<a title="MS10-002" href="https://technet.microsoft.com/en-us/security/bulletin/MS10-002">MS10-002</a> was not <em>quite</em> as obvious, but along the same lines.</p>
<p>Neutering is an attempt to cleverly target XSS as it may manifest on a given page.&nbsp; But one thing that often goes unnoticed is that the XSS Filter is actually empowered to take various different approaches to mitigate XSS.&nbsp; And it can do this on a per-heuristic basis.&nbsp; In other words, given any identified issue with the neutering approach for a heuristic, we are able to choose from various different possible mitigations (Eg: <a title="mode=block" href="https://blogs.msdn.com/b/ieinternals/archive/2011/01/31/controlling-the-internet-explorer-xss-filter-with-the-x-xss-protection-http-header.aspx">mode=block</a>), specifically applied for that heuristic.&nbsp; In that way it is possible to disable attacks with a larger hammer as necessary, without forcing the XSS Filter to apply in any situations where it didn&rsquo;t apply before.</p>]]></content:encoded>
    </item>
    <item>
      <title>XSS Filter Tech: Later is Better?</title>
      <link>https://docs.microsoft.com/archive/blogs/dross/xss-filter-tech-later-is-better</link>
      <pubDate>Tue, 20 Dec 2011 10:31:00 GMT</pubDate>
      <dc:creator><![CDATA[dross]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/dross/2011/12/20/xss-filter-tech-later-is-better/</guid>
      <description><![CDATA[Arcane design decisions can have subtle but important effects on the characteristics of a security...]]></description>
      <content:encoded><![CDATA[<p>Arcane design decisions can have subtle but important effects on the characteristics of a security mitigation.&nbsp; Consider how client-side XSS filtering might examine a given HTTP response for evidence of a reflected attack.&nbsp; Is it more sensible to examine the response before or after that response is processed in the browser?</p>
<p>An easy answer might be that it&rsquo;s better to examine the response <em>after</em> processing, as this is when the true meaning of the response is most apparent.&nbsp; While this makes sense intuitively, it turns out that later matching may be considered suboptimal.&nbsp; Let&rsquo;s explore why.</p>
<h4>Transformations Everywhere</h4>
<p>As suggested above, modern client-side XSS filtering techniques attempt to identify request data that has been reflected into the response.&nbsp; Transformations on this data will always have the potential to reduce a filter&rsquo;s ability to successfully make a match.&nbsp; Some transformations may occur at the server, and since the XSS filter has no way of preventing this, it must compensate.&nbsp; XSS filters do in fact <a title="XSS Filter Improvements in IE8 RC1" href="blogs.technet.com/b/srd/archive/2009/01/30/xss-filter-improvements-in-ie8-rc1.aspx">compensate for server-side transformations</a>.</p>
<p>But at the same time, transformations occur on the client side as a response is parsed and makes it way out to the HTML DOM and/or script engine.&nbsp; For a filter that delays matching until after a response is processed by the browser, transformations will apply prior to matching and can inhibit successful matching.&nbsp; This manifests as a filter bypass scenario, or false negative.</p>
<p>In fact, transformations that may occur in various places within the browser codebase are not generally regarded as security related, so they may get introduced, change, or disappear over time without any warning.</p>
<h4>Example</h4>
<p>Consider the following filter bypass scenario that affected a very old version of Chrome (4.0.249.89):</p>
<p><span style="font-family: courier new,courier;">Benchmark:</span><br /><span style="font-family: courier new,courier;">foo?x=&lt;IFRAME%20src='javascript:alert(1)'&gt;</span></p>
<p><span style="font-family: courier new,courier;">Bypass:&nbsp; </span><br /><span style="font-family: courier new,courier;">foo?x=&lt;IFRAME%20src='javascript:alert%26%23x25;281)'&gt;</span></p>
<p>This issue was reported several years ago and subsequently resolved.</p>
<p>Observe how the open-parenthesis is replaced with its HTML encoding, <span style="font-family: courier new,courier;">&amp;#x25;</span>.&nbsp; Because browsers automatically HTML-decode attributes, the <span style="font-family: courier new,courier;">&amp;#x25;</span> is able to substitute for open-parenthesis in this context.&nbsp; But given a post-parsing matching process, the <span style="font-family: courier new,courier;">&amp;#x25;</span> present in the URL will no longer match the open-parenthesis present in the actual script!</p>
<h4>Conclusions</h4>
<p>It is not simply a matter of later matching being inherently &ldquo;better.&rdquo;&nbsp; As you can see from the example above, there is a real tradeoff &ndash; while a late-matching technique may be able to more specifically target an attack for disablement, it loses some ability to accurately <em>identify</em> an attack.</p>
<p>In any manifestation of this problem, it would seem that there are several approaches to mitigate the threat:</p>
<ol>
<li>Move the matching process to occur before parsing.&nbsp; This may be difficult if matching is entirely context-dependent.&nbsp; Eg: If there are no <a title="IE 8 XSS Filter Architecture / Implementation" href="blogs.technet.com/b/srd/archive/2008/08/19/ie-8-xss-filter-architecture-implementation.aspx">regular expression heuristics</a> to identify what an attack actually looks like, reflection detected before parsing may be too generic to flag as a potential attack.<br />&nbsp;</li>
<li>Simulate HTML encoding behavior in matching.<br />&nbsp;</li>
<li>Change the browser to remove automatic HTML decoding in attributes.&nbsp; Unfortunately though this is a bit of a non-starter.&nbsp; The automatic HTML decoding is supported cross-browser and removing it would trigger application compatibility issues.</li>
</ol>
<p>Taking an early-matching approach, the Internet Explorer XSS Filter still must account for the behavior of the HTML parser so as to properly identify attacks.&nbsp; It does this in a way that is designed into its core architecture &ndash; using a flexible regular expression heuristic.</p>
<p>Refining a regular expression has a number of advantages relative to alternative approaches to addressing bypass scenarios like the one described above.&nbsp; Specifically:</p>
<ul>
<li>Straightforward implementation and testing</li>
<li>Consistency across fixes</li>
<li>Easier to reason about overall fix approach</li>
<li>No code churn outside the core filter logic</li>
<li>Less likelihood of a performance penalty</li>
</ul>
<p>Finally, the &ldquo;later is better&rdquo; argument fails to recognize that <em>matching</em> can be decoupled from <em>blocking</em>.&nbsp; It is asserted that <em>matching</em> should occur as <strong>early as possible</strong> so as to avoid any transformations that may be observed as a response proceeds through the browser&rsquo;s internals.&nbsp; For the purposes of accuracy, <em>blocking</em> can be performed later in the process, as necessary, when the browser has determined the semantics of any suspect response fragment.</p>]]></content:encoded>
    </item>
    <item>
      <title>Enforcing Standards Mode with X-FRAME-OPTIONS</title>
      <link>https://docs.microsoft.com/archive/blogs/dross/enforcing-standards-mode-with-x-frame-options</link>
      <pubDate>Thu, 30 Jun 2011 16:39:00 GMT</pubDate>
      <dc:creator><![CDATA[dross]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/dross/2011/06/30/enforcing-standards-mode-with-x-frame-options/</guid>
      <description><![CDATA[Reduced attack surface in Standards Mode is a good step forward for XSS-Focused Attack Surface...]]></description>
      <content:encoded><![CDATA[<p><a title="Reduced attack surface in Standards Mode" href="https://blogs.msdn.com/b/ie/archive/2008/10/16/ending-expressions.aspx">Reduced attack surface in Standards Mode</a> is a good step forward for <a title="XSS-Focused Attack Surface Reduction" href="https://blogs.msdn.com/b/dross/archive/2008/03/10/xss-focused-attack-surface-reduction.aspx">XSS-Focused Attack Surface Reduction</a> in the browser.&nbsp; But it&rsquo;s necessary to prevent framing as a prerequisite to <em>enforced</em> Standards Mode.</p>
<p>Putting this into practice is pretty simple.&nbsp; First, you&rsquo;ll need a <a title="Standards Mode DOCTYPE and document compatibility header" href="https://msdn.microsoft.com/en-us/library/cc288325(v=vs.85).aspx">Standards Mode DOCTYPE and document compatibility header</a>&nbsp;on your web content, eg:</p>
<p><span style="color: #800000;"><code><span style="font-family: courier new,courier;">&lt;!DOCTYPE html&gt;</span><br /><span style="font-family: courier new,courier;">&lt;html&gt;<br />&lt;head&gt;</span><br /><span style="font-family: courier new,courier;">&nbsp; &lt;!-- Enable IE9 Standards mode --&gt;</span><br /><span style="font-family: courier new,courier;">&nbsp; &lt;meta http-equiv="X-UA-Compatible" content="IE=9" &gt;</span><br /><span style="font-family: courier new,courier;">&lt;/head&gt;</span><br /><span style="font-family: courier new,courier;">&lt;body&gt;</span><br /><span style="font-family: courier new,courier;">&hellip;</span><br /><span style="font-family: courier new,courier;">&lt;/body&gt;</span><br /><span style="font-family: courier new,courier;">&lt;/html&gt;</span></code></span></p>
<p>Then enable <a title="X-FRAME-OPTIONS" href="https://blogs.msdn.com/b/ieinternals/archive/2010/03/30/combating-clickjacking-with-x-frame-options.aspx">X-FRAME-OPTIONS</a> by setting the appropriate HTTP response header:</p>
<p><span style="color: #800000; font-family: courier new,courier;">X-FRAME-OPTIONS: DENY</span><br />&hellip;or&hellip;<br /><span style="color: #800000; font-family: courier new,courier;">X-FRAME-OPTIONS: SAMEORIGIN</span></p>
<p>Now Standards Mode will be enabled and framing-induced&nbsp;"mode inheritance" will be prevented.</p>]]></content:encoded>
    </item>
    <item>
      <title>Fuzzing for Design Bugs?</title>
      <link>https://docs.microsoft.com/archive/blogs/dross/fuzzing-for-design-bugs</link>
      <pubDate>Fri, 03 Sep 2010 10:29:40 GMT</pubDate>
      <dc:creator><![CDATA[dross]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/dross/2010/09/03/fuzzing-for-design-bugs/</guid>
      <description><![CDATA[Have you ever heard someone ask &ldquo;Do we need to fuzz this?&rdquo;
This question comes up quite...]]></description>
      <content:encoded><![CDATA[<p>Have you ever heard someone ask <em>&ldquo;Do we need to fuzz this?&rdquo;</em></p>
<p>This question comes up quite a bit in the context of reactive security work.&nbsp; There are basically two traditional answers: </p>
<ul>
<li><strong>Yes.</strong><br />When you&rsquo;re attempting to find variants of something like a memory corruption bug, fuzzing is your best friend.&nbsp; It&rsquo;s a no-brainer.<br /><br /></li>
<li><strong>No.&nbsp; Er, wait.&nbsp; Sure, uh, go for it...</strong><br />When you&rsquo;re attempting to find variants of something that looks more like a design bug, fuzzing might at first seem silly.&nbsp; The answer becomes less clear after thinking about it a little more.&nbsp; With 20/20 hindsight you can usually think up a way in which any particular bug might be caught by an automated process.&nbsp; Would that automated process fit a loose definition of fuzzing?&nbsp; Possibly.<br /><br />This intellectual discussion usually doesn&rsquo;t go very far.&nbsp; This is because of a general perception that <em>fuzzing</em> for design bugs just isn&rsquo;t going to deliver the ROI that creative hacking, code analysis, etc. can provide in a given period of time.&nbsp; But it&rsquo;s very hard to say that this is true in all cases.&nbsp; Hence the vague answer above.</li>
</ul>
<p><br /><strong><span style="font-size: medium;">Example</span></strong></p>
<p>Here&rsquo;s one simple scenario where a technique that could surely be considered <em>fuzzing</em> (and was specifically designed to identify design bugs) did yield a good result.</p>
<p>While testing the Internet Explorer XSS Filter prototype in 2007, <a href="skypher.com" title="SkyLined">SkyLined</a> identified that classic ASP would simply drop invalidly encoded character sequences from HTTP request querystring parameters prior to the HTTP response formation.&nbsp; This resulted in a situation where our filter could not properly match requests to responses and thus the filter could be bypassed for apps on classic ASP.</p>
<p>The XSS Filter was adapted to account for this situation and test cases were created.</p>
<p>Later we developed a fuzzer capable of slightly modifying test cases before running them.&nbsp; As you may imagine, it&rsquo;s not hard for a simple fuzzer to generate various forms of invalidly encoded character sequences.&nbsp;&nbsp;As it turned out,&nbsp;our fix for the encoding issue missed a corner case that our fuzzer was able to trigger.&nbsp; We were then able to fix the variant and add a new test case to cover any future regressions.</p>
<p><strong><br /><span style="font-size: medium;">Thoughts?</span></strong></p>
<p>Fuzzing for design bugs is not a new idea.&nbsp; Just in regards to XSS, it was <a href="www.phreedom.org/presentations/blackbox-reversing-of-xss-filters/blackbox-reversing-of-xss-filters.pdf" title="Blackbox Reversing of XSS Filters">mentioned by Alexander Sotirov in 2008</a>, and of course the <a href="sla.ckers.org" title="sla.ckers.org">sla.ckers</a> are well known for putting this approach into practice.&nbsp; What is most interesting to me right now is the question of when / how to apply fuzzing style techniques for design bugs in general.&nbsp; I don&rsquo;t recall ever having seen a really good answer to this question.</p>
<p>So I would be interested in your thoughts on classes of design defects that are particularly amenable to some form of fuzzing, as well as classes of design defects where fuzzing is just a waste of time.&nbsp; (Some other questions: What actions must a DOM crawler have to perform in order to be a true <em>fuzzer</em>, and does it even matter if it&rsquo;s called a fuzzer or not?)</p>
<p>Feel free to <a href="https://twitter.com/randomdross" title="randomdross on Twitter">hit me up on Twitter</a> or leave a comment on this blog.</p>]]></content:encoded>
    </item>
    <item>
      <title>Happy 10th birthday Cross-Site Scripting!</title>
      <link>https://docs.microsoft.com/archive/blogs/dross/happy-10th-birthday-cross-site-scripting</link>
      <pubDate>Tue, 15 Dec 2009 10:50:00 GMT</pubDate>
      <dc:creator><![CDATA[dross]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/dross/2009/12/15/happy-10th-birthday-cross-site-scripting/</guid>
      <description><![CDATA[On the 16th of January, 2000, the following names were suggested and bounced around among a small...]]></description>
      <content:encoded><![CDATA[<P>On the 16th of January, 2000, the following names were suggested and bounced around among a small group of Microsoft security engineers:</P>
<P><FONT color=blue>Unauthorized Site Scripting<BR>Unofficial Site Scripting<BR>URL Parameter Script Insertion<BR>Cross Site Scripting<BR>Synthesized Scripting<BR>Fraudulent Scripting</FONT></P>
<P>The next day there was consensus – Cross Site Scripting.&nbsp; In retrospect, I think this was a good choice given the options on the table.</P>
<P>By early February there was a coordinated advisory release with CERT: <BR><A href="www.cert.org/advisories/CA-2000-02.html" mce_href="www.cert.org/advisories/CA-2000-02.html">www.cert.org/advisories/CA-2000-02.html</A></P>
<P>The research leading up to the disclosure dates to mid-December 1999 – exactly ten years ago.</P>
<P>Over the years, the definition of Cross-Site Scripting has expanded somewhat.&nbsp; What we once referred to as simply “Cross Site Scripting” might now be classified as the reflected / non-persistent form of the attack.</P>
<P>Let's hope that ten years from now&nbsp;we'll&nbsp;be&nbsp;celebrating the <EM>death</EM>, not the birth, of Cross-Site Scripting!<BR></P>]]></content:encoded>
    </item>
    <item>
      <title>Current Thoughts on DNS Rebinding</title>
      <link>https://docs.microsoft.com/archive/blogs/dross/current-thoughts-on-dns-rebinding</link>
      <pubDate>Tue, 17 Nov 2009 12:38:00 GMT</pubDate>
      <dc:creator><![CDATA[dross]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/dross/2009/11/17/current-thoughts-on-dns-rebinding/</guid>
      <description><![CDATA[RSnake and Dan Kaminsky have been talking about session fixation via DNS Rebinding.&nbsp; As you may...]]></description>
      <content:encoded><![CDATA[<P>RSnake and Dan Kaminsky have been <A title=talking href="ha.ckers.org/blog/20091116/session-fixation-via-dns-rebinding/" mce_href="ha.ckers.org/blog/20091116/session-fixation-via-dns-rebinding/">talking</A> about <A title="session fixation" href="en.wikipedia.org/wiki/Session_fixation" mce_href="en.wikipedia.org/wiki/Session_fixation">session fixation</A> via <A title="DNS Rebinding" href="crypto.stanford.edu/dns/" mce_href="crypto.stanford.edu/dns/">DNS Rebinding</A>.&nbsp; As you may recall, an attacker can't abuse your Foo.com cookies in a rebinding attack, though they can walk your browser around Foo.com content and control the session.&nbsp; The gist of what these guys are talking about is how the attacker can log the victim into the <EM>attacker's</EM> session.&nbsp; Interesting stuff...</P>
<P>Dan and RSnake are big on server-side Host header validation as an anti-rebinding strategy.&nbsp; Every time I starting thinking about this, here's my basic train of thought:</P>
<OL>
<LI>Host header validation is simple, and simple is good.&nbsp; If you implement Host header validation at the server, it just works.<BR><BR></LI>
<LI>But what about everybody who <EM>doesn't</EM> conform?&nbsp; Most web sites don't conform today, and if they do it's not particularly intentional.&nbsp; I'd hate to see webappsec spend the next 10 years beating up the web properties that don't confirm.&nbsp; We'd inch the web towards real security in a sort of hostile manner.&nbsp; There must be a better way...<BR><BR></LI>
<LI>So coming at this from the other side -- what can the client-side do to help?&nbsp; The hope there is to not only empower the user to verify their rebinding defenses on any given site, but also to put leverage on the server-side to implement Host header validation (to avoid getting blocked at the more secure clients).&nbsp; As of now, a simple, practical, and comprehensive client-side anti-rebinding strategy remains elusive.&nbsp; And if client-enforced Host header validation requires a server-side tweak, say a Host header on the response, that puts us back to the problem in #2 above.<BR><BR></LI>
<LI>So with all of this, why isn’t "use SSL" the simple anti-rebinding strategy?&nbsp; In the near term, is there really a better answer?<BR></LI></OL>
<P>Now, all this being said, I think the Rebinding threat&nbsp;is still yet to be fully defined.&nbsp; It's possible that some interesting anti-rebinding strategies we see will develop out of a need to address specific attack scenarios identified over time.</P>]]></content:encoded>
    </item>
    <item>
      <title>Thoughts on Legacy Character Sets</title>
      <link>https://docs.microsoft.com/archive/blogs/dross/thoughts-on-legacy-character-sets</link>
      <pubDate>Tue, 03 Nov 2009 13:21:00 GMT</pubDate>
      <dc:creator><![CDATA[dross]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/dross/2009/11/03/thoughts-on-legacy-character-sets/</guid>
      <description><![CDATA[One of the things I have taken from the IE XSS Filter project is a healthy fear of legacy character...]]></description>
      <content:encoded><![CDATA[<P>One of the things I have taken from the IE XSS Filter project is a healthy fear of legacy character sets.&nbsp; If you've followed <A title="Chris Weber" href="www.lookout.net/" mce_href="www.lookout.net/">Chris Weber</A>, <A title="Scott Stender" href="www.blackhat.com/presentations/bh-jp-06/BH-JP-06-Stender.pdf" mce_href="www.blackhat.com/presentations/bh-jp-06/BH-JP-06-Stender.pdf">Scott Stender</A>, or <A title="Yosuke Hasegawa" href="utf-8.jp/" mce_href="utf-8.jp/">Yosuke Hasegawa</A>’s work, you know that even Unicode is...&nbsp; interesting.&nbsp; But at least in the Unicode world there are standards and evolving best practices dictating how clients and servers <EM>should</EM> behave.&nbsp; <BR>&nbsp;<BR>How about the rest of the character sets&nbsp;commonly used on the web today?&nbsp; For example, if a web server produces <A title="ISO 2022" href="en.wikipedia.org/wiki/ISO/IEC_2022" mce_href="en.wikipedia.org/wiki/ISO/IEC_2022">ISO 2022</A> responses...<BR>&nbsp; - How are escape sequences handled on input to the application?&nbsp; <BR>&nbsp; -&nbsp;How are escape sequences handled in various components&nbsp;through which the input travels?<BR>&nbsp; - How are escape sequences&nbsp;handled in server-side filtering code?<BR>&nbsp; - How are escape sequences&nbsp;handled at any of the various browser clients?<BR>&nbsp;<BR>You may ask the same questions about invalid multi-byte sequences, various character set eccentricities, etc.&nbsp;&nbsp;Character set handling&nbsp;may not be readily apparent&nbsp;at the highest levels of the stack, but transformations&nbsp;between character sets&nbsp;are actually&nbsp;common at the platform level on both the client and server.<BR>&nbsp;<BR>The answers to the questions above have a real&nbsp;impact on an application's ability to defend itself from XSS.&nbsp; In order for developers to prevent XSS they must authoritatively block any <A title="XSS attack vector" href="https://blogs.msdn.com/dross/archive/2008/03/10/xss-focused-attack-surface-reduction.aspx" mce_href="https://blogs.msdn.com/dross/archive/2008/03/10/xss-focused-attack-surface-reduction.aspx">XSS attack vector</A>.&nbsp; There are more complicated constructs that may be useful as vectors depending on the injection context.&nbsp; For anyone who's written some code intending to prevent XSS, this is the commonly understood problem space.&nbsp; But character sets essentially open up a second&nbsp;dimension to the attack surface.<BR>&nbsp;<BR>That is, developers must manage their untrusted data from its initial appearance in input out through its ultimate presentation to the victim user in an HTTP response.&nbsp; So the effectiveness of any filtering is not simply a matter of handling all of the applicable attack vectors that may exist in any given browser client.&nbsp; In fact, it is more complex due to the&nbsp;character set handling that may or may not have occurred before or after the point at which filtering occurs.<BR>&nbsp;<BR>Specifications for legacy character sets tend to be vague, if they exist at all.&nbsp; Undefined behaviors have existed for so long, the consequences of seemingly benign code tweaks can be virtually untestable.&nbsp; Code changes involving character sets&nbsp;can break old documents in subtle ways.<BR>&nbsp;<BR>The differences between how components&nbsp;handle a given character set is one source of vulnerability.&nbsp; But besides that, character set eccentricities may be well-defined and implemented consistently&nbsp;at the client and server, yet still enable vulnerabilities.&nbsp; <A title=Here href="sites.google.com/site/applesoup/" mce_href="sites.google.com/site/applesoup/">Here</A> <A title=are href="sirdarckcat.blogspot.com/2009/10/couple-of-unicode-issues-on-php-and.html" mce_href="sirdarckcat.blogspot.com/2009/10/couple-of-unicode-issues-on-php-and.html">are</A> <A title=some href="seclists.org/fulldisclosure/2007/Dec/267" mce_href="seclists.org/fulldisclosure/2007/Dec/267">some</A> <A title=examples href="shiflett.org/blog/2006/jan/addslashes-versus-mysql-real-escape-string" mce_href="shiflett.org/blog/2006/jan/addslashes-versus-mysql-real-escape-string">examples</A>&nbsp;where the complexities around character set handling have lead to vulnerabilities.<BR>&nbsp;<BR>What do you think?&nbsp; It would be very interesting to see an analysis&nbsp;comparing popular server-side web platforms, other server-side components (SQL servers, etc.), and client-side technology in terms of how they handle the various character set issues across a wide range of supported character sets.<BR>&nbsp;<BR>So...&nbsp; Would anyone <EM>not</EM> like to live in an all-Unicode world?</P>
<P>Here are some related resources from Shawn Steele, Windows / .Net globalization guru: <A href="https://blogs.msdn.com/shawnste/pages/code-pages-unicode-encodings.aspx">blogs.msdn.com/shawnste/pages/code-pages-unicode-encodings.aspx</A></P>]]></content:encoded>
    </item>
    <item>
      <title>Good Bug</title>
      <link>https://docs.microsoft.com/archive/blogs/dross/good-bug</link>
      <pubDate>Thu, 28 May 2009 18:37:00 GMT</pubDate>
      <dc:creator><![CDATA[dross]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/dross/2009/05/28/good-bug/</guid>
      <description><![CDATA[Credit goes to Alex "Kuza55" Kouzemtchenko for identifying a weakness in the XSS Filter OBJECT tag...]]></description>
      <content:encoded><![CDATA[<P>Credit goes to Alex "Kuza55" Kouzemtchenko for identifying a weakness in the XSS Filter OBJECT tag heuristic.&nbsp; The&nbsp;original&nbsp;heuristic failed to properly sanitize OBJECT tags with the DATA attribute set.&nbsp; Alex found that it is possible to use the DATA attribute to instantiate the PDF handler, then reference content to be loaded using a PARAM element.&nbsp; This would load a remote PDF that&nbsp;would execute script in the context of the hosting page, effectively enabling XSS.</P>
<P>Example:<BR><CODE>site.tld/foo.asp?FName=&lt;object%20data=anything_at_all.pdf&gt;&lt;param%20name=src%20value=othersite.tld/xss.pdf%20&gt;&lt;/param&gt;&lt;/object&gt;</CODE></P>
<P>The PDF proof-of-concept contained:<BR><CODE>getURL("vbscript:MsgBox document.cookie");</CODE></P>
<P>Thanks to Alex, we were able to address this bug&nbsp;for the IE8 final release.</P>]]></content:encoded>
    </item>
  </channel>
</rss>