<?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; QA</title>
	<atom:link href="http://www.veracode.com/blog/category/qa/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>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>Failing to Check Error Conditions Could Get You Sued</title>
		<link>http://www.veracode.com/blog/2009/03/failing-to-check-error-conditions-could-get-you-sued/</link>
		<comments>http://www.veracode.com/blog/2009/03/failing-to-check-error-conditions-could-get-you-sued/#comments</comments>
		<pubDate>Mon, 30 Mar 2009 17:12:38 +0000</pubDate>
		<dc:creator>Chris Eng</dc:creator>
				<category><![CDATA[Application Security]]></category>
		<category><![CDATA[QA]]></category>
		<category><![CDATA[RESEARCH]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://www.veracode.com/blog/?p=713</guid>
		<description><![CDATA[The Ontario Lottery and Gaming Corp. is in a bit of hot water after refusing to pay a $42.9 million jackpot: According to the statement, Kusznirewicz was playing an OLG slot machine called Buccaneer at Georgian Downs in Innisfil, Ont., on Dec. 8 when it showed he had won $42.9 million. When the machine&#8217;s winning [...]]]></description>
			<content:encoded><![CDATA[<p>The Ontario Lottery and Gaming Corp. is in a bit of hot water after <a href="http://www.cbc.ca/consumer/story/2009/03/17/slot.html">refusing to pay a $42.9 million jackpot</a>:</p>
<blockquote><p>According to the statement, Kusznirewicz was playing an OLG slot machine called Buccaneer at Georgian Downs in Innisfil, Ont., on Dec. 8 when it showed he had won $42.9 million.</p>
<p>When the machine&#8217;s winning lights and sounds were activated, an OLG floor attendant initially told Kusznirewicz to go to the &#8220;winners circle&#8221; to claim his prize, according to the statement. But other OLG employees immediately arrived and told him that the corporation would not be paying, because there had been a &#8220;machine malfunction.&#8221;</p>
<p>They offered him a free dinner for four at the casino&#8217;s buffet.</p></blockquote>
<p>In a press release, OLG described the malfunction as follows:</p>
<blockquote><p>&#8220;The single Buccaneer-themed slot machine in question is a two cent per play machine with a base game reward of $300 and an absolute maximum payout of $9,025,&#8221; the release states.</p>
<p>&#8220;The $42 million figure is not a possible award given this machine&#8217;s configuration and pay table settings.&#8221;</p></blockquote>
<p>Of course the lawsuit will probably be thrown out, or OLG will settle with the guy for a lesser amount.  But from a technical perspective, it&#8217;s amusing to think about what happened to cause this scenario.  You can imagine the slot machine software looking something like this:</p>
<pre>
void do_spin() {
  spin_reels();
  if (winning_combination) {
    unsigned int winnings = calculate_payout_in_cents();
    send_to_display("You've won $%u!n", winnings/100);
    add_to_balance(winnings/100);
  }
}

int calculate_payout_in_cents() {
  int rv;
  if (rv = lookup_payout_amount())
    return rv;
  else
    return -1;
}
</pre>
<p>For some reason, something caused lookup_payout_amount() to return NULL, which meant calculate_payout_in_cents() returned -1, signifying an error.  Then, in addition to implicitly <a href="http://cwe.mitre.org/data/definitions/195.html">casting the signed result to an unsigned type</a>, do_spin() fails to <a href="http://cwe.mitre.org/data/definitions/391.html">check for the error condition</a>!  It assumes success and announces the payout via the slot machine&#8217;s display.  In this case, the -1, represented as 0xFFFFFFFF in two&#8217;s complement, gets interpreted as an unsigned number, 4294967295, due to the implicit cast, and the display prints &#8220;You&#8217;ve won $42949672!&#8221;</p>
<p>Today&#8217;s lesson: remember to check your error conditions!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.veracode.com/blog/2009/03/failing-to-check-error-conditions-could-get-you-sued/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Thought Exercise: Automated Vulnerability Creation</title>
		<link>http://www.veracode.com/blog/2007/11/thought-exercise-automated-vulnerability-creation/</link>
		<comments>http://www.veracode.com/blog/2007/11/thought-exercise-automated-vulnerability-creation/#comments</comments>
		<pubDate>Thu, 15 Nov 2007 17:25:14 +0000</pubDate>
		<dc:creator>Chris Eng</dc:creator>
				<category><![CDATA[Application Security]]></category>
		<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[QA]]></category>
		<category><![CDATA[RESEARCH]]></category>

		<guid isPermaLink="false">http://www.veracode.com/blog/?p=70</guid>
		<description><![CDATA[A few of us were hanging out in the Veracode kitchen the other day and got to discussing the idea of programmatically injecting vulnerabilities into software. This is essentially the opposite of the problem that most security vendors, including ourselves, are trying to solve &#8212; that is, detecting vulnerabilities. Clearly there&#8217;s not much business value [...]]]></description>
			<content:encoded><![CDATA[<p>A few of us were hanging out in the Veracode kitchen the other day and got to discussing the idea of programmatically injecting vulnerabilities into software.  This is essentially the opposite of the problem that most security vendors, including ourselves, are trying to solve &#8212; that is, detecting vulnerabilities.  Clearly there&#8217;s not much business value in making software less safe, though you could imagine such a tool being used for educational purposes or a way to mass-produce QA test cases.</p>
<p>It sounds easy, right?  Certainly it would be easy to inject the types of classic security problems that are trivially detectable.  For example:</p>
<ul>
<li>Replace bounded string manipulation calls with unbounded ones, e.g. <code>strncpy()</code> becomes <code>strcpy()</code>, <code>strncat()</code> becomes <code>strcat()</code>, etc.</li>
<li>Replace <code>printf</code> style calls that use <code>%s</code> format string specifiers, e.g. <code>printf("%s", buf)</code> becomes <code>printf(buf)</code></li>
<li>Replace <code>scanf()</code> calls with everybody&#8217;s favorite function, <code>gets()</code> (Hi AIX developers!)</li>
<li>Create type mismatches and potential integer coercion issues by replacing unsigned variables with their signed counterparts</li>
<p>
</ul>
<p>Or, on the web application side:</p>
<ul>
<li>Create SQL injection by replacing prepared statements with concatenated queries &#8212; not trivial but there are a limited number of database APIs, and SQL statements follow a defined syntax, so it wouldn&#8217;t be that hard</li>
<li>Inject XSS by removing all calls to known output encoding routines</li>
<li>Disable input validation by removing all calls to mechanisms such as regex replacement</li>
<p>
</ul>
<p>Of course, when you start messing with input validation, you run the risk of altering the intended operation of the program.  Maybe that regex replacement you removed was security-related, but on the other hand, maybe it&#8217;s performing a transformation that&#8217;s relevant to the application logic.  If you didn&#8217;t care about the program actually being able to function, you could:</p>
<ul>
<li>Arbitrary shorten character arrays</li>
<li>Use the incorrect functions to manipulate standard and/or wide strings</li>
<li>Add or remove calls to <code>free()</code> or <code>delete</code></li>
<li>Swap calls to <code>delete</code> and <code>delete[]</code></li>
<li>Remove checks for null &#8212; string contents, <code>malloc()</code> return values, whatever you feel like</li>
<li>Create off-by-one errors in loop counters and array indexes</li>
<p>
</ul>
<p>I could go on forever but you probably get the point.  The trick would be finding the ones that didn&#8217;t make the program segfault after 30 seconds of operation.  Then again, is it really important that the vulnerable version of the program behaves identically to the original under normal operating circumstances?  That constraint makes it more challenging; otherwise, it&#8217;s kind of a boring exercise. You could argue that it&#8217;s important if you plan to use the modified version to test a fuzzer (or other dynamic analysis tool) but not for static analysis.    </p>
<p>Either way, you&#8217;d eventually hit the same boundaries as a vulnerability detection tool.  There would still be entire classes of vulnerabilities that could not be addressed effectively.  How do you create authorization bypass issues without an understanding of what&#8217;s being protected and from whom?  How do you inject CSRF without knowing which functions are meaningful and which tokens/identifiers are safe to remove?  And you can forget about business logic flaws entirely.  Basically, it&#8217;s hard to break something so specific without a decent understanding of how that something was designed to function in the first place.</p>
<p>Now that my brain is sufficiently uncluttered, I can get back to doing real work.  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.veracode.com/blog/2007/11/thought-exercise-automated-vulnerability-creation/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>BlackHat 2007 Materials</title>
		<link>http://www.veracode.com/blog/2007/08/blackhat-2007-materials/</link>
		<comments>http://www.veracode.com/blog/2007/08/blackhat-2007-materials/#comments</comments>
		<pubDate>Tue, 28 Aug 2007 19:36:47 +0000</pubDate>
		<dc:creator>Chris Eng</dc:creator>
				<category><![CDATA[Application Security]]></category>
		<category><![CDATA[Binary Analysis]]></category>
		<category><![CDATA[QA]]></category>
		<category><![CDATA[RESEARCH]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://www.veracode.com/blog/?p=58</guid>
		<description><![CDATA[Finally getting around to posting our materials from the talk that Chris Wysopal and I gave at BlackHat this year entitled &#8220;Static Detection of Application Backdoors.&#8221; Here are the slide deck and the accompanying whitepaper: Static Detection of Application Backdoors (slides) Static Detection of Application Backdoors (whitepaper) Also, as a proof-of-concept, we had demonstrated using [...]]]></description>
			<content:encoded><![CDATA[<p>Finally getting around to posting our materials from the talk that Chris Wysopal and I gave at BlackHat this year entitled &#8220;Static Detection of Application Backdoors.&#8221;  Here are the slide deck and the accompanying whitepaper:</p>
<div id="indent">
<a href="http://www.veracode.com/images/stories/static-detection-of-backdoors-1.0-blackhat2007-slides.pdf">Static Detection of Application Backdoors (slides)</a><br />
<a href="http://www.veracode.com/images/stories/static-detection-of-backdoors-1.0.pdf">Static Detection of Application Backdoors (whitepaper)</a>
</div>
<p>Also, as a proof-of-concept, we had demonstrated using IDA Pro&#8217;s scripting framework to detect one of the backdoor examples that we discussed &#8212; suspicious cryptographic API calls.  Specifically, it flags calls to known encryption, decryption, and/or key management functions where a constant value is passed to a specific argument position.  This can help identify situations such as an application encrypting data with a hard-coded key.  We had numerous requests to post the code, so here it is:</p>
<div id="indent">
<a href='http://www.veracode.com/blog/wp-content/uploads/2007/08/cryptoconst.zip'>Cryptoconst IDC script</a> (requires IDA Pro)
</div>
<p>Veracode&#8217;s binary analysis technology uses similar (but more sophisticated) techniques.  We build our own intermediate representation of the binary&#8217;s data flows, control flows, and range propagation which is not based on IDA Pro.  We then scan that representation for backdoors in ways similar to the cryptoconst script.  However, at BlackHat you&#8217;re not allowed to promote your own products/services, so it wasn&#8217;t appropriate for us to use it for demonstration purposes.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.veracode.com/blog/2007/08/blackhat-2007-materials/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Software Trustworthiness Framework (STF©)</title>
		<link>http://www.veracode.com/blog/2007/01/the-software-trustworthiness-framework-stf%c2%a9-2/</link>
		<comments>http://www.veracode.com/blog/2007/01/the-software-trustworthiness-framework-stf%c2%a9-2/#comments</comments>
		<pubDate>Tue, 30 Jan 2007 16:33:31 +0000</pubDate>
		<dc:creator>Chris Wysopal</dc:creator>
				<category><![CDATA[Application Security]]></category>
		<category><![CDATA[QA]]></category>
		<category><![CDATA[RESEARCH]]></category>
		<category><![CDATA[SDLC]]></category>

		<guid isPermaLink="false">http://www.veracode.com/blog/?p=22</guid>
		<description><![CDATA[[Today we have our first guest blog entry from Elfriede Dustin. Elfriede is a co-author of "The Art of Software Security Testing" and has written a few books on software testing, most notably, "Automated Software Testing" published by Addison-Wesley in 1999. We have heard plenty from security experts on how to fix the software development [...]]]></description>
			<content:encoded><![CDATA[<p><em>[Today we have our first guest blog entry from Elfriede Dustin.  Elfriede is a co-author of "The Art of Software Security Testing" and has written a few books on software testing, most notably, "Automated Software Testing" published by Addison-Wesley in 1999.  We have heard plenty from security experts on how to fix the software development process to produce more secure software.  Elfriede brings a QA practitioners viewpoint.  I'd like to hear more from the testing community on this topic. - Chris Wysopal]</em></p>
<p><strong>The Software Trustworthiness Framework (STF©)</strong><br />
by Elfriede Dustin</p>
<p>Recently I presented the topic “Automated Software Testing” at a Department of Homeland Security workshop on Software Assurance. Most practitioners at the workshop equated Software Assurance with Software Security Testing and one might wonder what automated software testing has to do with software assurance?</p>
<p>In order to achieve software trustworthiness in the limited amount of time that’s generally allowed to produce software, a combination effort of automated software testing along with security testing is required: The Software Trustworthiness Framework (STF©) is needed.</p>
<p>Daily we are bombarded by news media alerts of new security breaches whether at the private, state, or government level, the latest example, UCLA having to alert 800,000 to data breach.<a name="_ftnref1"></a> <span class="MsoFootnoteReference"><!--[if !supportFootnotes]--><span class="MsoFootnoteReference">[1]</span><!--[endif]--></span></p>
<p>Josh Bloch, chief Java architect at Google, said in a recent statement “Regardless of how talented and meticulous a developer is, bugs and security vulnerabilities will be found in any body of code – open source or commercial. Given this inevitably, it&#8217;s critical that all developers take the time and measures to find and fix these errors.”</p>
<p>Developers however are strapped cranking out new features while trying to meet the often unreasonable deadlines. First-to-market is key, beating the competition is the goal. Given this dilemma, where software developers alone cannot be responsible for software assurance, we need to look to other resources to help us win the software trustworthiness battle. Who is better suited to help a developer conduct security testing than the software testing groups already in place?</p>
<p>In the traditional software development lifecycle, software trustworthiness is often an afterthought, and security verification and testing efforts are delayed until after the software has been developed. Meeting deadlines is key, at all cost, including that of trustworthiness, yet vulnerabilities are an emergent property of software that appear throughout the design and implementation cycles.</p>
<p>Currently, much of the Security testing that is done after the software has been implemented, such as paying an external party to perform security testing and issue a report, can be considered just a Band-Aid solution. It is tempting for security testing teams to focus purely on the mechanics of testing the security of a software application and pay little attention to the surrounding tasks required of a secure software development lifecycle, such as automated software testing. This is where the STF© comes into play.</p>
<p>It is not possible to “test” software trustworthiness into software and it is widely known that the earlier a defect is uncovered, the cheaper it is to fix.</p>
<p>A full lifecycle approach to software development is the only way to achieve software trustworthiness. Therefore, combining security testing with test automation, and a before, during, and after approach to software development is required.</p>
<p>The most effective software trustworthiness programs start at the beginning of a project, long before any program code has been written. An effective security process is one that is used throughout the SDLC and one that employs automated testing technologies.</p>
<p>The Automated Testing Lifecycle Methodology (ATLM) described in the book “Automated Software Testing<a name="_ftnref2"></a> <span class="MsoFootnoteReference"><!--[if !supportFootnotes]--><span class="MsoFootnoteReference">[2]</span><!--[endif]--></span>” is a structured methodology, supports the successful implementation of automating testing, has been implemented by companies throughout the world, and is recommended by various tool vendors. The ATLM approach is consistent with rapid application development efforts including engaging the user early in the development cycle. Many universities and professional software testing organizations are adopting this methodology in their software testing courses,  along with commercial companies heavily invested in automated testing.</p>
<p>The Secure Software Development Lifecycle (SSDL) described in Chapter 3 of the book “The Art of Software Security Testing” is a structured methodology that has emerged to support the successful implementation of secure and trustworthy software. In the SSDL security issues are evaluated and addressed early in the system’s lifecycle, during business analysis, throughout the requirements phase, and during the design and development of each software build. This early involvement allows the security team to provide a quality review of the security requirements specification, attack use cases, and software design. The team also will more completely understand business needs and requirements and the risks associated with them. Finally, the team can design and architect the most appropriate system environment using secure development methods, threat-modeling efforts, and so on to generate a more secure design. Much research has been performed in the area and resulting success of using a Secure Software Development Lifecycle (SSDL). The SSDL approach to software development is also recommended by some departments in DHS, Microsoft, and other major organizations.</p>
<p>Amalgamating the Automated Testing Lifecycle Methodology (ATLM) together with the Secure Software Development Lifecycle (SSDL) combines automated software testing with software security testing into the <strong>Software Trustworthiness Framework</strong>.</p>
<p><strong>More on the STF</strong>©:</p>
<p>As outlined in Figure 1, the SSDL and ATLM represent a structured approach toward implementing trustworthy software &#8211; <em>The Software Trustworthiness Framework</em>. This framework mirrors the benefits of modern rapid application development efforts. Such efforts engage the stakeholders early on as well as throughout analysis, design, and development of each software build, which is done in an incremental fashion.</p>
<p><img alt="Software Trustwortiness Framework Diagram" id="image23" src="http://www.veracode.com/blog/wp-content/uploads/2007/01/stf.jpg" /></p>
<p align="center" style="text-align: center" class="FN"><a name="_Toc145137730"></a>Figure 1 <a name="_Toc145137731"></a><em><span style="font-weight: normal">The Secure Software Development Lifecycle combined with the Automated Testing Lifecycle Methodology (ATLM) results in the</span></em> Software Trustworthiness Framework (STF)<span /><em><span style="font-weight: normal" /></em></p>
<p>The inner layer of Figure 1 describes the ATLM and has six primary processes:</p>
<ul>
<li>1. Decision to Automate Testing</li>
<li>2. Test Tool Acquisition</li>
<li>3. Automated testing Introduction Process</li>
<li>4. Test Planning, Design, and Development</li>
<li>5. Execution and Management of Tests</li>
<li>6. Test Program Review and Assessment</li>
</ul>
<p></p>
<p>The outer layer of Figure 1 describes the SSDL and has six primary processes that are intertwined with the ATLM:</p>
<ul>
<li>A. Security guidelines, rules, and regulations &#8211; Oversight</li>
<li>B. Security requirements: attack use cases</li>
<li>C. Architectural and design reviews/threat modeling</li>
<li>D. Secure coding guidelines</li>
<li>E. Black/gray/white box testing</li>
<li>F. Determining exploitability</li>
</ul>
<p></p>
<p>The combined processes and tools make up the <strong>Software Trustworthiness Framework </strong>(STF©).</p>
<p>Implementing the Software Trustworthiness Framework (STF©) will allow for repeatable and consistent verification of new releases and software patches. It will evaluate the trustworthiness from an end-to-end system perspective, and will verify that the integration of components yield a trustable system.</p>
<p>Automating the testing efforts will allow for quick measurements of testing completeness and allow for testing consistency. Additionally, implementing the SSDL as described in “The Art of Software Security Testing” as part of the STF©  will support efforts to make software secure and together with the ATLM it can assure that it is robust and behaves as expected in while interacting with multiple software applications, as required.</p>
<p>Use of the STF©  will allow software testers to gain confidence that a fault in one piece of software does not introduce unknowns in a set of integrated software components. It will assure that the software trustworthiness is verifiable, given the often sparse level of software specification accessibility.</p>
<p>The Software Trustworthiness Framework provides a structured, multi-stage approach supporting the detailed and interrelated activities required to introduce and utilize automated tools along with security testing best practices with an iterative / spiral development approach.  These activities include:  test design development, development and execution of test cases, development and management of test data and the test environment, documenting, tracking and closing trouble reports found during testing.</p>
<hr width="33%" size="1" align="left" /><a name="_ftnref1"></a>[1] <a href="http://www.securityfocus.com/news/11429">http://www.securityfocus.com/news/11429</a><br />
<a name="_ftnref2"></a>[2] “Automated Software Testing,” Elfriede Dustin, et al, Addison Wesley, 1999<a name="_ftn1"></a></p>
<p><a name="_ftnref1"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.veracode.com/blog/2007/01/the-software-trustworthiness-framework-stf%c2%a9-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

