<?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>Startup Security &#187; Input Validation</title>
	<atom:link href="http://startupsecurity.info/blog/category/input-validation/feed/" rel="self" type="application/rss+xml" />
	<link>http://startupsecurity.info</link>
	<description>Security, for Startups</description>
	<lastBuildDate>Wed, 16 Dec 2009 18:42:59 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>We&#8217;re not on ARPAnet anymore, Toto</title>
		<link>http://startupsecurity.info/blog/2008/11/11/were-not-on-arpanet-anymore-toto/</link>
		<comments>http://startupsecurity.info/blog/2008/11/11/were-not-on-arpanet-anymore-toto/#comments</comments>
		<pubDate>Tue, 11 Nov 2008 18:33:52 +0000</pubDate>
		<dc:creator>Damon Cortesi</dc:creator>
				<category><![CDATA[Browser]]></category>
		<category><![CDATA[General Site Security]]></category>
		<category><![CDATA[Input Validation]]></category>
		<category><![CDATA[CSRF]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[NoScript]]></category>

		<guid isPermaLink="false">http://startupsecurity.info/?p=87</guid>
		<description><![CDATA[Far back in the days of GeoCities and Tripod, JavaScript was a cool little scripting language you could use to make some awesome rollovers on your links and take your site to the next level beyond the blink tag. Today, JavaScript drives what many call Web 2.0 &#8211; a user experience that has made it [...]]]></description>
			<content:encoded><![CDATA[<p>Far back in the days of GeoCities and Tripod, JavaScript was a cool little scripting language you could use to make some awesome rollovers on your links and take your site to the next level beyond the blink tag. Today, JavaScript drives what many call Web 2.0 &#8211; a user experience that has made it possible to put desktop applications (email, office) on the web.</p>
<p>The evolution of JavaScript and its place in security perfectly parallels the transition from server-side security to client-side security.</p>
<p>~History~</p>
<blockquote><p>Before network firewalls were commonplace, the juiciest targets to go after were servers. In what is now unthinkable, it was common for systems to be deployed directly on the Internet with no firewall whatsoever. This is part of the reason that <a href="http://en.wikipedia.org/wiki/Code_Red_(computer_worm)">Code Red</a>, <a href="http://en.wikipedia.org/wiki/Nimda">Nimda</a>, and <a href="http://en.wikipedia.org/wiki/SQL_slammer_worm">Slammer</a> were so successful. The opposite is true now. Network firewalls are commonplace, Windows XP has the firewall turned on by default, and Server 2008 will be the first Microsoft Server OS to be deployed with the <a href="http://www.microsoft.com/windowsserver2008/en/us/security-policy.aspx?pf=true">firewall enabled by default</a>. As such, attackers moved on to the next target &#8211; client workstations and the primary way users interact on them.</p></blockquote>
<p>~/History~</p>
<p>So why should you, as a startup, care about all this? Two reasons.</p>
<ol>
<li>Protect your site from common attacks</li>
<li>Protect yourself from being a victim</li>
</ol>
<p>To address the first one, there&#8217;s a common attack known as <a href="http://www.owasp.org/index.php/Cross-Site_Request_Forgery">Cross-Site Request Forgery</a>. I&#8217;ll get into it in more detail in another post, but effectively it allows one site to take action on another if that target site has not put effective controls in place. A common mitigation is ensuring that all data modification methods occur via POST requests (per HTTP standard). However, if you don&#8217;t have tokens associated with those POST requests, another site could utilize javascript to craft and submit fake POST requests to take actions on a logged-in users behalf. Does your site have a &#8220;remember me&#8221; checkbox? Do user sessions not time out? This could be a problem for you. This issue has been widely known for at least four years (<a href="http://shiflett.org/articles/cross-site-request-forgeries">Chris Shiflett on CSRF</a>), but it&#8217;s only recently been gaining a lot of attention. I&#8217;m surprised more frameworks don&#8217;t have protection for this enabled by default, but it could likely impact development testing. The general approach to fixing this is by utilizing some sort of server-generated token that&#8217;s inserted as a hidden form field and verified on user submittal. </p>
<p>To address the second, an example is necessary. JavaScript, for the most part, is fairly essential to a number of sites that you may visit on a regular basis. The danger however, is malicious JavaScript that may get executed without you even knowing it. That script could be on that site and trying to take action on a different site, or sourced from a remote site altogether. Take, for example, poor David Airey who <a href="http://www.davidairey.com/google-gmail-security-hijack/">lost his domain</a> due to a <a href="http://www.gnucitizen.org/blog/google-gmail-e-mail-hijack-technique/">GMail CSRF</a> vulnerability. The basics behind the attack are as such: At one point, David visited a page that had a malicious JavaScript. That script posted back to his GMail account, reconfiguring it so the attacker could hijack emails. That reconfiguration including forwarding and deleting all domain-related emails. Once David went on vacation, the attacker went to work and David lost his domain.</p>
<p>So how can you protect against this second attack? I personally make use of the Firefox extension <a href="http://noscript.net/">NoScript</a>. This handy extension prevents JavaScript code from automatically executing when you visit a web page, unless you&#8217;ve previously whitelisted that site. While it can be a little annoying, it&#8217;s much better than unknown JavaScript executing in the context of my browsers&#8230;where I spend a good majority of my day. </p>
]]></content:encoded>
			<wfw:commentRss>http://startupsecurity.info/blog/2008/11/11/were-not-on-arpanet-anymore-toto/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Typical Injection Points in a Web Application</title>
		<link>http://startupsecurity.info/blog/2008/11/06/typical-injection-points-in-a-web-application/</link>
		<comments>http://startupsecurity.info/blog/2008/11/06/typical-injection-points-in-a-web-application/#comments</comments>
		<pubDate>Thu, 06 Nov 2008 21:32:52 +0000</pubDate>
		<dc:creator>Damon Cortesi</dc:creator>
				<category><![CDATA[General Site Security]]></category>
		<category><![CDATA[Input Validation]]></category>

		<guid isPermaLink="false">http://startupsecurity.info/?p=79</guid>
		<description><![CDATA[Dove-tailing off my previous post about the Basics of Analyzing Web Site Security, there are some very common places in web applications that I come across typical issues. These are the places I will look at first on a web app to get a general idea of the rest of the site security.

Search Forms
Search forms [...]]]></description>
			<content:encoded><![CDATA[<p>Dove-tailing off my previous post about the <a href="/blog/2008/10/24/the-basics-of-analyzing-web-site-security/">Basics of Analyzing Web Site Security</a>, there are some very common places in web applications that I come across typical issues. These are the places I will look at first on a web app to get a general idea of the rest of the site security.</p>
<ul>
<li><strong>Search Forms</strong>
<p>Search forms generally re-display the search term entered by the user. These terms are quite frequently not properly encoded, either, leading to Cross-Site Scripting (XSS) attacks.</p>
</li>
<li><strong>Jobs and Events</strong>
<p>Jobs and Events pages frequently utilize a database behind the scenes to manage job postings and event listings. Further, they&#8217;re usually pretty easy to check as they have the job or event id in the URL for page rank, etc. I&#8217;ll commonly look for these for easy injection vectors.</p>
</li>
<li><strong>Cookies</strong>
<p>Utilizing the fantastic Web Dev extension, I&#8217;ll take a quick look at the cookies. If I see anything more than a session ID, I&#8217;ll start modifying and manipulating the cookies to verify that server-side checks are in place. Cookies can also frequently lead to XSS.</p>
</li>
<li><strong>Hidden Form Fields</strong>
<p>If there&#8217;s a contact page with a form, the first thing I do is look for hidden form fields to see what parameters the web developers might have thought that a user wouldn&#8217;t see by putting them in a &#8220;hidden&#8221; field. I&#8217;ve come across everything from spam gateways to arbitrary file access due to simple issues like this.</p>
</li>
<li><strong>Typical Directory Structures</strong>
<p>Finally, I&#8217;ll commonly poke around in typical directory structures to see if I get lucky. Things like <code>/admin/</code>, <code>/logs/</code>, and <code>/config/</code>, among others, often are not intended for public consumption or linked to, but are present on the site.</p>
</li>
</ul>
<p>There you go &#8211; those are generally the first places I look if I need to take a quick look at a web site. Beyond that, I start digging into more complex input locations within the application, logic happening behind the scenes, and potential user authorization issues.</p>
]]></content:encoded>
			<wfw:commentRss>http://startupsecurity.info/blog/2008/11/06/typical-injection-points-in-a-web-application/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Avoid XSS on Google App Engine</title>
		<link>http://startupsecurity.info/blog/2008/10/28/avoid-xss-on-google-app-engine/</link>
		<comments>http://startupsecurity.info/blog/2008/10/28/avoid-xss-on-google-app-engine/#comments</comments>
		<pubDate>Tue, 28 Oct 2008 18:54:35 +0000</pubDate>
		<dc:creator>Damon Cortesi</dc:creator>
				<category><![CDATA[Input Validation]]></category>
		<category><![CDATA[Google App Engine]]></category>
		<category><![CDATA[XSS]]></category>

		<guid isPermaLink="false">http://startupsecurity.info/?p=61</guid>
		<description><![CDATA[A quick note for startups (or anybody) that may be deploying on Google App Engine:
As App Engine does not automatically escape output, you need to do this yourself.
As an example, here&#8217;s a very simple snippet:
Welcome, {{ firstname }}!
If &#8220;firstname&#8221; is not properly sanitized when stored in the database or escaped on output, I could easily [...]]]></description>
			<content:encoded><![CDATA[<p>A quick note for startups (or anybody) that may be deploying on Google App Engine:</p>
<p><strong>As App Engine does not automatically escape output, you need to do this yourself.</strong></p>
<p>As an example, here&#8217;s a very simple snippet:<br />
<code>Welcome, {{ firstname }}!</code></p>
<p>If &#8220;firstname&#8221; is not properly sanitized when stored in the database or escaped on output, I could easily make my first name the following:<br />
<code>damon&lt;script&gt;alert('hi!')&lt;/script&gt;</code></p>
<p>And then we would have stored JavaScript code execution, aka Cross-Site Scripting, as the &lt;script&gt; tag would get interpreted by the browser when echoed out.</p>
<p><strong>The solution?</strong></p>
<p>Simple, just |escape your output when coding in Google App Engine:<br />
<code>Welcome, {{ firstname<strong>|escape</strong> }}!</code></p>
<p>You can also sanitize data prior to storing it in the database, but as an additional layer it&#8217;s good to escape it on output as well.</p>
<p>I&#8217;m not sure if this is a derivative of the fact that GAE utilizes Django 0.9.7, but I guess we&#8217;ll see when they upgrade to Django 1.0 as it <a href="http://code.djangoproject.com/wiki/AutoEscaping">autoescapes</a> all output by default (thank you, Django!).</p>
]]></content:encoded>
			<wfw:commentRss>http://startupsecurity.info/blog/2008/10/28/avoid-xss-on-google-app-engine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
