<?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>Casaba Security &#187; Web</title>
	<atom:link href="http://www.casaba.com/blog/tag/web/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.casaba.com/blog</link>
	<description>Building and breaking software and robots</description>
	<lastBuildDate>Wed, 11 Jan 2012 18:08:45 +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>Open redirects &#8211; what&#8217;s the problem?</title>
		<link>http://www.casaba.com/blog/2008/03/open-redirects-whats-the-problem/</link>
		<comments>http://www.casaba.com/blog/2008/03/open-redirects-whats-the-problem/#comments</comments>
		<pubDate>Sun, 02 Mar 2008 16:16:01 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[Code Review]]></category>
		<category><![CDATA[Security Testing]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Been getting this question a bit lately. First off, what&#039;s an open redirect? It&#039;s a function in your application which sends the user to some other location. The redirect could be a response from the server, such as an HTTP 301 or 302 response code, or a META redirect. The redirect can be delivered in [...]]]></description>
			<content:encoded><![CDATA[<p>Been getting this question a bit lately.  First off, what&#039;s an open redirect?  It&#039;s a function in your application which sends the user to some other location.  The redirect could be a response from the server, such as an HTTP 301 or 302 response code, or a META redirect.  The redirect can be delivered in several forms, the important part is that when an attacker can control the redirect location, they can exploit it for nefarious purposes &#8211; usually this means spam or phishing attacks.</p>
<p>For example, your application takes a request from the user, maybe it&#039;s a GET request for a certain page.  Included in the request is a value indicating the location where the user should be redirected once they&#039;ve finished on the page.  So, the user requests a page like:</p>
<p><code>http://somesite.tld/page.aspx?name=value&amp;returnUrl=http://somesite.tld/referringpage.aspx</code></p>
<p>As you can see, the <strong>returnUrl </strong>takes a value of the redirect location.  Then your code acts on it somewhere by redirecting the user with something like:<br />
<code><br />
Response.Redirect(returnUrl);<br />
</code></p>
<p><strong>Spammers and phishers</strong> love this, it gives them <strong>good camouflage</strong>.  For example:</p>
<p><code>http://somesite.tld/page.aspx?name=value&amp;returnUrl=http://evil.tld/installMalware.bad</code></p>
<p>Now imagine the spammer has crafted up a nice email that looks like it originates from somesite.tld, includes all the logos, fonts, etc.  They coerce the victim into clicking this link by saying something like &#8220;your account needs immediate attention&#8221; or &#8220;you&#039;ve won 500 points&#8221;.  User clicks the link, gets redirected to evil.tld, and may not realize that the domain has switched before they say <strong>Yes</strong> to install the thing that the spammer wants them to download.</p>
<p>Tricky, right.  In fact this is a favorite of spam, malware, and phish, next to the old XSS bug.</p>
<p><strong>What&#039;s the solution</strong><br />
Well, simply, don&#039;t redirect openly, rather, implement a SafeRedirect() function that looks something like:</p>
<p><code><br />
public static SafeRedirect(string url) {<br />
// check that protocol is either http:// https:// ftp:// or other specific protos you want to allow<br />
// check that domain is in fact yourdomain.tld<br />
// If these checks pass, then you can go ahead<br />
Response.Redirect(returnUrl);<br />
// If the checks fail, you can try to clean up the URL, but probably best to just fail and redirect to a safe landing page<br />
}<br />
</code><br />
That&#039;s about all there is too it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2008/03/open-redirects-whats-the-problem/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>To fuzz or not to fuzz web services…</title>
		<link>http://www.casaba.com/blog/2007/01/to-fuzz-or-not-to-fuzz-web-services%e2%80%a6/</link>
		<comments>http://www.casaba.com/blog/2007/01/to-fuzz-or-not-to-fuzz-web-services%e2%80%a6/#comments</comments>
		<pubDate>Sat, 13 Jan 2007 08:00:00 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[Security Testing]]></category>
		<category><![CDATA[fuzzing]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Is it worth the time to run input fuzzing tests against web services? When engaging a client for a security review I’m often the one to pose this question. Sure, why not… right? Well honestly there’s a more precise way to answer this question. First we really need to understand the goals of the security [...]]]></description>
			<content:encoded><![CDATA[<p>Is it worth the time to run input fuzzing tests against web services? When engaging a client for a security review I’m often the one to pose this question. Sure, <strong>why not</strong>… right? Well honestly there’s a more precise way to answer this question. First we really need to understand the <strong>goals </strong>of the security review, so a few questions are in order.</p>
<ol>
<li>Has <strong>threat modeling </strong>been done or is this my job?</li>
<li>How much <strong>time and budget </strong>do we have for a security review?</li>
<li>How complex are the web services? e.g. how many parameters do they take and in what format</li>
<li>Are the web services written in managed code?</li>
<li>Is user-input passed to unmanaged code?</li>
</ol>
<p>Let’s take these answers from a common scenario:</p>
<ol>
<li>Yes threat modeling is complete</li>
<li>We have about 2 or 3 weeks that you can use to test</li>
<li>Very complex, they use WS-Security, take hundreds of parameters, some encrypted, using custom formats, SOAP, as well as embedded XML blobs</li>
<li>Yes, they’re written in C# using the .NET Framework</li>
<li>Some specific elements of user-input are handled by unmanaged code modules</li>
</ol>
<p>Some things not obvious in these questions are:</p>
<ul>
<li>that the client is highly interested in finding Denial of Service (<strong>DoS</strong>) issues</li>
<li>that millions of people will be using these Web Services whether they know it or not</li>
<li>that no input fuzzing has been done to date</li>
</ul>
<p>With 2-3 weeks we could get a lot done in a security review focused just one the web services. It’s becoming clear that fuzzing input would be a <strong>worthwhile </strong>venture. We’ll likely turn up some DoS issues, possibly some unmanaged code issues as well. Since we have a decent timeframe, we’ll be checking for the following issues, not all of which fuzzing is good for:</p>
<ul>
<li>elevation of privilege (<strong>EoP</strong>)</li>
<li><strong>repurposing </strong>attacks</li>
<li>cross-site scripting (yes, even web services in some cases)</li>
<li>information disclosure</li>
<li>session replay</li>
<li>SQL Injection</li>
<li>DTD attacks</li>
<li>XML validation</li>
<li>script injection</li>
<li>repudiation</li>
<li>denial of service</li>
<li>buffer overrun</li>
</ul>
<p>Fuzzing will help with some of these, so at this point the answer is yes, let’s do it. We’ll also be doing some <strong>code review</strong>, which is great for identifying issues such as DoS, XML validation, and DTD attacks quickly. And we’ll be studying the specs and architecture along the way to keep a clear <strong>understanding </strong>of the system and help identify repurposing attacks, which will be tested for confirmation.</p>
<p>Ok let’s go!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2007/01/to-fuzz-or-not-to-fuzz-web-services%e2%80%a6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Internet Explorer whitespace-as-comment hack to bypass input filters</title>
		<link>http://www.casaba.com/blog/2007/01/internet-explorer-whitespace-as-comment-hack-to-bypass-input-filters/</link>
		<comments>http://www.casaba.com/blog/2007/01/internet-explorer-whitespace-as-comment-hack-to-bypass-input-filters/#comments</comments>
		<pubDate>Thu, 11 Jan 2007 08:00:00 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[Security Testing]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[When testing for XSS (cross-site scripting) issues, you often need to bypass filters and perform different sorts of encodings and other trickery. To be a good tester you also need to know how the browsers you’re concerned with behave differently. In Internet Explorer 6.0 there’s a behavior that’s allowed seemingly impassible input validation filters to [...]]]></description>
			<content:encoded><![CDATA[<p>When testing for XSS (cross-site scripting) issues, you often need to bypass filters and perform different sorts of encodings and other trickery. To be a good tester you also need to know how the browsers you’re concerned with behave differently. In Internet Explorer 6.0 there’s a behavior that’s allowed seemingly impassible input validation filters to be bypassed. Note that the issue is not the browser’s fault, it’s the fault of an improperly designed input validation mechanism on the server. Okay to illustrate the point.</p>
<p>You’re testing a web app that has an input field. Some script tags are allowed but &lt;img src=”something”&gt; is not. By replacing the whitespace with a comment, your code is accepted. When returned to the browser, IE 6.x, the comment is interpreted as whitespace and the code is executed fine. Test it out:</p>
<p>	<code>//Start HTML<br />
	&lt;html&gt;<br />
	&lt;body&gt;<br />
	&lt;img/*comment*/src=”javascript:alert(’img tag’)”&gt;<br />
	&lt;/body&gt;<br />
	&lt;/html&gt;<br />
	//End HTML</code></p>
<p>This trick can be useful for more than just bypassing filters…</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2007/01/internet-explorer-whitespace-as-comment-hack-to-bypass-input-filters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

