<?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>Veracode Security Blog: Application security research, security trends and opinions &#187; 2009 &#187; November</title>
	<atom:link href="http://www.veracode.com/blog/2009/11/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.veracode.com/blog</link>
	<description>Application security testing, analysis, and metrics</description>
	<lastBuildDate>Fri, 18 May 2012 16:17:21 +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>An Ounce of Prevention is Worth a Pound of Cure</title>
		<link>http://www.veracode.com/blog/2009/11/an-ounce-of-prevention-is-worth-a-pound-of-cure/</link>
		<comments>http://www.veracode.com/blog/2009/11/an-ounce-of-prevention-is-worth-a-pound-of-cure/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 22:42:27 +0000</pubDate>
		<dc:creator>Chris Eng</dc:creator>
				<category><![CDATA[Application Security]]></category>
		<category><![CDATA[RESEARCH]]></category>
		<category><![CDATA[SDLC]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Tools and Applications]]></category>

		<guid isPermaLink="false">http://www.veracode.com/blog/?p=983</guid>
		<description><![CDATA[A conversation on Twitter this morning started out like this: @dinozaizovi: Finding vulnerabilities without exploiting them is like putting on a dress when you have nowhere to go. This clever analogy spurred a discussion about the importance of proving exploitability as a prerequisite to fixing bugs. While I agree that nothing is more convincing than [...]]]></description>
			<content:encoded><![CDATA[<p>A conversation on Twitter this morning started out like this:</p>
<blockquote><p>
@dinozaizovi: Finding vulnerabilities without exploiting them is like putting on a dress when you have nowhere to go.
</p></blockquote>
<p>This clever analogy spurred a discussion about the importance of proving exploitability as a prerequisite to fixing bugs.  While I agree that nothing is more convincing than a working exploit, there will always be a greater volume of bugs discovered than there are vulnerability researchers to write exploits.  Don&#8217;t get me wrong &#8212; as a former penetration tester, I agree that it is <em>fun</em> to write exploits, it just shouldn&#8217;t be a gating factor.  Putting the burden of proof on the researcher to develop an exploit is not scalable, nor does it help create a development culture that improves software security over the long term. </p>
<p>A related topic, and one that hits closer to home for me, is how software developers deal with the results of static analysis.  Static analysis is often misunderstood, particularly by people who have only dealt with dynamic analysis (fuzzing, web scanning, etc.) or penetration testing in the past.  Because static analysis detects flaws without actually executing the target application, there&#8217;s an increased likelihood of finding &#8220;noise&#8221; (insignificant flaws) or false positives. On the other hand, static analysis provides broader coverage, often detecting flaws in complex code paths that a web scan or human tester would be unlikely to find.  So there&#8217;s your trade-off.</p>
<p>Here&#8217;s a conversation I have all too frequently, paraphrased:</p>
<div id="indent">
<p><strong>DEVELOPER</strong><br />
I don&#8217;t think I should have to fix this SQL injection flaw unless you can prove to me that it&#8217;s exploitable.</p>
<p><strong>ME</strong><br />
Static analysis isn&#8217;t performed against a running instance of the application.  Not all flaws will be exploitable vulnerabilities, but some of them almost certainly are.  Here, let me show you all of the code paths where untrusted user input enters the application and eventually gets used in the ad-hoc SQL query we&#8217;ve marked as a bug.</p>
<p><strong>DEVELOPER</strong><br />
But what&#8217;s the URL that I can click on to exploit it?</p>
<p><strong>ME</strong><br />
Static analysis is different from a penetration test.  The output of our analysis is a code path, not a URL.  URL construction cannot be derived solely from the application code, because it depends on outside factors such as how the web server and application server are configured.  Moreover, we don&#8217;t have the necessary context of how this flaw fits into the business logic of the application.  Maybe this functionality is only accessible by certain users when their accounts are in a particular status.  It might take a couple hours working closely with a developer in a test environment to come up with the attack URL.  It might take several more hours to write a script around that attack URL to mine the database.  On the other hand, it would take about 10 minutes to replace that ad-hoc query with a parameterized prepared statement.</p>
<p><strong>DEVELOPER</strong><br />
Well, if you can&#8217;t demonstrate the vulnerability, then it&#8217;s not real.  </p>
<p><strong>ME</strong><br />
Demonstrating a working exploit certainly proves a system is vulnerable.  But the lack of a working exploit is hardly proof that it&#8217;s <em>not</em> vulnerable.  You could spend the time to investigate every single flaw to figure out which ones are vulnerable, or you could fix them all in such a way that you&#8217;re guaranteed it won&#8217;t be vulnerable.  In our opinion, the time is better spent on the latter. </p>
<p><strong>DEVELOPER</strong><br />
[more defensiveness]</p>
<p><strong>ME</strong><br />
[bangs head against wall]
</div>
<p>Now imagine that conversation stretching out to 30 minutes or more.  They could&#8217;ve fixed a half-dozen flaws already.  And it&#8217;s not limited to SQL injection.  For example, consider cross-site scripting (XSS):</p>
<div id="indent">
<p><strong>DEVELOPER</strong><br />
I need you to prove that this XSS flaw is exploitable.</p>
<p><strong>ME</strong><br />
How about just applying the proper output encoding so you <em>know</em> the untrusted input will be rendered safely by the browser?</p>
</div>
<p>Buffer overflows:</p>
<div id="indent">
<p><strong>DEVELOPER</strong><br />
I need you to prove that this buffer overflow is exploitable.</p>
<p><strong>ME</strong><br />
How about just using a bounded copy or putting in a length check, so you <em>know</em> the buffer won&#8217;t overflow?</p>
</div>
<p>By now you get the picture.  Many developers want proof, to the extent that they&#8217;ll sacrifice efficiency to get it.  If we are to improve software over the long haul, developers must learn to recognize situations where it takes less time to patch a bug than to argue about its exploitability.  On a more positive note, from someone who talks to static analysis customers on a daily basis, the tide is starting to turn in the right direction.  But it is still an uphill battle.</p>
<h5>Veracode Security Solutions</h5>
<div style="margin-left:15px;">
<a href="http://www.veracode.com/security/static-analysis-tool">Static Analysis Tool</a><br />
<a href="http://www.veracode.com/security/penetration-testing">Penetration Testing Tool</a><br />
<a href="http://www.veracode.com/security/static-code-analysis">Static Code Analysis</a><br />
<a href="http://www.veracode.com/security/vulnerability-scanning">Vulnerability Scanning</a><br />
<a href="http://www.veracode.com/security/web-application-security-testing">Web Application Testing</a><br />
<a href="http://www.veracode.com/security/software-testing-tools">Software Testing Tools</a><br />
<a href="http://www.veracode.com/security/source-code-security-analyzer">Source Code Security Analyzer</a><br />
<a href="http://www.veracode.com/security/code-security">Software Code Security</a><br />
<a href="http://www.veracode.com/security/application-testing-tool">Application Testing Tool</a><br />
<a href="http://www.veracode.com/security/code-analysis">Source Code Analysis</a><br />
<a href="http://www.veracode.com/security/code-review">Code Review Tools</a></div>
<h5>Veracode Security Threat Guides</h5>
<div style="margin-left:15px;">
<a href="http://www.veracode.com/security/sql-injection">Prevention of SQL Injection</a><br />
<a href="http://www.veracode.com/security/xss">Cross Site Scripting Vulnerabilities</a><br />
<a href="http://www.veracode.com/security/csrf">CSRF Attacks</a><br />
<a href="http://www.veracode.com/security/ldap-injection">LDAP Injection</a><br />
<a href="http://www.veracode.com/security/mobile-code-security">Mobile Code Security</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.veracode.com/blog/2009/11/an-ounce-of-prevention-is-worth-a-pound-of-cure/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>We Need To Learn More About the RBS Worldpay ATM Attack</title>
		<link>http://www.veracode.com/blog/2009/11/we-need-to-learn-more-about-the-rbs-worldpay-atm-attack/</link>
		<comments>http://www.veracode.com/blog/2009/11/we-need-to-learn-more-about-the-rbs-worldpay-atm-attack/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 17:09:40 +0000</pubDate>
		<dc:creator>Chris Wysopal</dc:creator>
				<category><![CDATA[Application Security]]></category>
		<category><![CDATA[RESEARCH]]></category>

		<guid isPermaLink="false">http://www.veracode.com/blog/?p=968</guid>
		<description><![CDATA[The size and scope of the RBS Worldpay ATM heist are unprecedented. The perpetrators stole $9M in a matter of hours from 2100 ATMs worldwide. An indictment was handed down on Nov 10, 2009. I am always on the lookout for indictments and trials related to computer crime because this is often the only time [...]]]></description>
			<content:encoded><![CDATA[<p>The size and scope of the RBS Worldpay ATM heist are unprecedented.  The perpetrators stole $9M in a matter of hours from 2100 ATMs worldwide. An <a href="http://www.wired.com/images_blogs/threatlevel/2009/11/rbs-worldpay-indictment.pdf">indictment</a> was handed down on Nov 10, 2009.  I am always on the lookout for indictments and trials related to computer crime because this is often the only time the details of the attacker&#8217;s techniques and victim&#8217;s vulnerabilities are released publically.  For instance it wasn&#8217;t until an indictment was issued in the Heartland Payment Systems breach that we found out how the attackers breached the perimiter.  In that case it was a SQL Injection flaw on an internet facing web application.  What can we learn from the RBS Worldpay indictment?</p>
<p>The indictment states that the attackers were able to generate ATM cards and obtain the correct PIN codes to make a withdrawal.  PIN codes, like most sensitive secrets, are stored in encrypted form. The indictment states that the attackers were able to reverse engineer the PIN codes. I take this to mean they didn&#8217;t sniff them on the network but figured out how to turn the stored encrypted PIN code back into the plain text PIN.  If this is the case there is a huge vulnerability in the way banks are storing PINs.  There are many different PIN storage algorithms out there and the older ones have weaknesses.  As an example, here is a <a href="http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.12.2118&#038;rep=rep1&#038;type=pdf">paper</a> on attacking the algoritm used by IBM 3624s which many ATMs are based on.  Like password hash storage in Windows, backwards compatibility with older encryption formats can be a grave weakness. I am hoping that the FBI or Secret Service has shared the details of this attack with all US banks. </p>
<p>We know to get to the encrypted PINs the attackers had to breach the perimeter of RBS Worldpay.  The indictment states the attackers used a vulnerability in the RBS Worldpay computer network.  This is about as vague as it gets.  Was it a misconfigured firewall, a web application vulnerability, an unpatched server, or something else?  This would be nice to know from an industry viewpoint because if RBS WorldPay isn&#8217;t dedicating enough resources to protect from a particular threat then other organizations likely aren&#8217;t also.</p>
<p>Finally some nice details. The indictment shows the SQL commands that were executed to manipulate the bank&#8217;s database to change limits on certain ATM cards and delete transaction data. It is not clear how the attackers are accessing the SQL server, whether it is a command-line on the server itself, another machine, or perhaps through SQL Injection.  It is clear that it is game over once an attacker can modify your database tables.</p>
<p>I hope more details come to light so the industry can be educated from this attack and it isn&#8217;t simply a data breach datapoint.</p>
<p><strong>Update:</strong></p>
<p>Several people have asked me about PIN cracking.  The papers talk about PIN cracking as an &#8220;insider attack&#8221;.  The truth of the matter is once you breach the perimeter and are in the soft gooey center, for all intents and purposes, you are an insider.</p>
<p>There are a few papers on the topic.</p>
<p><a href="http://www.arx.com/documents/The_Unbearable_Lightness_of_PIN_Cracking.pdf ">The Unbearable Lightness of PIN Cracking</a> delivered at Financial Cryptography and Data Security 2007 describes a few techniques.  </p>
<p>Here is an excerpt of the approaches:</p>
<blockquote><p>It is well known that when several PIN block formats are available the security<br />
of the whole system degrades to the security of the weakest PIN block<br />
format. The attacks demonstrate that reformatting capability between different<br />
PIN block formats allows an attacker to abuse weaknesses of both formats.<br />
Therefore enabling reformatting is more dangerous than using the weakest format.<br />
We have also shown that the ISO-1 format is extremely weak and thus<br />
should be immediately removed from the list of allowed interchange transaction<br />
formats.</p>
<p>Another interesting insight from the attacks described is that the offset and<br />
the PVV values may reveal as much information as the PIN itself. One possible<br />
remedy is treating the offset and the PVV as secret values.<br />
The changes require worldwide modifications in ATMs, HSMs and other components<br />
implementing the PIN processing API.<br />
In addition to all implementation of this API, systems applying the EMV<br />
standard ([7]) and using online (rather than off-line) PIN verification are also<br />
vulnerable to the attacks.</p></blockquote>
<p>Another Paper: <a href="http://www.lsv.ens-cachan.fr/Publis/PAPERS/PDF/Steel-tcs06.pdf">Formal Analysis of PIN Block Attacks</a></p>
<blockquote><p>Abstract</p>
<p>PIN blocks are 64-bit strings that encode a PIN ready for encryption and secure<br />
transmission in banking networks. These networks employ tamper proof hardware<br />
security modules (HSMs) to perform sensitive cryptographic operations, such as<br />
checking the correctness of a PIN typed by a customer. The use of these HSMs is<br />
controlled by an API designed to enforce security. PIN block attacks are unanticipated<br />
sequences of API commands which allow an attacker to determine the value<br />
of a PIN in an encrypted PIN block. This paper describes a framework for formal<br />
analysis of such attacks. Our analysis is probabilistic, and is automated using<br />
constraint logic programming and probabilistic model checking.</p></blockquote>
<h5>Veracode Security Solutions</h5>
<div style="margin-left:15px;">
<a href="http://www.veracode.com/security/application-testing-tool">Application Testing Tool</a><br />
<a href="http://www.veracode.com/security/static-analysis-tool">Static Analysis</a><br />
<a href="http://www.veracode.com/security/penetration-testing">Penetration Testing</a><br />
<a href="http://www.veracode.com/security/static-code-analysis">Static Code Analysis</a><br />
<a href="http://www.veracode.com/security/vulnerability-scanning">Vulnerability Scanning Tools</a><br />
<a href="http://www.veracode.com/security/web-application-security-testing">Web Application Security</a><br />
<a href="http://www.veracode.com/security/software-testing-tools">Software Testing Tools</a><br />
<a href="http://www.veracode.com/security/source-code-security-analyzer">Source Code Security Analyzer</a><br />
<a href="http://www.veracode.com/security/code-security">Software Code Security</a><br />
<a href="http://www.veracode.com/security/code-analysis">Source Code Analysis</a><br />
<a href="http://www.veracode.com/security/code-review">Code Review</a></div>
<h5>Veracode Security Threat Guides</h5>
<div style="margin-left:15px;">
<a href="http://www.veracode.com/security/sql-injection">SQL Injection Vulnerabilities</a><br />
<a href="http://www.veracode.com/security/xss">Cross Site Scripting</a><br />
<a href="http://www.veracode.com/security/csrf">Cross Site Request Forgery</a><br />
<a href="http://www.veracode.com/security/ldap-injection">LDAP Injection</a><br />
<a href="http://www.veracode.com/security/mobile-code-security">Mobile Code Security</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.veracode.com/blog/2009/11/we-need-to-learn-more-about-the-rbs-worldpay-atm-attack/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

