<?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>Miscellaneous Security&#187; Vulnerabilities</title>
	<atom:link href="http://misc-security.com/category/vulnerabilities/feed/" rel="self" type="application/rss+xml" />
	<link>http://misc-security.com/blog</link>
	<description>Brett Hardin&#039;s Blog</description>
	<lastBuildDate>Fri, 01 Apr 2011 20:40:14 +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>Focusing On What Your Good At</title>
		<link>http://misc-security.com/blog/2011/04/focusing-on-what-your-good-at/</link>
		<comments>http://misc-security.com/blog/2011/04/focusing-on-what-your-good-at/#comments</comments>
		<pubDate>Fri, 01 Apr 2011 20:40:14 +0000</pubDate>
		<dc:creator>Brett Hardin</dc:creator>
				<category><![CDATA[General Thoughts]]></category>
		<category><![CDATA[The Basics]]></category>
		<category><![CDATA[Vulnerabilities]]></category>

		<guid isPermaLink="false">http://misc-security.com/blog/?p=171</guid>
		<description><![CDATA[Reading time: 2 &#8211; 4 minutes When I was in high school I was focused on being good at everything. Some time passed and I realized that successful people focus on one (1) aspect of their life and dive deep. Really Deep. While approving my blog comments, I came across this: I chuckled and thought, &#8220;Why [...]]]></description>
			<content:encoded><![CDATA[<p>Reading time: 2 &#8211; 4 minutes</p>
<div class="wp-caption aligncenter" style="width: 650px"><img src="http://farm1.static.flickr.com/5/5669185_4aedac659f_z.jpg?zz=1" alt=" Focusing On What Your Good At" width="640" height="427" title="Focusing On What Your Good At" /><p class="wp-caption-text">Photo: Photo Monkey</p></div>
<p>When I was in high school I was focused on being good at everything. Some time passed and I realized that successful people focus on one (1) aspect of their life and dive deep. Really Deep.</p>
<p>While approving my blog comments, I came across this:</p>
<p><a href="http://misc-security.com/blog/wp-content/uploads/2011/04/Screen-shot-2011-04-01-at-1.11.22-PM.png"><img class="aligncenter size-medium wp-image-172" title="Screen shot 2011-04-01 at 1.11.22 PM" src="http://misc-security.com/blog/wp-content/uploads/2011/04/Screen-shot-2011-04-01-at-1.11.22-PM-300x42.png" alt="Screen shot 2011 04 01 at 1.11.22 PM 300x42 Focusing On What Your Good At" width="300" height="42" /></a></p>
<p>I chuckled and thought, &#8220;Why would someone care about Cross-Site Scripting my site?&#8221;</p>
<p><strong>Targeting My Site</strong></p>
<p>Was someone trying to &#8220;hack&#8221; me to prove a point?<strong><br />
</strong></p>
<p>There are much more powerful and well respected bloggers than me in the information security realm. Why target me? If you want to gain visibility for your attack go after someone like Jeremiah Grossman, Billy Rios, Chris Evans, or Rafal Los. If you XSS their star on the walk of fame, you will generate some buzz. But it won&#8217;t last long. People&#8217;s memories are short.</p>
<p><strong>Practice Before You Execute</strong></p>
<p>When doing a presentation I prepare. I never was a boy scout, but being prepared is a way to feel confidant in what you do. I don&#8217;t like to &#8220;wing it.&#8221;</p>
<p>I prefer to start my presentation months ahead of time and keep focusing and refocusing it. Making the presentation tighter and tighter, until it is the best that I can do. Why do I prepare this much for a presentation maybe 10 people will see? To avoid embarrassment.</p>
<p>Presenting on something that you are unprepared for is the most excruitating thing I can imagine. It is my worst nightmare.</p>
<p>The person posting this comment did just that. They attempted to execute before they prepared.</p>
<p><strong>Do Your Homework</strong></p>
<p>I would like to give advice to the fledgling hacker. If you want to find XSS on a site, start by doing reconnaissance. Before typing in blindly to fields alert(123) do some research.</p>
<p>This site is clearly using WordPress. Download WordPress, install it, and Identify XSS attacks that you could launch on my site. Can&#8217;t find any? No problem. Start looking at the source code for XSS. Trust me, they <a href="http://spotthevuln.com">exist</a>.</p>
<p><strong>Notes on The Attack</strong></p>
<p>Comments need to be approved. So, even if this XSS was valid I would personally have to share it with my readers. In doing your homework, realize that other bugs, such as remote code execution, are WAY better. Look for <a href="http://spotthevuln.com/2010/05/theory-code-execution/">those</a>.</p>
<p><strong>Return to Focusing</strong></p>
<p>The next time you put things in perspective ask yourself, &#8220;Am I focusing on something I care about?&#8221; If the answer is yes, continue down the righteous path. If the answer is No, Find Your Purpose.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://misc-security.com/blog/2011/04/focusing-on-what-your-good-at/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cross-Site Scripting in 37Signals Writeboard Application</title>
		<link>http://misc-security.com/blog/2010/02/basecamp-xss/</link>
		<comments>http://misc-security.com/blog/2010/02/basecamp-xss/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 23:13:05 +0000</pubDate>
		<dc:creator>Brett Hardin</dc:creator>
				<category><![CDATA[Vulnerabilities]]></category>

		<guid isPermaLink="false">http://misc-security.com/blog/?p=7</guid>
		<description><![CDATA[Reading time: 3 &#8211; 4 minutes While recently using Basecamp, a 37Signals product, I was writing a collaborative document using Writeboard and noticed that I could insert greater than (&#60;) and less than ( &#62; ) tags in the document. Writeboard uses a simpler form of editing, similar to wiki’s. If you want to make [...]]]></description>
			<content:encoded><![CDATA[<p>Reading time: 3 &#8211; 4 minutes</p>
<div class="wp-caption aligncenter" style="width: 510px"><a href="http://farm3.static.flickr.com/2162/2542450115_6576d19185.jpg"><img title="Photo: Stream of Consciousness by jurvetson" src="http://farm3.static.flickr.com/2162/2542450115_6576d19185.jpg" alt="2542450115 6576d19185 Cross Site Scripting in 37Signals Writeboard Application" width="500" height="365" /></a><p class="wp-caption-text">Photo: jurvetson</p></div>
<p>While recently using Basecamp, a <a title="37 Signals Home Page" href="http://37signals.com/" target="_blank">37Signals</a> product, I was writing a collaborative document using <a title="37Signals WriteBoard" href="http://writeboard.com/" target="_blank">Writeboard</a> and noticed that I could insert greater than (&lt;) and less than ( &gt; ) tags in the document.</p>
<p>Writeboard uses a simpler form of editing, similar to wiki’s. If you want to make the line bold, you can use <code>*bold*</code> instead of standard HTML, <code>&lt;b&gt;bold&lt;/b&gt;</code>. However, Writeboard allows the user to markup the text either way. <strong>Well, this was a product that I needed to QA</strong>. I quickly inserted a script source tag, saved the Writeboard, and to my surprise, the script src tag fired.</p>
<p>Upon identifying this I then attempted <a title="XSS" href="http://misc-security.com/blog/2009/05/xss-cross-site-scripting/" target="_blank">Cross-Site Scripting</a> 101: <code>&lt;script&gt; alert (123) &lt;/script&gt;</code></p>
<p>That also was successful! I was rather blown away that a product who is used by, Adidas, National Geographic, Kellogg, and USA Today, has never tested (or accidental) found this functionality.</p>
<p>I reached out to the security team at 37Signals, and the issue has been fixed and I have been given a nice shout out on the <a title="Security Response Page" href="http://37signals.com/security-response" target="_blank">security page</a>.</p>
<p>I initially thought, “This is what happens when start-ups attempt to rush products to market without doing sanity checking on what they are doing.”</p>
<p>However, upon further research, I read the excellent “book” <a title="Get Real" href="http://gettingreal.37signals.com/toc.php" target="_blank">Get Real</a> by Jason Fried the Founder of 37Signals.  These essays explained why this type of vulnerability lived in this system. 37Signals follows a process of quick deployment, development, with fast subsequent revisions. Their concept is get a product out that people can immediately begin using.</p>
<div id="attachment_758" class="wp-caption alignright" style="width: 310px;">
<p><a href="http://farm6.static.flickr.com/5214/5454791546_5ec3b4d25f.jpg"><img class="size-medium wp-image-758 alignright" title="37SignalsXSS" src="http://farm6.static.flickr.com/5214/5454791546_5ec3b4d25f.jpg" alt="5454791546 5ec3b4d25f Cross Site Scripting in 37Signals Writeboard Application"  /></a></p>
<p class="wp-caption-text">Cross-Site Scripting in 37Signals</p>
</div>
<p>While I agree, this is a great way to develop SaaS products, it is difficult to see how security can come into play with this type of software delivery model. In one essay, Fried, explains the necessity of getting well rounded individuals (generalists) and avoid hiring specialists. Does this mean more software developers should be interested in security?</p>
<p>This is yet to be seen, and I think it is dependent upon your product. There is something however that other companies can learn from 37Signals.</p>
<p>37 Signals did the following when it came to me finding this bug:</p>
<ul>
<li>I initially reached out to Jason Fried on Twitter, and he got back to me in less than an hour.</li>
<li>They had a simple way for me to contact them.</li>
<li>After reaching out to them, they immediately acknowledged the receiving of my message.</li>
<li>They fixed the issue in 4 days.</li>
</ul>
<p>I commend 37Signals for fixing the issue as fast as they did. Typically, when these issues are reported to companies, they are typically forwarded to the trash.</p>
]]></content:encoded>
			<wfw:commentRss>http://misc-security.com/blog/2010/02/basecamp-xss/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Failure to Restrict URL Access</title>
		<link>http://misc-security.com/blog/2009/11/restricting-url-access/</link>
		<comments>http://misc-security.com/blog/2009/11/restricting-url-access/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 22:27:27 +0000</pubDate>
		<dc:creator>Brett Hardin</dc:creator>
				<category><![CDATA[Vulnerabilities]]></category>

		<guid isPermaLink="false">http://misc-security.com/blog/?p=74</guid>
		<description><![CDATA[Reading time: 2 &#8211; 4 minutes This is the last-part in a ten-part-series describing the OWASP Top 10. (See the entire OWASP Top 10) What is the problem with Failing to Restrict URL Access A common problem in web applications, failing to restrict URL access typically happens when a page doesn’t have the correct access control [...]]]></description>
			<content:encoded><![CDATA[<p>Reading time: 2 &#8211; 4 minutes</p>
<div class="wp-caption aligncenter" style="width: 510px"><img title="Failure to Restrict URL Access Open Redirect" src="http://farm4.static.flickr.com/3398/3290859398_9b1c698879.jpg" alt="3290859398 9b1c698879 Failure to Restrict URL Access" width="500" height="249" /><p class="wp-caption-text">Photo: .m for matthijs</p></div>
<p>This is the last-part in a ten-part-series describing the <a href="http://misc-security.com/blog/2009/07/owasp-top-10-2007/">OWASP Top 10</a>. (<a href="http://misc-security.com/blog/2009/07/owasp-top-10-2007/">See the entire OWASP Top 10</a>)</p>
<h3><strong>What is the problem with Failing to Restrict URL Access</strong></h3>
<p>A common problem in web applications, failing to restrict URL access typically happens when a page doesn’t have the correct access control policy in place. Unauthorized users are able to view content that they shouldn’t have the ability to view.</p>
<p>Having these vulnerabilities in your application exposes privileged functionality to unauthorized users. It can also create a problem with your record trails. If users can access records without being authenticated the chain of custody is completely broken, preventing good auditing from taking place.</p>
<p>Failing to restrict URL access can also lead to problems with bypassing <a title="session management" href="http://misc-security.com/blog/2009/08/broken-authentication-and-session-management/">session management</a>, another of the OWASP Top 10.</p>
<h3><strong>An Example of Failing to Restrict URL Access</strong></h3>
<p>Developers attempting to hide functionality from a user by creating “hidden” pages can create a failure to restrict URL access situation.</p>
<p>Hidden pages are defined as pages that don’t have a link pointing to them, preventing web crawlers, such as Google, from indexing them. Some developers believe that these pages will never be found by anyone who doesn’t know the exact URL. However, attackers typically find these pages through forceful browsing and the access controls on these pages tend to not be restrictive.</p>
<p>Another example of a page that can have this type of vulnerability is one where all of the privileges are checked client side but not server side. Attackers using personal proxies can bypass these client-side privileges and access functionality not intended for them to access.</p>
<h3><strong>How Do You Restrict URL Access</strong></h3>
<p>Most of these problems arise from a change in policy happening on paper, but not being implemented thoroughly across the application.</p>
<p>Restricting URL access correctly takes careful planning by the developer and the supporting organization. Organizations can follow some simple rules that will help them in preventing this vulnerability.</p>
<ul>
<li>Developers should never assume users will be unaware of hidden functionality.</li>
<li>Administrators should <a href="http://www.ducea.com/2006/07/21/apache-tips-tricks-deny-access-to-certain-file-types/">block access to all file types</a> that the application doesn’t serve.</li>
<li>Architects should <a href="http://en.wikipedia.org/wiki/Access_Control_Matrix">develop an access control matrix</a>, helping them to prevent unauthorized users from accessing authorized content. This should be done for every URL and business function of the application.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://misc-security.com/blog/2009/11/restricting-url-access/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Insecure Communications</title>
		<link>http://misc-security.com/blog/2009/10/insecure-communications/</link>
		<comments>http://misc-security.com/blog/2009/10/insecure-communications/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 22:02:01 +0000</pubDate>
		<dc:creator>Brett Hardin</dc:creator>
				<category><![CDATA[Vulnerabilities]]></category>

		<guid isPermaLink="false">http://misc-security.com/blog/?p=98</guid>
		<description><![CDATA[Reading time: 2 &#8211; 4 minutes This is the ninth-part in a ten-part-series describing the OWASP Top 10. (See all the OWASP Top 10) What are Insecure Communications Insecure communications is when a client and server communicate over a n0n-secure (non-encrypted) channel. By doing this, the developer is ensuring that their communication channel can be viewed [...]]]></description>
			<content:encoded><![CDATA[<p>Reading time: 2 &#8211; 4 minutes</p>
<div class="wp-caption aligncenter" style="width: 510px"><img title="Insecure Communications" src="http://farm5.static.flickr.com/4038/4417602702_7b5e9b62f6.jpg" alt="4417602702 7b5e9b62f6 Insecure Communications" width="500" height="332" /><p class="wp-caption-text">Photo: Jens Finke - fotografie grafik verlag</p></div>
<p>This is the ninth-part in a ten-part-series describing the <a href="http://misc-security.com/blog/2009/07/owasp-top-10-2007/">OWASP Top 10</a>. (<a href="http://misc-security.com/blog/2009/07/owasp-top-10-2007/">See all the OWASP Top 10</a>)</p>
<p><big><strong>What are Insecure Communications<br />
</strong></big></p>
<p>Insecure communications is when a client and server communicate over a n0n-secure (non-encrypted) channel. By doing this, the developer is ensuring that their communication channel can be viewed by eyes they didn’t intend.</p>
<p>Failing to securely communicate server-to-server and server-to-client helps attackers to intercept sensitive transactions. Attackers do this by using man-in-the-middle attacks, a post for another time. Not communicating securely breaks down confidentiality and integrity.</p>
<p>Developers fall into communicating insecurely when they:</p>
<ul>
<li>Don’t secure their client-to-server connections.</li>
<li>Don’t secure their server-to-database connections.</li>
<li>Don’t secure other back end connections that pass sensitive data.</li>
</ul>
<p><big><strong>An Example of Insecure Communications<br />
</strong></big></p>
<p>Assume a developer has written an application that takes input from a user and stores it in a database that is located on another network segment.</p>
<p>If the developer fails to use SSL between the web server and the user, then he has an insecure communications channel between the user and the web server. (Client-to-server connection)</p>
<p>If the developer fails to forget to encrypt the connection between his web server and the database, then he is failing to secure the server-to-database connection.</p>
<p><big><strong>How Do You Prevent Insecure Communications from Occurring in your Web Application<br />
</strong></big></p>
<p>To prevent insecure communications from occurring, the first step is to make sure the security architect has formulated secure methods of communication between the clients and servers. The security architect can limit the connections they need to look at by only reviewing which servers and clients pass sensitive data.</p>
<p>Keep in mind, most of these architectures will fail to forget to encrypt data on back-end connections, such as database connections. Just because the data is now behind a firewall doesn’t mean it should be passed in clear-text.</p>
<p>To verify insecure communications won’t happen on your network:</p>
<ul>
<li>Make sure all client-to-server connections are encrypted with SSL.</li>
<li>Verify that server-to-database connections are encrypted.</li>
<li>Verify that any other areas in the design where sensitive data is passed is done so in a secure way.</li>
<li>Keep developers in a security mindset. Developers should never assume their application is sending their information securely. Developers should always assume that any communications that are being made are done insecurely.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://misc-security.com/blog/2009/10/insecure-communications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Insecure Cryptographic Storage</title>
		<link>http://misc-security.com/blog/2009/09/insecure-cryptographic-storage/</link>
		<comments>http://misc-security.com/blog/2009/09/insecure-cryptographic-storage/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 21:18:45 +0000</pubDate>
		<dc:creator>Brett Hardin</dc:creator>
				<category><![CDATA[Vulnerabilities]]></category>

		<guid isPermaLink="false">http://misc-security.com/blog/?p=64</guid>
		<description><![CDATA[Reading time: 3 &#8211; 4 minutes This is the eighth-part in a ten-part-series describing the OWASP Top 10. (See all the OWASP Top 10) What is Insecure Cryptographic Storage Insecure cryptographic storage occurs when an application doesn’t securely encrypt it’s sensitive data when it is stored into a database. This definition is similar to the picture [...]]]></description>
			<content:encoded><![CDATA[<p>Reading time: 3 &#8211; 4 minutes</p>
<div class="wp-caption aligncenter" style="width: 510px"><img title="Insecure Cryptographic Storage" src="http://farm3.static.flickr.com/2387/2452639579_e165388718.jpg" alt="2452639579 e165388718 Insecure Cryptographic Storage" width="500" height="333" /><p class="wp-caption-text">Photo: fpsurgeon</p></div>
<p>This is the eighth-part in a ten-part-series describing the <a href="http://misc-security.com/blog/2009/07/owasp-top-10-2007/">OWASP Top 10</a>. (<a href="http://misc-security.com/blog/2009/07/owasp-top-10-2007/">See all the OWASP Top 10</a>)</p>
<p><big><strong>What is Insecure Cryptographic Storage</strong></big><big><strong><br />
</strong></big></p>
<p>Insecure cryptographic storage occurs when an application doesn’t securely encrypt it’s sensitive data when it is stored into a database. This definition is similar to the picture above, recursive.</p>
<p>Simply stated, insecure cryptographic storage occurs when one of following happens:</p>
<ol>
<li><strong>The developers don’t encrypt the data that is being stored in the database.</strong></li>
<li>The developers do encrypt the data being stored in the database, but they rely on encryption methods they have developed. (Also known as home-grown cryptography)</li>
</ol>
<p>After reading these two points you may say, “only an <em>idiot</em> wouldn’t encrypt sensitive data being stored in the database.” I refer you to number two in the list above.</p>
<p>If you think you are smart enough to write your own cryptographic algorithms, you my friend, are the <em>idiot</em>.</p>
<p>The main business concern with not encrypting sensitive data is that it can lead to confidentiality loss. All companies are concerned with unauthorized individuals viewing their sensitive data. In addition, encrypting sensitive data is be a regulatory compliance. (See <a href="https://www.pcisecuritystandards.org/security_standards/index.php">PCI-DSS requirement 3</a>.)</p>
<p><big><strong>An Example of Insecure Cryptographic Storage</strong></big></p>
<p>Here is a simplified example. Selecting the users table from a database we are returned the following:</p>
<p><code>&gt; select * from users;</code></p>
<table border="1">
<tbody>
<tr>
<th>id</th>
<th>username</th>
<th>password</th>
</tr>
<tr>
<td>2</td>
<td>brett</td>
<td>5f4dcc3b5aa765d61d8327deb882cf99</td>
</tr>
<tr>
<td>2</td>
<td>dan</td>
<td>3c3662bcb661d6de679c636744c66b62</td>
</tr>
</tbody>
</table>
<p>The passwords in these table are 32 characters long. Could these passwords be MD5 hashes?</p>
<p>As with all hashing algorithms, MD5 hashes can’t be reversed. However, they can be pre-computed. Using a <a href="http://hashcrack.com/indx.php" target="_blank" class="broken_link">hash table lookup</a> we can identify what the password is before it was ran through the MD5 hashing algorithm.</p>
<p>After inserting<em> </em><em>5f4dcc3b5aa765d61d8327deb882cf99</em> into the online form the resulting password is returned. In this example, the password is “password.”</p>
<p><big><strong>How Do You Prevent </strong></big><big><strong>Insecure Cryptographic Storage From Occurring<br />
</strong></big></p>
<p>If the data is sensitive and stored it NEEDS to be encrypted. Examples of items that are considered to be sensitive can include:</p>
<ul>
<li>Credit Cards</li>
<li>User Names</li>
<li>Passwords</li>
<li>User data</li>
</ul>
<p>There are other things to keep in mind when making sure you securely store information. This includes not creating your own cryptographic algorithms. No matter how smart you or your peers think you are <strong>DO NOT attempt to invent a new encryption algorithm</strong>. Leave this work to the experts.</p>
<p>Ensure that the data stored is not easy to decrypt. This can usually be averted by not using known weak algorithms such as RC3, RC4, <a href="http://eprint.iacr.org/2004/199.pdf">MD5</a> and <a href="http://en.epochtimes.com/news/7-1-11/50336.html">SHA-1</a>.</p>
<p>If you are using asymmetric key encryption make sure to store your private keys carefully. If an attacker gets hold of the private key, you might as well not encrypt the data in the first place.</p>
]]></content:encoded>
			<wfw:commentRss>http://misc-security.com/blog/2009/09/insecure-cryptographic-storage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Broken Authentication and Session Management</title>
		<link>http://misc-security.com/blog/2009/08/broken-authentication-and-session-management/</link>
		<comments>http://misc-security.com/blog/2009/08/broken-authentication-and-session-management/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 20:54:41 +0000</pubDate>
		<dc:creator>Brett Hardin</dc:creator>
				<category><![CDATA[Vulnerabilities]]></category>

		<guid isPermaLink="false">http://misc-security.com/blog/?p=53</guid>
		<description><![CDATA[Reading time: 3 &#8211; 4 minutes This is the seventh-part in a ten-part-series describing the OWASP Top 10. (See all the OWASP Top 10) What is Broken Authentication and Session Management When developers are programming web application based solutions they rarely focus on how the user’s session is managed. Failing to keep this in mind can [...]]]></description>
			<content:encoded><![CDATA[<p>Reading time: 3 &#8211; 4 minutes</p>
<div class="wp-caption aligncenter" style="width: 510px"><img class=" " title="Broken Authentication and Session Management" src="http://farm5.static.flickr.com/4063/4266314914_0ab7cac5c4.jpg" alt="4266314914 0ab7cac5c4 Broken Authentication and Session Management" width="500" height="334" /><p class="wp-caption-text">Photo: Rinoninha</p></div>
<p>This is the seventh-part in a ten-part-series describing the <a href="http://misc-security.com/blog/2009/07/owasp-top-10-2007/">OWASP Top 10</a>. (<a href="http://misc-security.com/blog/2009/07/owasp-top-10-2007/">See all the OWASP Top 10</a>)</p>
<p><big><strong>What is Broken Authentication and Session Management<br />
</strong></big></p>
<p>When developers are programming web application based solutions they rarely focus on how the user’s session is managed. Failing to keep this in mind can lead developers to introduce session management vulnerabilities in their applications.</p>
<p>Session management vulnerabilities occur when developers fail to protect their users sensitive information such as user names, passwords, and session tokens.</p>
<p>Broken authentication vulnerabilities occur when developers fail to use authentication methods that have been adequately tested and rely on their own, often flawed, method for authenticating users.</p>
<p>These vulnerabilities are very hard for developers to identify on their own due to the far-reaching aspect of the code that handles session and authentication.</p>
<p><big><strong>An Example of </strong></big><big><strong>Broken Authentication and Session Management</strong></big></p>
<p>Due to the broad reach of this vulnerability there are many examples of broken authentication and session management occurring. Examples include forgotten password functionality, emailing user credentials, relying on IP address for session, not authenticating a user before changing a password, and not having adequate timeouts for inactive sessions.</p>
<p><strong>Forgotten Password Functionality</strong></p>
<p>Web applications often have a forgotten password functionality that allows a user to submit their user name to the application and are taken to a page with secret questions or a temporary password reset function.</p>
<p>Attackers can exploit this functionality to enumerate valid user name for the application. Developers often forget that a user name is half the puzzle to an attacker. Is an attacker knowing a password damaging if they don’t know a user name to go along with it?</p>
<p><big><strong>How Do You Prevent </strong></big><big><strong>Broken Authentication and Session Management</strong></big></p>
<p>Protecting credentials and session cookies is one of the most difficult tasks for a developer. Protecting this critical pieces of data can touch on many lines of code in several different files.</p>
<p>To prevent these types of vulnerabilities from occurring in your application, developers should first ensure that<strong>SSL is used for all authenticated parts of the application</strong>. In addition, <strong>verify that all credentials are stored in a hashed form</strong>.</p>
<p>As with all prevention methods preventing these vulnerabilities takes careful planning from the design stage of the application. The following should all be considered:</p>
<ul>
<li>Only use the native session management mechanism. Do not write your own session handlers. Do not use home-grown cookies for authentication or session-management.</li>
<li>Use a single authentication mechanism. Again, do not write your own authentication mechanism.</li>
<li>Do not allow the login process to happen from an unencrypted page.</li>
<li>Once a user authenticates, issue them a new session cookie and invalidate the previous session cookie. This will prevent session hijacking attacks from occurring.</li>
<li>Verify that every page of the application has a logout link that is easily identified by the user.</li>
<li>Have adequate timeouts for inactive sessions. Shorter is better.</li>
<li>Verify the user knows their old password before changing their password.</li>
<li>Do not send credentials (including the user name) over insecure channels, such as email.</li>
<li>Do not expose session identifiers, such as the session token, in the URL.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://misc-security.com/blog/2009/08/broken-authentication-and-session-management/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Information Leakage and Improper Error Handling</title>
		<link>http://misc-security.com/blog/2009/08/information-leakage-and-improper-error-handling/</link>
		<comments>http://misc-security.com/blog/2009/08/information-leakage-and-improper-error-handling/#comments</comments>
		<pubDate>Wed, 12 Aug 2009 21:56:12 +0000</pubDate>
		<dc:creator>Brett Hardin</dc:creator>
				<category><![CDATA[Vulnerabilities]]></category>

		<guid isPermaLink="false">http://misc-security.com/blog/?p=96</guid>
		<description><![CDATA[Reading time: 2 &#8211; 4 minutes This is the sixth-part in a ten-part-series describing the OWASP Top 10. (See all the OWASP Top 10) What is Information Leakage and Improper Error Handling Information leakage and improper error handling happen when web applications do not limit the amount of information they return to their users. A classic example [...]]]></description>
			<content:encoded><![CDATA[<p>Reading time: 2 &#8211; 4 minutes</p>
<div class="wp-caption aligncenter" style="width: 510px"><img title="Information Leakage and Improper Error Handling" src="http://farm4.static.flickr.com/3154/3058009462_f59cb3ed1a.jpg" alt="3058009462 f59cb3ed1a Information Leakage and Improper Error Handling" width="500" height="402" /><p class="wp-caption-text">Photo: bitzcelt</p></div>
<p>This is the sixth-part in a ten-part-series describing the <a href="http://misc-security.com/blog/2009/07/owasp-top-10-2007/">OWASP Top 10</a>. (See all the <a href="http://misc-security.com/blog/2009/07/owasp-top-10-2007/">OWASP Top 10</a>)</p>
<p><big><strong>What is Information Leakage and Improper Error Handling</strong></big></p>
<p>Information leakage and improper error handling happen when web applications do not limit the amount of information they return to their users. A classic example of improper error handling is when an application doesn’t sanitize SQL error messages that are returned to the user. Upon receiving a SQL error message an attacker will immediately identify a place for identifying <a href="http://misc-security.com/blog/2009/07/injection-flaws/">injection flaws</a>.</p>
<p>Although preventing error messages from reaching users will not prevent vulnerabilities from occurring, it does make it difficult for an attacker to accomplish his goal and it is also an industry best practice.</p>
<p><big><strong>An Example of </strong></big><big><strong>Information Leakage</strong></big></p>
<p>Common examples of information leakage include helpful error messages and service banners. Developers and system administrators often forget or disregard how something as simple as a server banner can be used by an attacker.</p>
<p>As an example, if your server is running Apache and you return the server header with your responses, an attacker could leverage this to fingerprint the version of the web server you are running.</p>
<p>Using nmap an attacker could send a few packets at your application server using the command, <code>nmap -sV -p 80 192.168.1.100</code> and identify the following:</p>
<p><code>Interesting ports on 192.168.38.132:<br />
PORT    STATE SERVICE  VERSION<br />
80/tcp  open  http     Apache httpd 1.3.37</code></p>
<p>The attacker has now identified your Apache version and can now search for vulnerabilities affecting that version of Apache.</p>
<p><big><strong>An Example of Improper Error Handling</strong></big></p>
<p>Attackers attempt to leverage information that applications freely volunteer. If an application displays an error messages to the user (attacker), there is not guarantee that the user will “ignore” this error message.</p>
<p>Developers typically forget to properly handle their error messages. Stack traces and SQL errors are two examples of very commonly forgotten errors that should be handled.</p>
<p>Attackers love seeing error messages such as:</p>
<p><code>ERROR:  unterminated quoted string at or near "'''"</code></p>
<p><big><strong>How Do You Prevent Information Leakage and Improper Error Handling</strong></big></p>
<p>When developing applications, developers should assume all of the users are hostile. As a developer having this mentality will greatly aid you in developing secure applications.</p>
<p>All information returned from a web server should be reviewed for potential leakage. This can be automated by a QA team using a fuzzer.</p>
<p>Developers should also use a standard exception handling architecture to prevent information leakage from occurring. This architecture should be used and shared across the entire development team. <strong>All developers should handle their errors the same way</strong>.</p>
<p>Developers or product managers may also decide to create a default error handler which returns sanitized error messages for most users in production for all error paths. Doing this will greatly reduce the attack surface that can be exploited through error message generation.</p>
]]></content:encoded>
			<wfw:commentRss>http://misc-security.com/blog/2009/08/information-leakage-and-improper-error-handling/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cross Site Request Forgery (CSRF)</title>
		<link>http://misc-security.com/blog/2009/08/cross-site-request-forgery-csrf/</link>
		<comments>http://misc-security.com/blog/2009/08/cross-site-request-forgery-csrf/#comments</comments>
		<pubDate>Wed, 05 Aug 2009 21:49:52 +0000</pubDate>
		<dc:creator>Brett Hardin</dc:creator>
				<category><![CDATA[Vulnerabilities]]></category>

		<guid isPermaLink="false">http://misc-security.com/blog/?p=93</guid>
		<description><![CDATA[Reading time: 2 &#8211; 4 minutes This is the fifth-part in a ten-part-series describing the OWASP Top 10. (See all the OWASP Top 10) What is Cross-Site Request Forgery (CSRF) Cross-Site request forgery is a client-side vulnerability that allows an attacker to make requests on the user’s behalf. Although, most CSRF exploits require a user to [...]]]></description>
			<content:encoded><![CDATA[<p>Reading time: 2 &#8211; 4 minutes</p>
<div class="wp-caption aligncenter" style="width: 510px"><img class="  " title="Cross Site Request Forgery CSRF" src="http://farm4.static.flickr.com/3197/2689052349_07738f5902.jpg" alt="2689052349 07738f5902 Cross Site Request Forgery (CSRF)" width="500" height="332" /><p class="wp-caption-text">Photo: Joe Penniston</p></div>
<p>This is the fifth-part in a ten-part-series describing the <a href="http://misc-security.com/blog/2009/07/owasp-top-10-2007/">OWASP Top 10</a>. (<a href="http://misc-security.com/blog/2009/07/owasp-top-10-2007/">See all the OWASP Top 10</a>)</p>
<p><big><strong>What is Cross-Site Request Forgery (CSRF)<br />
</strong></big></p>
<p>Cross-Site request forgery is a client-side vulnerability that allows an attacker to make requests on the user’s behalf. Although, most CSRF exploits require a user to be authenticated to the susceptible site to be successful, this is not always the case.</p>
<p><big><strong>An Example of Cross-Site Request Forgery<br />
</strong></big></p>
<p>A user (victim) opens their browser and logs on to their online banking application located at<code>http://bank.com</code></p>
<p>After checking their balance they browse away from the site (without logging off) and start reading web pages about olives from Madagascar. One of these olive sites is owned by an attacker. The attacker’s website has the following img src tag:</p>
<p><code>&lt;img src="http://bank.com/transfer.asp?to_acct=445544&amp;amount=1000"&gt;</code></p>
<p>When the victim’s browser loads the malicious page that contains this img src tag, the victims browser makes the transfer request (<code>/transfer.asp?to_acct=445544&amp;amount=1000</code>) to bank.com using the <strong>authenticated</strong>cookie from the earlier session. Upon making this request, the bank then transfers $1,000 from the victim’s account to account 445544. The attacker has now successfully executed a cross-site request forgery attack against a user of bank.com</p>
<p><big><strong>How Do You Prevent Cross-Site Request Forgery</strong></big></p>
<p>Any <strong>sensitive</strong> request that is generated by the user should force the user to “re-authenticate.” A simple example is that of change password functionality. You always want to verify the user knows the old password before changing their password, even if they are currently authenticated.</p>
<p>If you determine that “re-authentication” may be an inconvenience for the user or if all of your requests are considered sensitive then the application developers should include a random token that is unique to the user session. This token <strong>should not</strong> be present in the cookie, but rather as a hidden field in the HTML and then appended to the URL during any form submission.</p>
<p>When the attacker attempts to trick the users browser into making a request, the web application will look for this random token. The random token will not exist for the request, and the request will be denied. This prevents the CSRF attack from being successful.</p>
<p><strong>Note:</strong> Having SSL does not protect your application from CSRF vulnerabilities.</p>
]]></content:encoded>
			<wfw:commentRss>http://misc-security.com/blog/2009/08/cross-site-request-forgery-csrf/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Insecure Direct Object Reference</title>
		<link>http://misc-security.com/blog/2009/07/insecure-direct-object-reference/</link>
		<comments>http://misc-security.com/blog/2009/07/insecure-direct-object-reference/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 21:06:45 +0000</pubDate>
		<dc:creator>Brett Hardin</dc:creator>
				<category><![CDATA[Vulnerabilities]]></category>

		<guid isPermaLink="false">http://misc-security.com/blog/?p=61</guid>
		<description><![CDATA[Reading time: 2 &#8211; 4 minutes This is the fourth-part in a ten-part-series describing the OWASP Top 10. (See all the OWASP Top 10) What is Insecure Direct Object Reference Insecure Direct Object Reference is when a web application exposes an internal implementation object to the user. Some examples of internal implementation objects are database records, [...]]]></description>
			<content:encoded><![CDATA[<p>Reading time: 2 &#8211; 4 minutes</p>
<div class="wp-caption aligncenter" style="width: 510px"><img title="Insecure Direct Object Reference" src="http://farm4.static.flickr.com/3167/2538415572_b61ff16742.jpg" alt="2538415572 b61ff16742 Insecure Direct Object Reference" width="500" height="278" /><p class="wp-caption-text">Photo: tim_norris</p></div>
<p>This is the fourth-part in a ten-part-series describing the <a href="http://misc-security.com/blog/2009/07/owasp-top-10-2007/">OWASP Top 10</a>. (<a href="http://misc-security.com/blog/2009/07/owasp-top-10-2007/">See all the OWASP Top 10</a>)</p>
<p><big><strong>What is Insecure Direct Object Reference</strong></big></p>
<p>Insecure Direct Object Reference is when a web application exposes an internal implementation object to the user. Some examples of internal implementation objects are database records, URLs, or files.</p>
<p>An attacker can modify the internal implementation object in an attempt to abuse the access controls on this object. When the attacker does this they may have the ability to access functionality that the developer didn’t intend to expose access to.</p>
<p><big><strong>Examples of Insecure Direct Object Reference</strong></big></p>
<p>Insecure direct object reference is a very broad category of vulnerabilities. There are many examples of these types of vulnerabilities found in the wild by other names. Open Redirects and Directory Traversal are two classic examples of an insecure direct object reference vulnerability.</p>
<p><strong>Open Redirect</strong></p>
<p>This is where the web application has a parameter that allows the website to redirect the user somewhere else. If this parameter is not implemented properly using a white list, attackers can use this in a phishing attack to lure potential victims to a site of their choosing. More information about Open Redirects can be found <a href="http://cwe.mitre.org/data/definitions/601.html">here</a>.</p>
<p><strong>Directory Traversal</strong></p>
<p>Assume a web application allows for a file to be rendered to a user that is stored on the local machine. If the application isn’t verifying what files should be accessed, an attacker can request other files on the file system and those will also be displayed.</p>
<p>For instance, if the attacker notices the URL:</p>
<p><code>http://misc-security.com/file.jsp?file=report.txt</code></p>
<p>The attacker could modify the file parameter using a directory traversal attack. He modifies the URL to:</p>
<p><code>http://misc-security.com/file.jsp?file=<strong>../../../etc/shadow</strong></code></p>
<p>Upon doing this the /etc/shadow file is returned and rendered by file.jsp demonstrating the page is susceptible to a directory traversal attack.</p>
<p><big><strong>How Do You Prevent Insecure Direct Object Reference From Occurring in Your Application</strong></big><br />
As always, web application developers can prevent these attacks through good planning.</p>
<p>Developers<strong> should</strong> use indirect reference maps. Direct mapping can easily be guessed by attackers. Developers should avoid exposing private objects to users. File names, external/internal URL’s, and database keys are all examples of things that should not be displayed to the user.</p>
<p>If direct objects must be used, then the developers should ensure through validation that the user is authorized to view what they are attempting to access. In the directory traversal example, determine what files the user should access and only grant them privileges to those files. This is known as an “accept known good” approach and is always a good idea when it comes to developing secure applications.</p>
]]></content:encoded>
			<wfw:commentRss>http://misc-security.com/blog/2009/07/insecure-direct-object-reference/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Injection Flaws</title>
		<link>http://misc-security.com/blog/2009/07/injection-flaws/</link>
		<comments>http://misc-security.com/blog/2009/07/injection-flaws/#comments</comments>
		<pubDate>Wed, 08 Jul 2009 21:45:46 +0000</pubDate>
		<dc:creator>Brett Hardin</dc:creator>
				<category><![CDATA[Vulnerabilities]]></category>

		<guid isPermaLink="false">http://misc-security.com/blog/?p=91</guid>
		<description><![CDATA[Reading time: 3 &#8211; 4 minutes This is the second-part in a ten-part-series describing the OWASP Top 10. (See all the OWASP Top 10) What are Injection FlawsInjection flaws are a class of security vulnerability that allows a user to “break out” of the web application context. If your web application takes user input and [...]]]></description>
			<content:encoded><![CDATA[<p>Reading time: 3 &#8211; 4 minutes</p>
<div class="wp-caption aligncenter" style="width: 510px"><img title="Injection Flaws" src="http://farm5.static.flickr.com/4069/4561376850_6f002abeb9.jpg" alt="4561376850 6f002abeb9 Injection Flaws" width="500" height="357" /><p class="wp-caption-text">Photo: doug88888</p></div>
<p>This is the second-part in a ten-part-series describing the <a href="http://misc-security.com/blog/2009/07/owasp-top-10-2007/">OWASP Top 10</a>. (<a href="http://misc-security.com/blog/2009/07/owasp-top-10-2007/">See all the OWASP Top 10</a>)</p>
<div><big><strong>What are Injection Flaws</strong></big>Injection flaws are a class of security vulnerability that allows a user to “break out” of the web application context. If your web application takes user input and inserts that user input into a back-end database, shell command, or operating system call, your application may be susceptible to an injection flaw.</p>
</div>
<div>
<p>A user exploits this by breaking out of the intended “context” and appends additional and often unintended functionality. <strong>By allowing injection flaws in your application you are allowing an attacker to create, read, update, or delete any arbitrary data available to the application.</strong></p>
<p><big><strong>Examples of Injection Flaws</strong></big></p>
<p>There are many types of injection flaws. The most common being SQL injection. In addition there is <a href="http://www.owasp.org/index.php/LDAP_injection">LDAP injection</a>, <a href="http://projects.webappsec.org/w/page/13247004/XML-Injection">XML Injection</a>, <a href="http://www.owasp.org/index.php/XPATH_Injection">XPath Injection</a>, <a href="http://www.owasp.org/index.php/OS_Command_Injection">OS command injection</a>, and <a href="http://misc-security.com/blog/2009/05/xss-cross-site-scripting/">HTML injection</a>. Injection flaws however are not limited to just these. If your web application inserts user input into any interpreter or process, your web application can contain these vulnerabilities. You can see an example of how an injection flaw works here.</p>
<p><big><strong>How Do You Prevent Injection Flaws</strong></big></p>
<p>Before calling an external function, verify that the data is what you expect. <strong>This is referred to as validation.</strong> For instance, if you expect your function to be passed a string that contains a user’s first name, should it contain any special characters? <code>John</code> is a valid name. But, <code>J&lt;o&gt;hn</code> isn’t. Both user names need to be ran through a validation function and in order for the web application to determine whether the data is what the developer expects.</p>
<p>There are certain exceptions however that can get you in trouble. Single Quotes (‘) are valid characters in people’s last names. However, <strong>if you allow a single quote in a last name field, you can be introducing SQL injection into your application.</strong></p>
<p><strong>In cases where you need to allow a single quote (‘), in addition to validation, you should also sanitize (encode) the input.</strong> Sanitizing the input is determining a way that the input can be transformed into “non-threatening” data. This needs to be done on a case by case basis.</p>
<p>For example, If you understand that the sanitized data will always be returned in a browser, you could simple HTML encode or URL encode the string. A quote becomes, <code>'</code> (HTML encoding) or <code>%27</code> (URL encoding).</p>
<p>When sanitizing input, it is important to make sure you decode the string before it is displayed to the user. It can be embarrassing if John O’Brien’s name is printed as:<code> Tim O%27Brien</code></p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://misc-security.com/blog/2009/07/injection-flaws/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

