<?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 Blog &#187; SDLC</title>
	<atom:link href="http://www.veracode.com/blog/category/sdlc/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.veracode.com/blog</link>
	<description>Application security testing, analysis, and metrics</description>
	<lastBuildDate>Thu, 09 Feb 2012 13:18:47 +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>Musings on Custer&#8217;s Last Stand</title>
		<link>http://www.veracode.com/blog/2011/08/musings-on-custers-last-stand/</link>
		<comments>http://www.veracode.com/blog/2011/08/musings-on-custers-last-stand/#comments</comments>
		<pubDate>Wed, 31 Aug 2011 15:00:53 +0000</pubDate>
		<dc:creator>Chris Wysopal</dc:creator>
				<category><![CDATA[Application Security]]></category>
		<category><![CDATA[Binary Analysis]]></category>
		<category><![CDATA[RESEARCH]]></category>
		<category><![CDATA[SDLC]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Vulnerabilities]]></category>

		<guid isPermaLink="false">http://www.veracode.com/blog/?p=1999</guid>
		<description><![CDATA[Let’s not mince words: this rambling diatribe from Oracle’s CSO is aimed directly at Veracode. No need for a cutesy acronym; we&#8217;re the only company with true static binary analysis technology, delivered as a service. Now that we’ve got that out of the way, let’s try to cut through the rhetoric (in just over a [...]]]></description>
			<content:encoded><![CDATA[<p>Let’s not mince words: this <a href="http://blogs.oracle.com/maryanndavidson/entry/those_who_can_t_do">rambling diatribe</a> from Oracle’s CSO is aimed directly at Veracode.  No need for a cutesy acronym; we&#8217;re the only company with true static binary analysis technology, delivered as a service.  Now that we’ve got that out of the way, let’s try to cut through the rhetoric (in just over a thousand words, to boot).</p>
<p>The recurring theme in her manifesto is the notion that certain software suppliers are &#8220;too big to test&#8221;.  It’s fine for the little guys, but not the 800-pound gorillas. Instead, software purchasers should blindly trust companies with security teams and assurance processes to produce secure code.  If only it were that simple.  In fact, according to our semi-annual <a href="http://info.veracode.com/state-of-software-security-report-volume3.html">State of Software Security Report</a>, there&#8217;s negligible variation in security quality across software suppliers regardless of company size.</p>
<p><center><img src="http://www.veracode.com/blog/wp-content/uploads/2011/08/sossfig26-smaller.png" alt="" title="sossfig26-smaller" width="492" height="357" class="aligncenter size-full wp-image-2035" style="padding-right:20px" /></center></p>
<p>We’re both flattered and amused that Ms. Davidson believes our company alone &#8220;created a market&#8221; for testing the software supply chain.  On the contrary, the market has created itself.  Take a look through the noteworthy breaches from the past 12-24 months; software vulnerabilities have been the culprit in nearly every case.  CISOs are waking up to the stark realization that all software &#8212; internally or externally produced &#8212; introduces risk into their organizations.  In this day and age, wise companies harbor a healthy suspicion of their software vendors.  Oracle can choose to do security testing in-house, but a company that&#8217;s &#8220;running their entire business&#8221; on Oracle’s software has a right to request unbiased evidence that the testing process is working.  </p>
<p>That being said, Oracle is hardly the poster child for security process.  Within the security community, they are notorious for shipping insecure products.  Their laughable &#8220;Unbreakable&#8221; marketing campaign was <a href="http://www.securityfocus.com/news/309">famously debunked</a> by security expert David Litchfield, who uncovered several critical (and easily avoidable) vulnerabilities within a matter of weeks.  They’ve also earned a reputation for <a href="http://seclists.org/bugtraq/2005/Oct/56">glacial response times and sloppy patches</a>.  No company can be expected to build perfectly secure software, but it’s pretty obvious why external validation is needed to complement in-house process &#8212; one need look no further than <a href="http://www.zerodayinitiative.com/advisories/published/">ZDI</a> for evidence.  Even Ms. Davidson&#8217;s own example illustrates how an outsourced service provider &#8220;HuiMaika&#8217;i&#8221; detected multiple vulnerabilities that weren’t discovered by Oracle’s internal team.</p>
<p>Perhaps the most shocking admission about Oracle&#8217;s security program is their interpretation of the &#8220;need to know&#8221; principle. Ms. Davidson asserts that she doesn&#8217;t need access to bug databases. This is a classic liability avoidance move and one that we&#8217;ve witnessed in other organizations as well.  Creating barriers to vulnerability information facilitates a culture in which the executive has plausible deniability of critical bugs and can simply look the other way if a ship deadline is looming or if the auditors pay a visit. CISOs should be clamoring for as much data as they can get their hands on, not eschewing it.</p>
<p>Finally, Ms. Davidson seemed offended that a tenured university professor would suggest licensing software developers to create a system of accountability.  Ironically, only a few years ago, she sent a letter to top universities pressuring them to incorporate secure coding guidelines such as the SANS coding certification into their curriculums.  She told them, &#8220;<a href="http://www.cert.org/podcast/show/20080930davidson.html">We will start making our purchasing decisions</a>, if you will, based on that.&#8221;  Apparently, it’s OK for Oracle to flex their muscle when &#8220;buying&#8221; (i.e. hiring) from universities, but it’s not OK for Oracle’s customers to hold them to similar standards?  It certainly sounds like Oracle has been feeling the pressure lately. </p>
<div style="float:right; margin-left:20px; margin-bottom:10px"><a href="http://www.veracode.com/blog/wp-content/uploads/2011/08/consumer-reports.jpg"><img src="http://www.veracode.com/blog/wp-content/uploads/2011/08/consumer-reports-224x300.jpg" alt="" title="consumer-reports" width="224" height="300" class="alignright size-medium wp-image-2027" /></a></div>
<p>There are third-party tests and assessments for perhaps every important purchase in business or in our personal lives. Companies hire law firms and specialists when they make acquisitions. People look to safety and quality tests from trusted sources before they buy everything from baby strollers to cars. You wouldn&#8217;t think of buying a home without a home inspection.  In each case, the cost of the independent test must be commensurate with the purchase price and the risk. Look at the typical due dilligence around home purchase. It doesn&#8217;t always make sense to pay an engineering firm thousands of dollars for a structural analysis, but it does make sense to hire a home inspector for a few hundred dollars, who in a few hours can uncover termites or a leaking roof. These are problems that must be fixed, and because the testing cost is so low it would be negligent not to do it.  Most of the major software vendors have participated in third-party testing either as part of their SDLC, to vet code they were acquiring or licensing, or as part of one of their customers&#8217; procurement process.</p>
<p>Veracode has never claimed that binary SAST provides complete software assurance.  From the beginning, we have recommended multiple testing methods to detect vulnerabilities that static automation can’t.  In fact, it’s impossible to receive our top ratings without a clean bill of health from a manual penetration test.  Each layer of testing, while imperfect on its own, uncovers problems that must be corrected.  </p>
<p>Outsourcing is not a dirty word.  Many companies outsource development for entire products or components of them.  Companies also outsource testing and training.  The multi-billion dollar IV&#038;V market grew out of this need &#8212; it&#8217;s simply good business. The goal is shipping secure code, not making a feel-good proclamation that your team can handle a modern development challenge with no outside help.  While Oracle can be proud that they have tamed a source code tool and lived to tell the tale, other companies are securing their code faster and cheaper with the help of outsourcing.  Even Veracode customers haven&#8217;t <em>fully outsourced</em> security; many of them have in-house security expertise and are just employing a service to make their security processes more robust.  They are still full participants in the process, making decisions around how/when to remediate, how much to invest, etc. Veracode acts as an application security partner, providing customers valuable intelligence gleaned from the software ecosystem. Just as Google gets smarter with every search that it does, Veracode gets smarter with every scan we do.</p>
<p>At least we can rest easy knowing that Oracle would never <a href="http://www.opensecrets.org/lobby/indusclient.php?id=B12&#038;year=2011">hire lobbyists</a> to <a href="http://www.itnews.com.au/News/268523,cable-us-pressured-eu-to-approve-oracle-sun-merger.aspx">promote an agenda</a>. That’s a relief!</p>
<h5>Veracode Security Solutions</h5>
<div style="margin-left:15px;">
<a href="http://www.veracode.com/security/dynamic-analysis">Dynamic Analysis</a><br />
<a href="http://www.veracode.com/security/internet-security">Internet Security</a><br />
<a href="http://www.veracode.com/security/malicious-code">Malicious Code</a><br />
<a href="http://www.veracode.com/security/vulnerability-assessment-software">Vulnerability Assessment</a><br />
<a href="http://www.veracode.com/security/web-security">Website Security</a><br />
<a href="http://www.veracode.com/security/application-testing-tool">Application Analysis</a></div>
<p></p>
<h5>Security Alternatives</h5>
<div style="margin-left:15px;">
<a href="http://www.veracode.com/security/hp-fortify-alternative">HP Fortify</a><br />
<a href="http://www.veracode.com/security/whitehat-security-alternative">Whitehat Security</a><br />
<a href="http://www.veracode.com/security/rational-appscan-alternative">IBM Rational AppScan</a>
</div>
<p></p>
<h5>Security Threat Guides</h5>
<div style="margin-left:15px;">
<a href="http://www.veracode.com/security/sql-injection">SQL Injection</a><br />
<a href="http://www.veracode.com/security/xss">XSS</a><br />
<a href="http://www.veracode.com/security/csrf">CSRF</a><br />
<a href="http://www.veracode.com/security/ldap-injection">LDAP Security</a><br />
<a href="http://www.veracode.com/security/mobile-code-security">Mobile Security</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.veracode.com/blog/2011/08/musings-on-custers-last-stand/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>&#8220;We Don&#8217;t Sell It? Then It&#8217;s Not Important&#8221;</title>
		<link>http://www.veracode.com/blog/2011/07/we-dont-sell-it-then-its-not-important/</link>
		<comments>http://www.veracode.com/blog/2011/07/we-dont-sell-it-then-its-not-important/#comments</comments>
		<pubDate>Wed, 06 Jul 2011 14:00:16 +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]]></category>

		<guid isPermaLink="false">http://www.veracode.com/blog/?p=1820</guid>
		<description><![CDATA[[UPDATE: Since there seems to be some confusion, the "We" in the title of this post is NOT "Veracode". The expression is a generic one intended to illustrate the attitude exhibited by many companies who like to downplay the value and/or effectiveness of technologies that they themselves do not sell. I can't believe I am [...]]]></description>
			<content:encoded><![CDATA[<p><em>[UPDATE: Since there seems to be some confusion, the "We" in the title of this post is NOT "Veracode".  The expression is a generic one intended to illustrate the attitude exhibited by many companies who like to downplay the value and/or effectiveness of technologies that they themselves do not sell.  I can't believe I am having to explain this.]</em></p>
<p>Fair warning, this is a bit of a rant.</p>
<p>Back in my consulting days (early 2000, I&#8217;m getting old), we delighted in the fact that our web application penetration testing methodology didn&#8217;t rely on automated tools.  This was completely true; we did everything manually, and we were among the best in the industry.  Many so-called security consultants of the day would run a commercial web scanner and repackage the results as a high dollar &#8220;penetration test&#8221; &#8212; what a ripoff!  </p>
<p>What we didn&#8217;t acknowledge to our customers is that those web scanners, even in their immature state, were probably capable of detecting some of the low hanging fruit that we didn&#8217;t want to spend our time looking for.  Oh, we&#8217;d find a few &#8220;representative examples&#8221; of XSS and SQL injection, but then we&#8217;d get bored and move on to the more interesting and complex attack vectors.  In our naivete, we figured developers would be inspired to revisit their entire input validation and/or output encoding practices, as opposed to just fixing the proof-of-concept examples we found.</p>
<p>Meanwhile, the commercial web scanner vendors were always downplaying the value of manual testing!  &#8220;Why would you want to pay for an expensive penetration test when you can just run this less expensive tool and find the same vulnerabilities?&#8221;  They&#8217;d gloss over all the <a href="http://lcamtuf.blogspot.com/2010/08/commercial-scanners-and-word-suck.html">technical challenges</a> of automated web scanning and conveniently forget to mention how it was impossible for them to find authorization issues, cryptographic weaknesses, business logic flaws, and so on. </p>
<p><b>What&#8217;s my point?</b></p>
<p>Using multiple testing methodologies is crucial.  Sure, there may be some overlap, but ultimately they are complementary to one another.  That&#8217;s why at Veracode, we&#8217;ve never positioned automated static analysis (SAST) as a complete solution.  That&#8217;s why we integrated both automated web scanning (DAST) and manual penetration testing into our service offerings less than a year after launching the company, even though SAST is our patented bread-and-butter technology.  This meant we could always be completely honest about the strengths and weaknesses of each technique.  I&#8217;ve had a slide titled &#8220;There Is No Silver Bullet&#8221; in my corporate slide deck since the very beginning.</p>
<p><b>Our silver bullet is better than yours</b></p>
<p>Meanwhile, it&#8217;s been amusing to watch other companies &#8212; who only had a single offering &#8212; having to espouse the tactic of downplaying any testing approach that wasn&#8217;t in their service portfolio.</p>
<ul>
<li>Over at Fortify, Brian Chess famously predicted that 2009 would mark <a href="http://www.csoonline.com/article/468766/pen-testing-dead-in-2009<br />
">the end of penetration testing</a>.</li>
<li>Over at WhiteHat, Jeremiah Grossman often downplays <a href="http://jeremiahgrossman.blogspot.com/2009/05/mythbusting-secure-code-is-less.html">the value</a> of writing <a href="http://jeremiahgrossman.blogspot.com/2008/05/does-secure-software-really-matter.html">secure code</a> and testing code quality.</li>
<li>Even as recently as last week, we have Errata Security (a consultancy) claiming that automated tools are <a href="http://erratasec.blogspot.com/2011/06/take-bow-everybody-security-industry.html">useless and doomed to fail</a>. Welcome back to 1999.</li>
<div style="float:right; margin-left:20px"><a href="http://www.veracode.com/blog/wp-content/uploads/2011/07/8090509_m.jpg"><img src="http://www.veracode.com/blog/wp-content/uploads/2011/07/8090509_m-233x300.jpg" alt="" title="8090509_m" width="200" class="aligncenter size-medium wp-image-1845" /></a></div>
</ul>
<p>I&#8217;m only picking on these guys because they&#8217;re visible, well-respected practitioners in the application security space.  Of course Brian knows source code scanning is an incomplete solution, and now that Fortify and WebInspect are part of the same parent company, I suspect he&#8217;s adjusted his message.  I&#8217;m certain Jeremiah knows there&#8217;s value in writing secure code during the SDLC, which is why WhiteHat is now trying to <a href="https://blog.whitehatsec.com/whitehat-acquires-infrared-static-analysis-here-we-come/">get into the SAST market</a> by acquiring some technology.  </p>
<p>And I&#8217;m pretty sure Dave Maynor knows automation does provide real value.  How else can a big company &#8212; spooked by all the recent breaches &#8212; quickly hunt for SQL injection vulnerabilities across 5,000 websites without the benefit of automation?  How does one look for issues in the 150 third-party libraries you use, where only the binary is available?  Do you hire <a href="http://www.azimuthsecurity.com/">Mark Dowd</a> to spend a month looking at each one?</p>
<p><b>Building trust</b></p>
<p>We all know a few sales reps that jump from one company to another, changing their pitch as they go no matter how much it conflicts with things they&#8217;ve said in the past.  First a service-based approach is best, but suddenly an on-premise tool is better.  Source code scanning used to be pointless, but now it&#8217;s the best thing since sliced bread!  It&#8217;s no surprise these guys don&#8217;t experience more success &#8212; they lack credibility.  The most successful account reps I&#8217;ve seen are the ones who build trust with their customers over time by being honest about what they are selling, even when hopping from one company to the next.</p>
<p>Look, it&#8217;s no big secret why people talk up their own stuff and imply everything else stinks.  It&#8217;s part of the sales and marketing machine and by no means is it unique to the security industry.  Even so, can&#8217;t we make an effort &#8212; as practitioners &#8212; to cut back on the rhetoric <em>a little bit</em> and be more honest with our customers?  Customers look to us as experts to help them build their security programs, and what do we do?  We oversell them on an approach that has huge gaps we pretend don&#8217;t exist.  If you&#8217;re really looking out for your customers, start being more honest, and stop handing out kool-aid.</p>
<p>Here&#8217;s another approach: Instead of outright dismissing an effective technology or methodology just because you don’t sell it, sometimes it&#8217;s worth thinking about partnering, or even building something better. That&#8217;s why at Veracode we designed our service platform around the idea of technology integration. There is no silver bullet and there never will be.</p>
<h5>Veracode Security Solutions</h5>
<div style="margin-left:15px;">
<a href="http://www.veracode.com/security/vulnerability-assessment-software">Vulnerability Assessment</a><br />
<a href="http://www.veracode.com/security/web-security">Website Security</a><br />
<a href="http://www.veracode.com/security/application-testing-tool">Application Analysis</a><br />
<a href="http://www.veracode.com/security/dynamic-analysis">Dynamic Analysis</a><br />
<a href="http://www.veracode.com/security/internet-security">Internet Security</a><br />
<a href="http://www.veracode.com/security/malicious-code">Malicious Code</a></div>
<p></p>
<h5>Security Alternatives</h5>
<div style="margin-left:15px;">
<a href="http://www.veracode.com/security/hp-fortify-alternative">HP Fortify</a><br />
<a href="http://www.veracode.com/security/whitehat-security-alternative">Whitehat Security</a><br />
<a href="http://www.veracode.com/security/rational-appscan-alternative">IBM Rational AppScan</a></div>
<p></p>
<h5>Security Threat Guides</h5>
<div style="margin-left:15px;">
<a href="http://www.veracode.com/security/csrf">CSRF</a><br />
<a href="http://www.veracode.com/security/ldap-injection">LDAP Security</a><br />
<a href="http://www.veracode.com/security/mobile-code-security">Mobile Security</a><br />
<a href="http://www.veracode.com/security/sql-injection">SQL Injection</a><br />
<a href="http://www.veracode.com/security/xss">What is Cross Site Scripting?</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.veracode.com/blog/2011/07/we-dont-sell-it-then-its-not-important/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Whitepaper: A Dose of Reality on Automated Static-Dynamic Hybrid Analysis</title>
		<link>http://www.veracode.com/blog/2010/12/whitepaper-a-dose-of-reality-on-automated-static-dynamic-hybrid-analysis/</link>
		<comments>http://www.veracode.com/blog/2010/12/whitepaper-a-dose-of-reality-on-automated-static-dynamic-hybrid-analysis/#comments</comments>
		<pubDate>Tue, 07 Dec 2010 18:48:35 +0000</pubDate>
		<dc:creator>Chris Eng</dc:creator>
				<category><![CDATA[Application Security]]></category>
		<category><![CDATA[Dynamic Analysis]]></category>
		<category><![CDATA[RESEARCH]]></category>
		<category><![CDATA[SDLC]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.veracode.com/blog/?p=1342</guid>
		<description><![CDATA[As application inventories have become larger, more diverse, and increasingly complex, organizations have struggled to build application security testing programs that are effective and scalable. New technologies and methodologies promise to help streamline the Secure Development Lifecycle (SDLC), making processes more efficient and easing the burden of information overload. In the realm of automated web [...]]]></description>
			<content:encoded><![CDATA[<p>As application inventories have become larger, more diverse, and increasingly complex, organizations have struggled to build application security testing programs that are effective and scalable.  New technologies and methodologies promise to help streamline the Secure Development Lifecycle (SDLC), making processes more efficient and easing the burden of information overload. </p>
<p>In the realm of automated web application testing, today’s technologies fall into one of two categories, Static Application Security Testing (SAST) and Dynamic Application Security Testing (DAST).  SAST analyzes application binaries or source code, detecting vulnerabilities by identifying insecure code paths without actually executing the program.  In contrast, DAST detects vulnerabilities by conducting attacks against a running instance of the application, simulating the behavior of a live attacker.  Most enterprises have incorporated at least one SAST or DAST technology; those with mature SDLCs may even use more than one of each.</p>
<p>In the past year or so, industry analysts and product vendors have become enamored with so-called “hybrid analysis” technologies.  Hybrid techniques aim to correlate the results of SAST and DAST to dramatically expand dynamic coverage, prioritize the combined set of results, and reduce both false positives and false negatives.  This whitepaper will examine each of these claims to give consumers technical insight into whether hybrid technologies can realistically live up to the hype.  </p>
<p>Several observations will be described in the following sections:</p>
<ul>
<li>Hybrid analysis may expand dynamic coverage, but the lack of application context limits its effectiveness.
<li>The challenge of reliably generating URL-to-source mappings, coupled with the existence of URL rewriting, undermines the accuracy and usefulness of vulnerability correlation.
<li>Hybrid analysis does not reduce false positive rates; rather, it lulls users into a false sense of security by suggesting that non-correlated vulnerabilities are false positives.
<li>Correlation should not be equated with exploitability.  Vulnerabilities should be prioritized based on severity and business impact, not based on how many scanners are capable of detecting it.
</ul>
<p>Download the <a href="http://www.veracode.com/blog/wp-content/uploads/2010/12/A-Dose-of-Reality-on-Hybrid-Analysis.pdf">full whitepaper</a>.</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/2010/12/whitepaper-a-dose-of-reality-on-automated-static-dynamic-hybrid-analysis/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Squashing Ants: The Dynamics of XSS Remediation</title>
		<link>http://www.veracode.com/blog/2010/09/squashing-ants-the-dynamics-of-xss-remediation/</link>
		<comments>http://www.veracode.com/blog/2010/09/squashing-ants-the-dynamics-of-xss-remediation/#comments</comments>
		<pubDate>Mon, 27 Sep 2010 15:30:31 +0000</pubDate>
		<dc:creator>Chris Eng</dc:creator>
				<category><![CDATA[Application Security]]></category>
		<category><![CDATA[Application Security Metrics]]></category>
		<category><![CDATA[QA]]></category>
		<category><![CDATA[RESEARCH]]></category>
		<category><![CDATA[SDLC]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://www.veracode.com/blog/?p=1285</guid>
		<description><![CDATA[Is anyone else getting tired of hearing excuses from customers &#8212; and worse yet, the security community itself &#8212; about how hard it is to fix cross-site scripting (XSS) vulnerabilities? Oh, come on. Fixing XSS is like squashing ants, but some would have you believe it&#8217;s more like slaying dragons. I haven&#8217;t felt inspired to [...]]]></description>
			<content:encoded><![CDATA[<p>Is anyone else getting tired of hearing excuses from customers &#8212; and worse yet, the security community itself &#8212; about how <em>hard</em> it is to fix cross-site scripting (XSS) vulnerabilities?  Oh, come on.  Fixing XSS is like squashing ants, but some would have you believe it&#8217;s more like slaying dragons.  I haven&#8217;t felt inspired to write a blog post in a while, but every once in a while, 140 characters just isn&#8217;t enough.  Grab your cup of coffee, because I may get a little rambly.</p>
<p><strong>Easy to Fix vs. Easy to Eradicate</strong></p>
<p>Let&#8217;s start with some terminology to make sure we&#8217;re all on the same page.  Sometimes people will say XSS is &#8220;not easy to fix&#8221; but what they really mean is that it&#8217;s &#8220;not easy to eradicate.&#8221;  Big difference, right?  Not many vulnerability classes are easy to eradicate.  Take buffer overflows as an example.  Buffer overflows were first documented in the early 1970s and began to be exploited heavily in the 1990s.  We understand exactly how and why they occur, yet they are far from extinct.  Working to eradicate an entire vulnerability class is a noble endeavor, but it&#8217;s not remotely pragmatic for businesses to wait around for it to happen.  We can bite off chunks through OS, API, and framework protections, but XSS or any other vulnerability class isn&#8217;t going to disappear completely any time soon.  So in the meantime, let&#8217;s focus on the &#8220;easy to fix&#8221; angle because that&#8217;s the problem developers and businesses are struggling with today.</p>
<p>It&#8217;s my belief that most XSS vulnerabilities can be fixed easily.  Granted, it&#8217;s not as trivial as wrapping a single encoding mechanism around any user-supplied input used to construct web content, but once you learn how to apply <a href="http://www.owasp.org/index.php/XSS_%28Cross_Site_Scripting%29_Prevention_Cheat_Sheet">contextual encoding</a>, it&#8217;s really not that bad, provided you grok the functionality of your own web application.  An alarming chunk of reflected XSS vulnerabilities are trivial, reading the value of a GET/POST parameter and writing it directly to an HTML page.  Plenty of others are only marginally more complicated, such as retrieving a user-influenced value from the database and writing it into an HTML attribute.  I contend both of these examples are easy for a developer to fix; tell me if you disagree.  Basic XSS vulnerabilities like these are still very prevalent.</p>
<p>Of course, there are edge cases.  Take <a href="http://erlend.oftedal.no/blog/?blogid=91">this freakish example</a>, which combines browser-specific parsing behavior with the ill-advised use of tainted input in Javascript code.  Exceptions will always exist, but that doesn&#8217;t change the fact that <strong>most</strong> XSS flaws are straightforward to fix.  We can take a huge bite out of the problem by eliminating these basic reflected cases, just like we started attacking buffer overflows by discouraging the use of unbounded string manipulation functions.  Some will claim &#8220;developers shouldn&#8217;t be responsible for writing secure code,&#8221; which is noble and idealistic but also completely impractical in this day and age.  Maybe it&#8217;ll happen eventually, but in the meantime there are fires to put out.  So let&#8217;s step down from those ivory towers and impose some accountability.</p>
<p><strong>Ease of Fix vs. Willingness to Fix</strong></p>
<p>I&#8217;ve heard the assertion that XSS vulnerabilities aren&#8217;t getting fixed because they are difficult to fix.  Asking &#8220;what percentage of XSS vulnerabilities actually get fixed and deployed to production?&#8221; is a valuable metric for the business, but it doesn&#8217;t reflect the actual difficulty of fixing an XSS vulnerability.  It conflates the technical complexity with other <strike>excuses</strike>reasons <a href="http://jeremiahgrossman.blogspot.com/2009/05/8-reasons-why-website-vulnerabilities.html">why website vulnerabilities are not fixed</a>.  </p>
<p>At Veracode, we collected data in our <a href="http://www.veracode.com/images/pdf/soss/veracode-state-of-software-security-report-volume2.pdf">State of Software Security Vol. 2</a> report that reveals developers <em>are</em> capable of fixing security issues quickly.  While our data isn&#8217;t granular enough to state exactly how long it took to fix a particular flaw, we do know that in cases where developers did choose to remediate flaws and rescan, they reached an &#8220;acceptable&#8221; level of security in an average of 16 days.  This isn&#8217;t to say that every XSS was eliminated, but it suggests that most were (more details on our scoring methodology can be found in the appendix of the report).  </p>
<p>WhiteHat&#8217;s <a href="http://www.whitehatsec.com/home/assets/WPstats_fall10_10th.pdf">Fall 2010 study</a> shows that nearly half of XSS vulnerabilities are fixed, and that doing so takes their customers an average of 67 days.  These numbers differ from ours &#8212; particularly with regard to the number of days &#8212; but I think that can be attributed to prioritization.  Perhaps fixing the XSS vulnerability didn&#8217;t rise to the top of the queue until day 66.  Again, that&#8217;s more an indication that the business isn&#8217;t taking XSS seriously than it is of the technical sophistication required to fix.</p>
<p>At Veracode, we see thousands &#8212; sometimes tens of thousands &#8212; of XSS vulnerabilities a week.  Many are of the previously described trivial variety that can be fixed with a single line of code.  Some of our customers upload a new build the following day; others never do.  Motivation is clearly a factor.  Think about the XSS vulnerabilities that hit highly visible websites such as Facebook, Twitter, MySpace, and others.  Sometimes those companies push XSS fixes to production in a matter of hours!  Are their developers really that much better?  Of course not.  The difference is how seriously the business takes it.  When they believe it&#8217;s important, you can bet it gets fixed.</p>
<p><strong>Manufactured Contempt</strong></p>
<p>There&#8217;s a growing faction that believes <a href="http://diniscruz.blogspot.com/2010/09/why-do-we-think-we-can-comment-on-level.html">security practitioners are not qualified to comment</a> on the difficulty of security fixes (XSS or otherwise) because we&#8217;re not the ones writing the code.  The ironic thing is that this position is most loudly voiced by people in the infosec community!  It&#8217;s like they are trying to be the &#8220;white knights&#8221;, coddling the poor, fragile developers so their feelings aren&#8217;t hurt.  Who are we to speak for them?  I find the entire mindset misguided at best, disingenous and contemptuous at worst.  To be fair, Dinis isn&#8217;t the only one who has expressed this view, he&#8217;s just the straw that broke the camel&#8217;s back, so to speak.  You know who you are.</p>
<p>Look, the vast majority of security professionals aren&#8217;t developers and never have been (notable exceptions include Christien Rioux, HD Moore, Halvar Flake, etc.).  Trust me, we know it. I&#8217;ve written lots of code that I&#8217;d be horrified for any real developer to see.  My stuff may be secure, but I&#8217;d hate to be the guy who has to maintain, extend, or even understand it.  Here&#8217;s the thing &#8212; even though I can guarantee you I&#8217;d be terrible as a developer, most XSS flaws are so simple that even a security practioner like me could fix them!  Here&#8217;s another way of looking at it: developers solve problems <em>on a daily basis</em> that are <strong>much</strong> more complex than patching an XSS vulnerability.  Implying that fixing XSS is &#8220;too hard&#8221; for them is insulting!  </p>
<p>That being said, who says we&#8217;re not qualified to comment on a code-level vulnerability if we&#8217;re not the one writing the fix?  In fact, who&#8217;s to say that the security professional isn&#8217;t <strong>more</strong> qualified to assess the difficulty in some situations?  Specifically, if a developer doesn&#8217;t understand the root cause, how can he possibly estimate the effort to fix?  I&#8217;ve been on readouts where developers claim initially that several hundred XSS flaws will take a day each to fix, but then once they understand how simple it is they realize they can knock them all out in a week.  Communication and education go a long way.  Sure, sometimes there are complicating factors involved that affect remediation time, but I can&#8217;t recall a time where a developer has told me my estimate was downright unreasonable.  </p>
<p>Bottom line: By and large, I don&#8217;t think developers feel miffed or resentful when we try to estimate the effort to fix a vulnerability. They know that what we say isn&#8217;t the final word, it&#8217;s simply one input into a more complex equation.  Yes, developers do get annoyed when it seems like the security group is creating extra work for them, but that&#8217;s a different discussion altogether.</p>
<p><strong>Ceteris Paribus</strong></p>
<p>One final pet peeve of mine is the rationalization that security vulnerabilities take longer to fix because you have to identify the root cause, account for side effects, test the fix, and roll it into a either a release or a patch.  As opposed to other software bugs where fixes are accomplished by handwaving and magic incantations?  Of course not; these steps are common to just about <em>any software bug</em>.  In fact, I&#8217;d argue that identifying the root cause of a security vulnerability is much easier than hunting down an unpredictable crash, a race condition, or any other non-trivial bug.  Come to think of it, testing the fix may be easier too, at least compared to a bug that&#8217;s intermittent or hard to reproduce.  As for side effects and other QA testing, this is why we have regression suites!  If you build software and you don&#8217;t have the capability to run an automated regression suite after fixing a bug, then let&#8217;s face it, you&#8217;ve got bigger problems than wringing out a few XSS vulnerabilities.</p>
<p>My high school economics teacher used the term &#8220;ceteris paribus&#8221; at least once per lecture.  Loosely translated from Latin, it means &#8220;all other things being equal&#8221; and it&#8217;s often used in economics and philosophy to enable one to describe outcomes without having to account for other complicating factors.  The ceteris paribus concept doesn&#8217;t apply perfectly to this situation, but it&#8217;s close enough for a blog post, to wit: ceteris paribus, fixing a security-related bug is no more difficult than fixing <em>any other critical software bug</em>.  Rattling off all the steps involved in deploying a fix is just an attempt at misdirection.</p>
<p><strong>Closing Thoughts</strong></p>
<p>My hope in writing this post is to spur some debate around some of the reasons, excuses, and rationalizations that often accompany the surprisingly-divisive topic of XSS.  I want to hear from both security practitioners and developers on where you think I&#8217;ve hit or missed the mark. We don&#8217;t censor comments here, but there is a moderation queue, so bear with us if your comment takes a few hours to show up.</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/2010/09/squashing-ants-the-dynamics-of-xss-remediation/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>HTML5 Security in a Nutshell</title>
		<link>http://www.veracode.com/blog/2010/05/html5-security-in-a-nutshell/</link>
		<comments>http://www.veracode.com/blog/2010/05/html5-security-in-a-nutshell/#comments</comments>
		<pubDate>Mon, 17 May 2010 21:33:59 +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>

		<guid isPermaLink="false">http://www.veracode.com/blog/?p=1229</guid>
		<description><![CDATA[Lots of people have been asking us for opinions on HTML5 security lately. Chris and I discussed the potential attack vectors with the Veracode research team, most notably Brandon Creighton and Isaac Dawson. Here&#8217;s some of what we came up with. Keep in mind that the HTML5 spec and implementations are still evolving, particularly with [...]]]></description>
			<content:encoded><![CDATA[<p>Lots of people have been asking us for opinions on HTML5 security lately.  Chris and I discussed the potential attack vectors with the Veracode research team, most notably Brandon Creighton and Isaac Dawson.  Here&#8217;s some of what we came up with.  Keep in mind that the HTML5 spec and implementations are still evolving, particularly with respect to security concerns, so we shouldn’t assume any of this is set in stone.</p>
<p><strong>Don&#8217;t Forget Origin Checks on Cross-Document Messaging</strong></p>
<p>Applications that use <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages">cross-document messaging</a> could be unsafe if origin checking is done incorrectly (or not at all) in the message receivers.  It&#8217;s important that developers writing apps that rely on postMessage() carefully check to ensure that messages originate from their own sites, otherwise malicious code from other sites could spoof rogue messages.  The functionality itself isn&#8217;t inherently insecure, though; developers have used various DOM/browser capabilities to emulate cross-domain messaging for some time now. The window.name attribute has been abused, as has Javascript-driven injection of HTML and URL rewriting.  There&#8217;s even a cross-platform JavaScript library called <a href=" http://easyxdm.net/wp/">easyXDM</a> that provides a friendly interface to these hacks.</p>
<p>One bright spot with regard to cross-document messaging is that older apps won’t be threatened by these issues, only new apps that are intentionally written to rely on the feature.</p>
<p><strong>Local Storage Isn&#8217;t as Problematic as You Think</strong></p>
<p><a href="http://dev.w3.org/html5/webstorage/">Local storage</a> doesn’t appear to present major security risks, despite a lot of FUD circulating on the topic.  Besides cookies, there have always been numerous ways for web apps to store data client-side through the use of plugins (Java, JWS, Flash, Silverlight, Google Gears, etc.) or browser extensions &#8212; WebKit/Safari/Chrome have supported local storage before it was even part of HTML5.  </p>
<p>Developers should also be aware that as currently implemented, the HTML5 sessionStorage attribute can be <a href="http://www.sourceconference.com/bos10pubs/DanK.pptx">vulnerable to manipulation from foreign sites</a> under certain circumstances.  A remote site can get a handle to a window containing a site for which a browser has data in sessionStorage.  Then, the remote site can navigate to arbitrary URLs in that window, while the window will still contain its<br />
sessionStorage.  Hopefully this implementation bug will be fixed by the time the standard is final.</p>
<p><strong>New Tags Increase Attack Surface</strong></p>
<p>HTML5 will also support new data formats and tags such as the &lt;canvas&gt; and &lt;video&gt; tags.  In-browser support for video means browser developers now have to parse historically bug-ridden file formats. This increases the attack surface of HTML5 browsers but otherwise doesn’t affect the typical web app developer.  The &lt;canvas&gt; tag is a complex set of functionality mixing Javascript and imaging-related functions, and image parsers have historically been rife with vulnerabilities.</p>
<p><strong>Developers Should Be Wary of Cross-Origin Javascript Requests</strong></p>
<p>Another new feature set that’s not directly part of HTML5, but has recently been introduced, is limited support for cross-origin Javascript requests.  Historically, it&#8217;s been forbidden for Javascript code to request pages from any host other than the page that served the script itself; this is part of the same-origin policy.  However, the W3C’s current draft for Cross-Origin Resource Sharing provides a way to circumvent the same-origin policy using a mechanism similar to the crossdomain.xml file in Flash (i.e. the server decides which domains are allowed to access its resources). </p>
<p>Firefox, Safari, and Chrome currently allow cross-domain requests to be sent using XMLHttpRequest. Before the entire request is allowed to proceed, the browser sends a probe request using the OPTIONS method (instead of, for example, GET or POST) first.  If the server responds to this probe with an &#8220;Access-Control-Allow-Origin&#8221; header that gives the source host permission to make the request, the browser will then resend the full request with the requested HTTP method.  This is consistent with the current working draft for <a href="http://dev.w3.org/2006/waf/access-control/">W3C Cross-Origin Resource Sharing</a>.</p>
<p>However, IE works differently.  Instead of relaxing permissions on XMLHttpRequest, it uses a new object type called XDomainRequest.  Also, instead of sending a probe that replaces the normal HTTP method with OPTIONS, its probe includes the original HTTP method as well as the request body (in the other browsers, the request body is omitted).</p>
<p>The cross-domain-request features are actually fairly troublesome, from a security point of view.  Malicious code on any site can cause probe requests to be sent to any other site, in every major browser, today.  Developers need to be aware of both probe types and ensure that their applications won&#8217;t be fooled by probes.  Fortunately, cookies aren&#8217;t passed in any browser&#8217;s probe request.  Adding to the confusion, some of the official documentation on the topic contains reference code that is blatantly insecure.  For example, in an <a href="http://msdn.microsoft.com/en-us/library/cc288060%28VS.85%29.aspx">MSDN page on XDomainRequest</a>, ASP code is provided for setting the &#8220;Access-Control-Allow-Origin&#8221; header field to &#8220;*&#8221;.  This would allow any remote site to make unauthenticated requests against that page from JavaScript, which is not advisable for most applications.  Developers need to be sure they understand the dangers of creating an overly permissive access control list.</p>
<p><strong>Sandbox Attribute Could Make Security Easier</strong></p>
<p>One thing that may help, depending on how the standard is eventually defined and implemented, is the support for a <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-iframe-element.html">sandbox attribute on IFRAMEs</a>. This attribute will allow a developer to chose how data should be interpreted. Unfortunately, this design, like much of HTML, has a pretty high chance of being misunderstood by developers and may easily be disabled for the sake of convenience.  If done properly, it could help protect against malicious third-party ads or anywhere else that accepts untrusted content to be redisplayed.</p>
<p><strong>Always Remember Input Validation</strong></p>
<p>The most important thing that developers can do is to remember basic security tenets, for example, the idea that all user input should be considered untrusted.  They should learn how the new HTML5 features actually work in order to understand where they’d be tempted to make erroneous assumptions.</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/2010/05/html5-security-in-a-nutshell/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<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]]></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>How To Protect Your Users From Password Theft</title>
		<link>http://www.veracode.com/blog/2009/01/how-to-protect-your-users-from-password-theft/</link>
		<comments>http://www.veracode.com/blog/2009/01/how-to-protect-your-users-from-password-theft/#comments</comments>
		<pubDate>Mon, 26 Jan 2009 20:49:44 +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[Vulnerabilities]]></category>

		<guid isPermaLink="false">http://www.veracode.com/blog/?p=650</guid>
		<description><![CDATA[Monster.com recently disclosed yet another major breach that compromised the personal data of over 1.3 million users. This is not unlike the previous breach in August 2007, though the attack vector was likely different. From a notice on their website (emphasis mine): We recently learned our database was illegally accessed and certain contact and account [...]]]></description>
			<content:encoded><![CDATA[<p>Monster.com recently disclosed <a href="http://www.theregister.co.uk/2009/01/24/latest_monster_security_breach/">yet another major breach</a> that compromised the personal data of over 1.3 million users.  This is not unlike the <a href="http://www.crn.com/security/201802313">previous breach</a> in August 2007, though the attack vector was likely different.  From <a href="http://help.monster.com/besafe/jobseeker/index.asp">a notice on their website</a> (emphasis mine):</p>
<blockquote><p>We recently learned our database was illegally accessed and certain contact and account data were taken, including Monster user IDs <strong>and passwords</strong>, email addresses, names, phone numbers, and some basic demographic data. The information accessed does not include resumes.</p></blockquote>
<p>Considering the well-known tendency to use the same password on multiple websites, compounded with the fact that Monster <a href="http://pr.monsterworldwide.com/phoenix.zhtml?c=131001&#038;p=irol-newsArticle&#038;ID=1046234&#038;highlight=">pledged a comprehensive security review</a> after the first breach, it&#8217;s just embarrassing that they are still storing passwords in the clear.  </p>
<p>So let&#8217;s talk about how to properly store passwords for a web application. </p>
<p><strong>Use a one-way cryptographic hash</strong></p>
<p>Don&#8217;t store your passwords in the clear!  If you do, an attacker just needs to find one SQL Injection vulnerability and he&#8217;s got the password for every one of your users.  The idea behind using a one-way algorithm is that the hash value can&#8217;t be reversed to &#8220;decrypt&#8221; the password.  So how does authentication work?  When a user attempts to login, you apply the same one-way algorithm to convert the user-provided password into the hash value, and then compare the two hashes.  If they match, then the user-provided password was correct.  At no time is the password ever stored in the clear.</p>
<p>Often, developers will hear the advice &#8220;use a hash&#8221; and interpret that as &#8220;run the plaintext password through MD5 or SHA-1 and store the result.&#8221;  But that only solves part of the problem &#8212; the part about using an irreversible algorithm.  It doesn&#8217;t protect against pre-computation.  Let&#8217;s say you&#8217;ve used SHA-1 to hash your passwords, and your USERS table looks like this in the database:</p>
<pre>
USER          PASSWORD_HASH
admin         5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8
bob           fbb73ec5afd91d5b503ca11756e33d21a9045d9d
jim           7c6a61c68ef8b9b6b061b28c348bc1ed7921cb53
</pre>
<p>So if you wanted to obtain the original passwords you&#8217;d have to run a dictionary or brute force attack, hashing all possible password options with SHA-1 and comparing the output to the stored hashes.  This would take a long time but eventually you&#8217;d figure some of them out.  But what if you already had a list of all 8-character permutations and their corresponding SHA-1 hashes?  Now all you have to do is <em>look up</em> the hashes, rather than computing them on-the-fly.  This is the idea behind <a href="http://en.wikipedia.org/wiki/Rainbow_table">rainbow tables</a>.  </p>
<p>An attacker with a SHA-1 rainbow table covering 8-character alphanumeric combinations would quickly look up those three hashes and obtain the original passwords of &#8220;password&#8221;, &#8220;p4ssword&#8221;, and &#8220;passw0rd&#8221; respectively.</p>
<p><strong>Use a salt</strong></p>
<p>The best defense against pre-computation of raw hashes is <a href="http://en.wikipedia.org/wiki/Salt_(cryptography)">salting</a>.  To salt a password, you append or prepend a random string of bits to the plaintext password and hash the result.  You then store the salt value alongside the hash so that it can be used by the authentication routine.  Look in the /etc/shadow file of any modern Unix system and you&#8217;ll see something like this:</p>
<pre>
user1:$1$lKorlp4C$RD5TSM6PaZ6oaWRVUuXT40:13740:0:99999:7:::
user2:$1$qOmA0CUm$I6IdbZDTDl6B6m7s77VPe1:13650:0:99999:7:::
user3:$1$nIEInNo5$PSxcLtvGIJArL8r2AQl74.:13749:0:99999:7:::
</pre>
<p>Let&#8217;s look at the &#8220;user1&#8243; entry in the example above, paying attention to the second field which contains a bunch of alphanumeric characters separated by dollar signs. The first token, 1, is a version number,  The second token, lKorlp4C, is the salt.  The third token, RD5TSM6PaZ6oaWRVUuXT40, is the one-way hash that was calculated using lKorlp4C as the salt.</p>
<p>When the user attempts to login, the system passes the user-provided password along with the stored salt into the hash routine (in this case, md5crypt), and compares the result to the stored hash.</p>
<p>Each bit of salt used doubles the amount of storage and computation required for a pre-computed table.  For instance, if we used one bit of salt &#8212; either 0 or 1 &#8212; the rainbow table would have to account for two variations of every password.  Eight bits of salt require 2^8, or 256 variations of every password.  Use a sufficiently large salt and pre-computation becomes infeasible.  For example, the md5crypt utility uses 48 bits of salt (and for an extra layer of protection, it runs 1000 iterations of MD5 to slow down dictionary attacks).</p>
<p>There are a couple of common mistakes that people make with regard to salting.  First, don&#8217;t use the same salt every time.  If you do, you&#8217;re not really increasing the search space because the attacker only has to account for a single salt value.  Second, don&#8217;t worry about protecting the salt values, they&#8217;re not secrets.  The added security is derived not from the secrecy of the salt but rather by the amount it increases the resources required for pre-computation.</p>
<p>If you have OpenSSL installed you can play around with various salt mechanisms and see what the output looks like:</p>
<pre>
$ openssl passwd -h
Usage: passwd [options] [passwords]
where options are
-crypt             standard Unix password algorithm (default)
-1                 MD5-based password algorithm
-apr1              MD5-based password algorithm, Apache variant
-salt string       use provided salt
-in file           read passwords from file
-stdin             read passwords from stdin
-noverify          never verify when reading password from terminal
-quiet             no warnings
-table             format output as table
-reverse           switch table columns

$ openssl passwd -1 password
$1$LH1SwzJI$0ho4XuPVfGlbWIcNuGIap/
$ openssl passwd -1 password
$1$eAUtQOBh$GlvJwVsyb8In5KKkvnR0E0
$ openssl passwd -1 password
$1$PgaSiWTy$ElLh6uy83Y6T4Y70AGmV20
</pre>
<p>A quick Google search shows that there is a <a href="http://www.codingforums.com/showthread.php?t=155709">lot of confusion</a> about salting.</p>
<p><strong>But wait, now my password recovery feature won&#8217;t work</strong></p>
<p>What&#8217;s that? You say your application has one of those &#8220;Forgot My Password&#8221; features where a user can type in their username and their current password will be sent to the e-mail address on file?  Clearly, that requirement <em>depends</em> on passwords being stored either in the clear or using a  reversible mechanism such as symmetric encryption.  </p>
<p>The answer here is to redesign your password recovery feature.  Don&#8217;t let an unnecessary requirement force you into poor security practices.  If you must e-mail a password, generate a temporary password that&#8217;s only valid for a short time period, and require the user to login immediately and select a new password.  This obviates the need to retrieve the original, forgotten password.</p>
<p><strong>Why not just use symmetric encryption?</strong></p>
<p>Instead of storing passwords in the clear, you could encrypt them using a symmetric algorithm such as AES and have the application encrypt/decrypt as needed.  While this solves the plaintext storage problem, it creates a new problem: key management.  Where do you store the key?  How often does it change?  How many people have access to it?  What do you do if/when the key is compromised?  And so on.  The tradeoff really isn&#8217;t worth it for something that&#8217;s more elegantly solved with salted hashes.</p>
<p><strong>Layered defenses</strong></p>
<p>While you&#8217;re rethinking password storage, it might be a good time to consider other <a href="http://www.veracode.com/blog/2009/01/tallying-twitters-security-best-practice-violations/">common flubs</a> such as password complexity and brute-force protections.</p>
<p><strong>In conclusion</strong></p>
<ul>
<li>Storing passwords in the clear puts your users at unnecessary risk if (when) your application database is compromised</li>
<li>Use salted hashes instead of storing passwords in a recoverable format</li>
<li>Password recovery mechanisms can be implemented without needing to obtain the original password</li>
<li>As with any aspect of security architecture, use layered defenses</li>
</ul>
<p>Have fun refactoring!</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/01/how-to-protect-your-users-from-password-theft/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>How Boring Flaws Become Interesting</title>
		<link>http://www.veracode.com/blog/2009/01/how-boring-flaws-become-interesting/</link>
		<comments>http://www.veracode.com/blog/2009/01/how-boring-flaws-become-interesting/#comments</comments>
		<pubDate>Tue, 20 Jan 2009 07:38:03 +0000</pubDate>
		<dc:creator>Chris Eng</dc:creator>
				<category><![CDATA[Application Security]]></category>
		<category><![CDATA[RESEARCH]]></category>
		<category><![CDATA[SDLC]]></category>

		<guid isPermaLink="false">http://www.veracode.com/blog/?p=623</guid>
		<description><![CDATA[One of the great challenges for consumers of static analysis products, particularly desktop tools, is dealing with the large flaw counts. You have to wade through the findings to decide what to fix and when, which can be a daunting task. At Veracode, we continuously update our analysis engine to aggressively reduce false positives, thereby [...]]]></description>
			<content:encoded><![CDATA[<p>One of the great challenges for consumers of static analysis products, particularly desktop tools, is dealing with the large flaw counts.  You have to wade through the findings to decide what to fix and when, which can be a daunting task.  At Veracode, we continuously update our analysis engine to aggressively reduce false positives, thereby enabling our customers to more efficiently triage their results.  Even so, it&#8217;s not unusual for customers to ask for clarification on certain flaws as they prioritize fixes.</p>
<p>The other day, we ran into an example that ended up being much more interesting than it appeared.  The flaw category was <a href="http://cwe.mitre.org/data/definitions/377.html">Insecure Temporary Files</a>, and the question was &#8220;should I really care about this?&#8221;  The flaw we identified was in a Java application, and the offending line was something like this:</p>
<pre>
tmpFile = java.io.File.createTempFile(deploymentName, ".war");
</pre>
<p>I know what you&#8217;re thinking.  You think the rest of this post is about how createTempFile() uses java.util.Random instead of java.security.SecureRandom to generate filenames, and since Random is seeded with the system time, you can work backwards to figure out the seed and use it to predict all future temporary files.  That&#8217;s not it, so keep reading!</p>
<p>We couldn&#8217;t remember specifically what was so bad about createTempFile(), aside from using a non-cryptographic PRNG, so we checked the Java API for clues:</p>
<blockquote><p>
Creates a new empty file in the specified directory, using the given prefix and suffix strings to generate its name. &#8230; To create the new file, the prefix and the suffix may first be adjusted to fit the limitations of the underlying platform. If the prefix is too long then it will be truncated, but its first three characters will always be preserved. If the suffix is too long then it too will be truncated, but if it begins with a period character (&#8216;.&#8217;) then the period and the first three characters following it will always be preserved. Once these adjustments have been made the name of the new file will be generated by concatenating the prefix, five or more internally-generated characters, and the suffix.
</p></blockquote>
<p>This behavior was verified with a quick test program:</p>
<pre>
$ for i in `seq 1 10`; do java createTempFile; done
/tmp/prefix53363suffix
/tmp/prefix200suffix
/tmp/prefix53898suffix
/tmp/prefix26801suffix
/tmp/prefix13687suffix
/tmp/prefix2221suffix
/tmp/prefix28661suffix
/tmp/prefix61720suffix
/tmp/prefix23104suffix
/tmp/prefix29833suffix
</pre>
<p>OK, that looks about right.  It does what it says it does. One of my colleagues quickly raised the question, what happens if the generated filename already exists?  So he generated /tmp/prefix0suffix through /tmp/prefix65535suffix and ran the test program again.</p>
<pre>
$ for i in `seq 1 10`; do java createTempFile; done
/tmp/prefix65536suffix
/tmp/prefix65537suffix
/tmp/prefix65538suffix
/tmp/prefix65539suffix
/tmp/prefix65540suffix
/tmp/prefix65541suffix
/tmp/prefix65542suffix
/tmp/prefix65543suffix
/tmp/prefix65544suffix
/tmp/prefix65545suffix
</pre>
<p>Uh-oh, not good.  So not only does createTempFile() use a pretty small search space, but when it exhausts that space, it degrades to being 100% predictable?  <a href="http://www.kpdus.com/jad.html">Decompiling</a> the relevant portion of JRE 1.6.0_07, we can see exactly how the filenames are constructed:</p>
<pre>
private static File generateFile(String s, String s1, File file)
    throws IOException
{
    if(counter == -1)
        counter = (new Random()).nextInt() &#038; 0xffff;
    counter++;
    return new File(file, (new StringBuilder()).append(s).append(Integer.toString(counter)).append(s1).toString());
}

public static File createTempFile(String s, String s1, File file)
    throws IOException
{
    ...
    File file1;
    do
        file1 = generateFile(s, s2, file);
    while(!checkAndCreate(file1.getPath(), securitymanager));
    return file1;
}
</pre>
<p>What this tells us is that createTempFile() is actually worse than we thought.  Notice that counter is only ever assigned a random value once.  As soon as it has that first random value, it simply increments from that point forward.  The reason we didn&#8217;t get sequential output on our first test run was because we ran the test program 10 times, initializing counter each time.  Had we put the loop inside the program, it would have generated a sequential list (try it yourself if you don&#8217;t believe me).</p>
<p>As luck would have it, Sun actually <i>just</i> <a href="http://sunsolve.sun.com/search/document.do?assetkey=1-66-244986-1">fixed this problem</a> in their latest release, <a href="https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/ViewProductDetail-Start?ProductRef=jre-6u11-oth-JPR@CDS-CDS_Developer">Java 6 Update 11</a>. Amazing that it went so long without being discovered.  The updated function looks like this:</p>
<pre>
private static File generateFile(String s, String s1, File file)
    throws IOException
{
    long l = LazyInitialization.random.nextLong();
    if(l == 0x8000000000000000L)
        l = 0L;
    else
        l = Math.abs(l);
    return new File(file, (new StringBuilder()).append(s).append(Long.toString(l)).append(s1).toString());
}
</pre>
<p>If you&#8217;re wondering, the same bug is present in <a href="https://www14.software.ibm.com/webapp/iwm/web/reg/download.do?source=swg-sdk6&#038;S_PKG=intel_6sr2&#038;S_TACT=105AGX05&#038;S_CMP=JDK&#038;lang=en_US&#038;cp=UTF-8&#038;dlmethod=http">IBM Java 6 SR2</a>, but it&#8217;s been fixed in SR3.</p>
<p>Returning to the original question that led us down this rathole, we came to the conclusion that yes, these types of flaws ARE worth fixing.  Predictability and security rarely go hand in hand.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.veracode.com/blog/2009/01/how-boring-flaws-become-interesting/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Tallying Twitter&#8217;s Application Security Best Practice Violations</title>
		<link>http://www.veracode.com/blog/2009/01/tallying-twitters-security-best-practice-violations/</link>
		<comments>http://www.veracode.com/blog/2009/01/tallying-twitters-security-best-practice-violations/#comments</comments>
		<pubDate>Wed, 07 Jan 2009 06:24:31 +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[account lockout]]></category>
		<category><![CDATA[best practices]]></category>
		<category><![CDATA[password complexity]]></category>
		<category><![CDATA[social networking]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.veracode.com/blog/?p=562</guid>
		<description><![CDATA[If you were paying attention the last few days, you&#8217;ve probably read about the wave of attacks launched against the popular Twitter service. It started over the weekend, with a series of phishing attacks sent to unsuspecting Twittizens via Direct Message. Then, on Monday morning, Fox News announced Bill O&#8217;Riley (sic) was gay, CNN anchor [...]]]></description>
			<content:encoded><![CDATA[<p>If you were paying attention the last few days, you&#8217;ve probably read about the wave of attacks launched against the popular <a href="http://twitter.com">Twitter</a> service.  It started over the weekend, with a series of <a href="http://blogs.zdnet.com/security/?p=2349">phishing attacks</a> sent to unsuspecting Twittizens via Direct Message.  Then, on Monday morning, Fox News announced Bill O&#8217;Riley (sic) was gay, CNN anchor Rick Sanchez tweeted that he was high on crack, and the Barack Obama transition team decided to raise a few bucks using affiliate referral links to survey websites.  All told, <a href="http://bits.blogs.nytimes.com/2009/01/05/twitter-hit-by-hacker-phishers/?hp">33 celebrity accounts</a> were compromiwsed before Twitter caught on and took control of the hacked accounts.</p>
<p>Naturally, people wanted to know how it was done.  A <a href="http://blog.twitter.com/2009/01/monday-morning-madness.html">Twitter blog entry</a> provided some vague detail:</p>
<blockquote><p>The issue with these 33 accounts is different from the Phishing scam aimed at Twitter users this weekend. These accounts were compromised by an individual who hacked into some of the tools our support team uses to help people do things like edit the email address associated with their Twitter account when they can&#8217;t remember or get stuck.</p></blockquote>
<p>What&#8217;s interesting about that paragraph is that the celebrity account hacks were <i>not</i> related to the phishing attacks, as one might assume, and they had nothing to do with an exploitable vulnerability in the Twitter app itself.  Just a case of somebody getting hold of an admin account.  Ho-hum.</p>
<p>Tonight, the &#8220;hacker&#8221; <a href="http://blog.wired.com/27bstroke6/2009/01/professed-twitt.html">explained to Wired Magazine</a> how he did it.  I&#8217;ll try to summarize the attack, but you might have to read it several times because it&#8217;s subtle and complicated.  Ready?  Brace yourself&#8230; He used a <b>dictionary attack</b> to brute force a password.  </p>
<p>Continue reading here after you&#8217;ve picked yourself up off the floor.  Here&#8217;s the money quote:</p>
<blockquote><p>The hacker, who goes by the handle GMZ, told Threat Level on Tuesday he gained entry to Twitter&#8217;s administrative control panel by pointing an automated password-guesser at a popular user&#8217;s account. The user turned out to be a member of Twitter&#8217;s support staff, who&#8217;d chosen the weak password &#8220;happiness.&#8221;</p></blockquote>
<p>Now let&#8217;s consider the application security best practices that Twitter could have followed when designing their service, any of which would have foiled the attack.</p>
<ul>
<li><a href="http://www.owasp.org/index.php/Password_length_&#038;_complexity">Password complexity</a>. In case you were wondering, the only restriction on Twitter passwords is a minimum length of six characters.  No mixed case, no numbers, no special characters, none of that.  Although they do encourage you to &#8220;Be tricky!&#8221;</li>
<li><a href="https://www.owasp.org/index.php/Blocking_Brute_Force_Attacks">Brute-force protections</a>. Clearly there&#8217;s no account lockout mechanism, unless of course &#8220;happiness&#8221; was at the top of the word list. While there is no perfect solution to brute force attacks, it would appear Twitter didn&#8217;t even try.</li>
<li><a href="http://www.owasp.org/index.php/Administrative_Interface">Segregation of administrative functionality</a>. I won&#8217;t underestimate the amount of effort required to segregate the admin interface. That being said, the attack would&#8217;ve failed if Twitter admins had to perform privileged functions via a dedicated internal interface.</li>
</ul>
<p>Any others?  Leave them in the comments.</p>
<p>In all fairness, it&#8217;s hard to make security a top priority in ANY company, much less a startup with overworked non-security-aware developers using an agile methodology with tight iterations (making some educated guesses here about Twitter).  Ideally you want to start prioritizing security <i>before</i> you become an attractive target.  Twitter missed the boat on that one, but I bet they&#8217;re paying attention now.</p>
<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/01/tallying-twitters-security-best-practice-violations/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Microsoft Fixes 8-year Old Design Flaw in SMB</title>
		<link>http://www.veracode.com/blog/2008/11/microsoft-fixes-8-year-old-design-flaw-in-smb/</link>
		<comments>http://www.veracode.com/blog/2008/11/microsoft-fixes-8-year-old-design-flaw-in-smb/#comments</comments>
		<pubDate>Wed, 12 Nov 2008 21:11:12 +0000</pubDate>
		<dc:creator>Christien Rioux</dc:creator>
				<category><![CDATA[Disclosure]]></category>
		<category><![CDATA[RESEARCH]]></category>
		<category><![CDATA[SDLC]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Vulnerabilities]]></category>
		<category><![CDATA[advisory dinosaur bug]]></category>

		<guid isPermaLink="false">http://www.veracode.com/blog/?p=483</guid>
		<description><![CDATA[With regard to the recent Patch Tuesday fix, there has been an issue fixed regarding NTLM Relaying, that has been around for more than eight years. In 2000, I wrote an advisory about NTLM relaying (CVE-2000-0834). The problem turned out to be significantly larger than I originally suggested in the advisory. The attack extended to [...]]]></description>
			<content:encoded><![CDATA[<p>With regard to the recent Patch Tuesday fix, there has been an issue fixed regarding NTLM Relaying, that has been around for more than eight years. </p>
<p>In 2000, I wrote an <a href="http://packetstormsecurity.org/advisories/atstake/A091400-1">advisory</a> about NTLM relaying (<a href="http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2000-0834">CVE-2000-0834</a>). The problem turned out to be significantly larger than I originally suggested in the advisory. The attack extended to other NTLM-based authentications on other protocols and allowed general-purpose credential theft via a man-in-the-middle attack.</p>
<p>The <a href="http://en.wikipedia.org/wiki/SMBRelay">SMBRelay</a> tool was published in 2001 by Sir Dystic of Cult Of The Dead Cow, and that really took it to the next level. The protocol completely fell apart. It kicked off a number of other analyses of the NTLM protocol that finally resulted in this patch.  Eight years after it&#8217;s discovery.</p>
<p>At least they got around to it. Thanks!</p>
<h5>Veracode Security Solutions</h5>
<div style="margin-left:15px;">
<a href="http://www.veracode.com/security/web-security">Web Security</a><br />
<a href="http://www.veracode.com/security/vulnerability-assessment-software">Vulnerability Assessment</a><br />
<a href="http://www.veracode.com/security/application-testing-tool">Application Analysis</a><br />
<a href="http://www.veracode.com/security/static-code-analysis">Static Code Analysis</a><br />
<a href="http://www.veracode.com/security/code-analysis">Source Code Analysis</a><br />
<a href="http://www.veracode.com/security/software-testing-tools">Software Testing Tools</a><br />
<a href="http://www.veracode.com/security/static-analysis-tool">Static Analysis Tool</a><br />
<a href="http://www.veracode.com/security/web-application-security-testing">Web Application Security</a><br />
<a href="http://www.veracode.com/">Application Security</a></div>
<p></p>
<h5 style="margin-bottom: 10px">Security Threat Guides</h5>
<div style="margin-left:15px;">
<a href="http://www.veracode.com/security/ldap-injection">LDAP Security</a><br />
<a href="http://www.veracode.com/security/mobile-code-security">Mobile Security</a><br />
<a href="http://www.veracode.com/security/sql-injection">SQL Injection</a><br />
<a href="http://www.veracode.com/security/xss">XSS</a><br />
<a href="http://www.veracode.com/security/csrf">CSRF</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.veracode.com/blog/2008/11/microsoft-fixes-8-year-old-design-flaw-in-smb/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

