<?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>Justice League Blog &#187; Defects, Bugs, and Flaws</title>
	<atom:link href="http://www.cigital.com/justice-league-blog/category/defects-bugs-and-flaws/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cigital.com/justice-league-blog</link>
	<description></description>
	<lastBuildDate>Fri, 04 May 2012 18:54:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Open Source and Software Maturity Models</title>
		<link>http://www.cigital.com/justice-league-blog/2011/11/15/open-source-and-software-maturity-models/</link>
		<comments>http://www.cigital.com/justice-league-blog/2011/11/15/open-source-and-software-maturity-models/#comments</comments>
		<pubDate>Wed, 16 Nov 2011 00:45:03 +0000</pubDate>
		<dc:creator>jOHN</dc:creator>
				<category><![CDATA[Admin]]></category>
		<category><![CDATA[BSIMM]]></category>
		<category><![CDATA[Defects, Bugs, and Flaws]]></category>
		<category><![CDATA[Enterprise Software Security]]></category>
		<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://www.cigital.com/justiceleague/?p=972</guid>
		<description><![CDATA[I&#8217;m at the BSIMM3 Conference, in an open source breakout session. The context: you&#8217;re an organization with a reasonable application security program. The question, &#8220;How to apply that same process maturity to open source where no &#8216;throat to choke&#8217; exists?&#8221; Your organization and its software-providing vendors may not be perfect but at least you can [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m at the <a href="http://bsimm.com/">BSIMM3 Conference</a>, in an open source breakout session. The context: you&#8217;re an organization with a reasonable application security program. The question, &#8220;How to apply that same process maturity to open source where no &#8216;throat to choke&#8217; exists?&#8221; Your organization and its software-providing vendors may not be perfect but at least you can choke someone if vulnerability exists. If you believe in the value of <a href="http://bsimm.com/online/">SSF</a> activities for built and purchased software, you understand that assurance activities (source code review or penetration testing) may apply to open source, but applying others (such as training, or SDL gating/exceptions, and so forth) might be as impossible shooting ghosts. So, we have a control problem: </p>
<blockquote><p>We can&#8217;t tackle the &#8220;process improvement&#8221; problem with our open source provides like we can with those who build our software in-house, or those vendors from whom we acquire code. </p></blockquote>
<p>Understanding, based on this, we lack as many &#8216;knobs and dials&#8217; for improving the cleanliness of the pipes through which open source software flows&#8230; we may have a flow rate problem as well. Though I lack hard evidence, I&#8217;d bet this represents a proverbial iceberg&#8217;s tip:</p>
<blockquote><p>An organization may deploy as much or more open source code as their own in-house developed code.</p></blockquote>
<p>It&#8217;s interesting to think about the money organizations spend to secure the code they build vs. the amount of open source they consume in this light&#8230; (participants indicated they didn&#8217;t track this spend separate from their development efforts).</p>
<p>Harumph. Our breakout group generated great ideas worth sharing. First, we unearthed a lot of things attending organizations already do. Next, we brainstormed valuable next steps. Here&#8217;s categories of activities we came up with:</p>
<p><UL><br />
<LI>Inventory &amp; Inventory Control</LI><br />
<LI>Vulnerability Identification (Assessment)</LI><br />
<LI>Vulnerability Management</LI><br />
<LI>Ownership of Open Source</LI><br />
<LI>Policy (use)</LI><br />
<LI>Policy (Contribution)</LI><br />
</UL></p>
<p>What did each entail?</p>
<p><strong>Inventory &amp; Inventory Control</strong><br />
<UL><LI><em>Identification</em> &#8211; All Participating organizations had a manual discovery process for open source usage.  Many wanted better automated schemes, despite some existing tool usage.</LI></p>
<p><LI><em>Identification of masked open source</em> &#8211; Many participating organizations realize that not only do they adopt open source software directly but that the 3rd party code (and open source) they absorb also contain open source software. Discovering this &#8216;masked open source&#8217; software represents as big a problem as identifying the open source software used directly. </LI></p>
<p><LI><em>Centralized open source distribution</em> &#8211; Some organizations allow development &amp; deployment of open source software from the web directly whereas others only allow access to and use of open source from a centrally managed repository. Centralizing deployment usage may provide only improved integrity, or may be used to implement an &#8216;approved package list&#8217;.</LI></UL></p>
<p><strong>Vulnerability Identification (Assessment)</strong></p>
<ul>
<LI><em>Using assessment tools</em> &#8211; About three-quarters of workshop respondents used the same tools they use to assess their application security posture on their open source assets. This, to me, seems worth its own blog entry. I had to wonder aloud, &#8220;as organizations move from detective assessment schemes (SCR, PT) to so-called preventative (threat modeling, architecture analysis, misuse/abuse cases) how do they consider open source?&#8221; I&#8217;m finding that organizations blazing trails into security architecture work commonly omit discussion of their open source frameworks.</li>
</ul>
<p><strong>Ownership</strong><br />
<UL><LI><em>Maintain a white list of open source</em> &#8211; Seemingly related to the &#8220;centralized distribution&#8221; item (but surprisingly uncorrelated in our survey), this meant that someone, from security, owned assessing the risk and proffering a &#8220;thumbs-up&#8221; or &#8220;thumbs-down&#8221; that can inhibit white list membership.</LI><br />
<LI><em>Revisit white list</em> &#8211; Organizations expressed that they found value in pruning the approved list of open source software based on non-use, newly identified risk, and similar factors. About one-quarter of our group engaged in this activity.</LI><br />
<LI><em>Ownership of identified risk</em> &#8211; Some participants avidly encouraged use of open source within their applications. In these organizations, when a developer chooses to include open source (as opposed to writing a widget themselves), they own any newly identified risk when in that open source. This reminded me eerily of Wall St. traders. Equity investment creates risk. Margin calls create leveraged risk. In this metaphor, choosing to adopt open source seems like a margin call. It&#8217;s very possible that a developer can absorb more risk into the organization than they themselves could effectively own up to in black-swan scenarios. It&#8217;s unclear how to measure this exposure when adopting open source.</LI></p>
<p><LI><em>Collaboration</em> &#8211; Certainly an organization-specific and an unsolved problem, participants indicated there may be a &#8220;third stakeholder&#8221; in the process of identifying and managing open source vulnerability. Two examples given were 1) clearing houses from which organizations purchase open source software and 2) support organizations (a la RedHat).</LI>
</ul>
<p><strong>Vulnerability Management</strong><br />
<UL><br />
<LI><em>Root Cause Analysis</em> &#8211; When a vulnerability is found (regardless of means or source: internal/external), organizations sometimes can point to a person or group who understands the vulnerable component (notable exceptions exist for purchased software or that software maintained by a development team that&#8217;s vanished). In open source, the organization must expend resources in order to &#8220;get smart&#8221; on vulnerability&#8217;s root cause and make trade-offs about mitigation strategies and their impacts. This represents extra cost on which I&#8217;d enjoy having greater visibility.</LI><br />
<LI><em>Vulnerability Impact Analysis</em> &#8211; Almost every participant had some regime by which they discovered (through assessment, feeds, or other means) new vulnerabilities within their adopted open source code base. Everybody possessed some ability to figure out which lines-of-business or development teams might be affected by newly discovered vulnerabilities.</LI><br />
<LI><em>Patch Management</em> &#8211; Only about one half of participants had, in their minds, a good strategy&#8211;having assessed the impacted teams&#8211;for distributing a patch that remediated open source vulnerability in an organization-wide manner. More strategically, several schemes seemed available to organizations beyond the straightforward &#8220;penetrate-and-patch&#8221; loop here. Alternatives included: </p>
<p><OL><br />
<LI>Wrapping open source<br />
<LI>Hardening open source (and centrally distributing)<br />
<LI>Sandboxing/compartmentalizing open source<br />
</OL><br />
</LI><br />
</UL></p>
<p><strong>Policy (Use)</strong><br />
<UL><br />
<lI><em>Security Policy/Standards</em> &#8211; About half participants had some kind of security policy or standards addressing how to securely use open source software within the organization.</li>
<li><em>Training</em> &#8211; About one quarter of participants trained their developers to use some portion of their open source securely. Interestingly enough, the one quarter of our respondents that trained developers did not line up well with the one half that had security standards. Wild.</li>
<p></UL></p>
<p><strong>Policy (Contribution)</strong><br />
<UL><br />
<LI><em>Legal permission to contribute to open source</em> &#8211; Some organizations see open source contribution as a key activity. Others did but have suffered clamp-down from their legal departments because legal fears liability. Others never liked the idea. </li>
<li><em>Community Notification on Vulnerability</em> &#8211; When an organization contributes to open source and later finds (or is notified of) vulnerability in its contributions, it may need a way to notify the broader community. Organizations also complained about very high latency in the community notifying them of vulnerability in their code. This proved a surprising problem in our brainstorming session. Why? Contributors complained that this was because, often, their contributions were either 1) forked or 2) baked into other products that masked use of the contributions. In either case, it wasn&#8217;t evident to those disclosing the vulnerability that the (contributing) organization was responsibly for vulnerable code.
</li>
</ul>
<p>I will absolutely not let it go without saying that though this entry contains many of my own thoughts it heavily relies on the work of many in our breakout session, well-lead by HP&#8217;s <a href="https://www.fortify.com/company/management/brian-chess.html">Brian Chess</a>. Thanks all for a great discussion.<br />
-jOHN</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cigital.com/justice-league-blog/2011/11/15/open-source-and-software-maturity-models/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>BEAST and SSL/TLS</title>
		<link>http://www.cigital.com/justice-league-blog/2011/09/26/beast-and-ssltls/</link>
		<comments>http://www.cigital.com/justice-league-blog/2011/09/26/beast-and-ssltls/#comments</comments>
		<pubDate>Mon, 26 Sep 2011 15:02:59 +0000</pubDate>
		<dc:creator>Cigital</dc:creator>
				<category><![CDATA[Defects, Bugs, and Flaws]]></category>
		<category><![CDATA[Software Security]]></category>

		<guid isPermaLink="false">http://www.cigital.com/justiceleague/?p=950</guid>
		<description><![CDATA[This is a guest post by Amit Sethi, Technical Manager at Cigital. There has been a lot of talk about BEAST (Browser Exploit Against SSL/TLS) lately. The attack against SSL 3.0 / TLS 1.0 was recently publicized by Thai Duong and Juliano Rizzo. Do you know what the risks are, and how to protect yourself? [...]]]></description>
			<content:encoded><![CDATA[<p><em>This is a guest post by Amit Sethi, Technical Manager at Cigital.</em></p>
<p>There has been a lot of talk about BEAST (Browser Exploit Against SSL/TLS) lately. The attack against SSL 3.0 / TLS 1.0 was recently publicized by Thai Duong and Juliano Rizzo. Do you know what the risks are, and how to protect yourself?</p>
<p><strong>How does it work?</strong></p>
<p>The attack has two components, and the goal is for the attacker to get your cookie so that he can hijack your session:</p>
<ul>
<li>Some client-side code (Java applet, Silverlight application, etc.) that is injected into a page delivered over HTTP that can make requests to a site that uses HTTPS. This may require bypassing (or finding loopholes in) same-origin security policies.</li>
<li>A sniffer on the network that the victim is on, to record encrypted data generated by the client-side code. The sniffer and the client-side code need to communicate with each other for the attack to work.</li>
<p>The easiest way to carry out this attack is over a public Wi-Fi network; however, attackers on other types of networks including wired networks can also do this. The main requirement is that the attacker and the victim need to be on the same LAN. The attacker will need to conduct a man-in-the-middle attack to inject malicious code into a HTTP page that can make requests to the targeted HTTPS site. This attack only works if the HTTPS connection is established using SSL 3.0 or TLS 1.0 and a block cipher (e.g. 3DES or AES) in CBC mode is chosen. Unfortunately, most HTTPS sites currently support only SSL 3.0 and TLS 1.0, and prefer using block ciphers in CBC mode.</li>
</ul>
<p><strong>Some technical details</strong></p>
<p>The main techniques used by the attack are described below. Feel free to skip this section if you don’t care about the technical details.</p>
<ul>
<li>Some types of client-side code (Java applets, Silverlight applications, etc.) have the ability to send partial HTTPS requests. They keep the SSL/TLS connection open, and send data as it becomes available. With SSL 3.0 / TLS 1.0, each time a new block of data is sent, a new random initialization vector is not generated. The data is simply appended to the previous stream. An attacker who sees the last ciphertext block and can control the next plaintext block can gain complete control over the next ciphertext block (this is a consequence of how CBC mode works).</li>
<li>Since HTTP headers preceding cookie headers are predictable and can be obtained by an attacker who sniffs a single HTTP request from the victim, and since the attacker can control the URL of requests, he can control exactly where the cookie header’s bytes end up in relation to ciphertext block boundaries.</li>
<li>If an attacker knows the previous block of ciphertext and can completely control the next block of plaintext, he can determine whether a previously seen block of ciphertext corresponded to a given block of plaintext. Let’s assume that the attacker wants to determine whether the plaintext, <em>P<sub>i</sub></em>, for a previously seen block of ciphertext, <em>C<sub>i</sub></em> was <em>x</em>. Now, the attacker knows <em>C<sub>j-1</sub></em>, the last block of ciphertext, and wants to set <em>P<sub>j</sub></em>, the next block of plaintext to be encrypted, to a value that helps him determine whether <em>P<sub>i</sub></em> was equal to <em>x</em>. If he sets <em>P<sub>j</sub></em> = <em>C<sub>j-1</sub></em> &#x2295; <em>C<sub>i-1</sub></em><em>P<sub>i</sub></em> &#x2295; <em>x</em> (note that <em>C<sub>j-1</sub></em> and <em>C<sub>i-1</sub></em> are sniffed from the network, and <em>x</em> is the attacker’s guess), and <em>P<sub>i</sub></em> was indeed equal to <em>x</em>, then <em>C<sub>j</sub></em> = E(<em>C<sub>j-1</sub></em> &#x2295; <em>P<sub>j</sub></em>) = E(<em>C<sub>j-1</sub></em> &#x2295; <em>C<sub>j-1</sub></em> &#x2295; <em>C<sub>i-1</sub></em> &#x2295; <em>x</em>) = E(<em>C<sub>i-1</sub></em> &#x2295; <em>x</em>) = E(<em>C<sub>i-1</sub></em> &#x2295; <em>P<sub>i</sub></em>) = <em>C<sub>i</sub></em>. Therefore, if the attacker’s guess is correct, then the next block of ciphertext, <em>C<sub>j</sub></em>, will equal the previously seen block of ciphertext, <em>C<sub>i</sub></em>.</li>
</ul>
<p>Given the above details, let’s say that an attacker makes a request to /AAAAAAAAAA, and knows that it will result in a block of ciphertext containing part of the cookie header: “ookie: x” (this is realistic if a 3DES cipher suite is used). Now, the attacker can make all 256 possible guesses for x, and can determine the first byte of the cookie header. Next, the attacker can make a new HTTP request to /AAAAAAAAA (one less A, which shifts the cookie header one position to the left such that the ciphertext block is now “okie: xy”) and can guess y. The attacker can continue in this manner until he guesses all bytes of the cookie. In reality, there are a lot less than 256 possibilities for each byte of the cookie header, and so the attack requires less work. There are also several details required for the attack to work that are omitted here.</p>
<p><strong>Why the problem can’t be fixed quickly</strong></p>
<p>TLS 1.1, which fixes this issue, was defined in April 2006. As you may have guessed, this problem was known before April 2006. However, it was considered mostly a theoretical issue until Thai Duong and Juliano Rizzo showed how it can be used to decrypt cookies sent over HTTPS. Even though this issue has been known for a while, it is probably not going to be fixed anytime soon because most websites do not support TLS 1.1 or TLS 1.2. According to Opera, only about 0.25 percent of web servers support TLS 1.1, and <a href="http://news.cnet.com/8301-30685_3-20108633-264/researchers-to-detail-hole-in-web-encryption/">only 0.02 percent of web servers support TLS 1.2</a>. There are workarounds that some browser vendors are currently implementing and testing; however, this problem is not going to be completely fixed until most web servers start supporting TLS 1.1 or TLS 1.2.</p>
<p><strong>Risks</strong></p>
<p>Should you be worried? Probably not. This does not significantly increase the risk of connecting to untrusted networks. There are easier attacks that can be used to steal your cookies (or your username and password) for many websites, or even install arbitrary software on your computer if you connect to untrusted networks. Some examples are:</p>
<ul>
<li>Many websites do not set the ‘secure’ flag on their session cookies, which means that a tool like sslstrip can be used by an attacker on your network to get your cookie.
<li>Many websites provide login forms over HTTP (even though your password may actually submitted over HTTPS), and attackers on your network can modify the login pages to get your username and password.
<li>Many users ignore certificate warnings provided by browsers, or may not even notice that a tool like sslstrip is being used and that they are not actually accessing a site over HTTPS before entering their credentials.
<li>Tools such as Evilgrade can be used to install arbitrary software on your computer by leveraging software that has insecure automatic update mechanisms.
</ul>
<p><strong>Protecting yourself</strong></p>
<p>If you want to protect yourself against BEAST-like attacks, you can take several steps:</p>
<ul>
<li>Delete all your cookies before you connect to an untrusted network.</li>
<li>Limit the amount of time you spend authenticated to HTTPS sites on untrusted networks, and remember to log out as soon as you are done.</li>
<li>Until your browser vendor releases a fix, disable all cipher suites that use block ciphers in your browser (leave only cipher suites with RC4 enabled).</li>
</ul>
<p>Note that the last workaround may cause you to be unable to access many websites. Of course, when browser vendors release security updates, install them immediately.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cigital.com/justice-league-blog/2011/09/26/beast-and-ssltls/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>When All You Have is a Hammer&#8230;</title>
		<link>http://www.cigital.com/justice-league-blog/2011/05/03/when-all-you-have-is-a-hammer/</link>
		<comments>http://www.cigital.com/justice-league-blog/2011/05/03/when-all-you-have-is-a-hammer/#comments</comments>
		<pubDate>Wed, 04 May 2011 03:09:56 +0000</pubDate>
		<dc:creator>jOHN</dc:creator>
				<category><![CDATA[Admin]]></category>
		<category><![CDATA[Assurance]]></category>
		<category><![CDATA[Defects, Bugs, and Flaws]]></category>
		<category><![CDATA[Enterprise Software Security]]></category>
		<category><![CDATA[Software Security]]></category>
		<category><![CDATA[Software Security Touchpoints]]></category>
		<category><![CDATA[Software Testing]]></category>

		<guid isPermaLink="false">http://www.cigital.com/justiceleague/?p=776</guid>
		<description><![CDATA[We&#8217;ve probably all experienced organizations that rely principally on a single assessment technique (whether it be static or dynamic, manual or tool-based). Unfortunately, this is all too common for security practices. When this topic came up recently with the question (paraphrased), &#8220;Are there numbers that demonstrate the value of a security program making use of [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve probably all experienced organizations that rely principally on a single assessment technique (whether it be static or dynamic, manual or tool-based). Unfortunately, this is all too common for security practices. When this topic came up recently with the question (paraphrased), &#8220;Are there numbers that demonstrate the value of a security program making use of static, dynamic, and manual assessment techniques?&#8221; I thought some of our experience might apply.  </p>
<p> Cigital has always favored delivery of holistic assessments (those assessments that consider architecture/design as well as code, leveraging static &amp; dynamic tools, and using both tool-assisted and manual techniques). During my tenure as Director of Security, we found the following distribution of findings:</p>
<p><UL><br />
<LI>Static tool: 20%</LI><br />
<LI>Dynamic tool: 5% (*1)</LI><br />
<LI>Manual SCR: 15%</LI><br />
<LI>Architecture Risk Analysis: 60%</LI><br />
</UL></p>
<p>Those numbers may surprise and demand some explanation. For instance, though Microsoft at one point reported 50% of their findings were &#8220;flaws&#8221;, Cigital was finding 60% (on average, with as much as 70%) of its issues as &#8216;flaws&#8217;.  If anything, our classification of &#8216;flaw&#8217; was less inclusive though, and at the time I looked into this, I concluded that our larger percentage could be due to technique, focus on architecture in methodology (LoE), or level of customer familiarity/maturity with the tech-stack they developed on. </p>
<p>Likewise, our process started with a &#8220;whitebox&#8221; triage then shifted to exploratory testing (aka: dynamic) rather than the other way around (which I find common elsewhere) and that order-of-operations probably moved balance from dynamic to static. So, in practice we &#8220;found&#8221; vulnerabilities statically and then supported those findings with dynamic tests to validate their exploit-ability and impact (though perhaps dissatisfying, static gets the point in our data set here).</p>
<p><strong><em>Slicing by technique</em></strong><br />
Our experience made it pretty evident to us: skip assessment techniques and expect to miss some critical vulnerabilities. </p>
<p><strong><em>Slicing by vulnerability type</em></strong><br />
As I&#8217;ve mentioned in previous blog entries and mailing list posts, security managers need the capability to assess and report on their ability to find particular classes of security vulnerability as well. WASC&#8217;s <a href="http://projects.webappsec.org/w/page/13246989/Web-Application-Security-Statistics">Web Application Security Statistics</a> provide a starting point for both classes of attacks you might expect to find and their probability. There&#8217;s no shortage of vulnerability taxonomy work out there, so we&#8217;ll leave this topic at this superficial level. </p>
<p><strong><em>Optimizing a Security Practice</em></strong><br />
Whether you know what percentage of your reported findings come from each assessment technique, or you&#8217;re just starting to build your assessment practice, optimization (measurement, analysis, iterative improvement) should be a goal. To do this we combine our knowledge of the techniques we&#8217;re employing and the enumeration of vulnerabilities we want to find and report.</p>
<p>Confined to the context of static analysis, I described the following loop in a <a href="http://www.cigital.com/justiceleague/2011/02/02/if-its-so-hard-why-bother/">previous blog post</a> to do just that:</p>
<ul>
<li>Use a representative sample of <strong>your</strong> applications to observe a static analysis tool&#8217;s performance, not a contrived test suite.</li>
<li>Consider the tool&#8217;s findings relative to pen-testing findings on the same app. </li>
<ul>
<li>Did new and interesting findings result?</li>
<li>Did pen-testing findings found by the static tool provide adequate root-cause analysis and remediation advice to fix problems earlier?</li>
</ul>
<li>How long did it take to on-board an app? How will this scale to your portfolio of apps?</li>
<li>How long did it take to triage the results? How will this scale?</li>
</ul>
<p>The purpose of this trial experimentation was to provide some basic comparison between assessment techniques (though you could easily come up with a more thorough approach).  Of course, you&#8217;d want to consider findings from the perspective of all techniques, not just static tools. </p>
<p>Internally, we had our assessment lab managers write up a <em>qualitative</em> comparison of assessment techniques we employ, comparing how well each is &#8220;suited&#8221; to finding vulnerabilities against common vulnerability taxonomies (*2) and came up with the following:<br />
<UL><br />
<LI>ARA:               14%</LI><br />
<LI>Static tool:       12%</LI><br />
<LI>Manual SCR:  21%</LI><br />
<LI>Manual Pen:   21%</LI><br />
<LI>Dynamic Tool: 12%</LI><br />
<LI>Sec Testing:    20%</LI><br />
</UL></p>
<p>At this point, the reader may be asking why my experience differs from our lab managers&#8217;. Specifically, for instance, &#8220;why are dynamic techniques over-estimated here as compared to to historical findings rates?&#8221; Two reasons (at least) come to mind:</p>
<p><OL><br />
<LI>The balance of techniques that constitute our assessments  are &#8220;moving back&#8221; towards dynamic as software-under-test and market forces evolve</LI><br />
<LI>There&#8217;s a difference between how suited a technique is to discover something and how we choose to find it (I guarantee that in some circumstances this gap represent &#8216;optimization opportunities&#8217;, while in others it represents explicit technology or methodological choices).<br />
</OL></p>
<p><strong><em>The Caveat You&#8217;ve Come to Expect From Me</strong></em><br />
Whether your considering a vendor&#8217;s assessment service, an assessment standard, or your own internal assessment practice, it&#8217;s key to be able to detect biases. When others supply you assessment data you&#8217;ll likely uncover biases (though it may not be apparent to those reporting initially). Be careful, I doubt you&#8217;ll be able to compile, combine, or relate numbers you receive from varying sources for this reason. </p>
<p>If you&#8217;re compiling assessment data for the purpose of motivating practice improvement, you may want to either 1) extract universal similarities from the data you get and present those lessons learned to management, or 2) just list the others&#8217; experience separately. This can provide those to whom you&#8217;re presenting a compelling view to your perspective on differing assessment approaches.</p>
<p>In fact, many factors will muck up assessment comparison. For instance, when people report a percentage (like I did above), did they mean finding instances, findings, by type, or something else (*3)? What was their methodology, level-of-effort, and how did they conduct assessment. For instance, risk-based assessments produce a very different distribution (with wider variation) than time-boxed techniques, which more frequently drive to an explicit (or worse, implicit) checklist.</p>
<p>One thing universally seems true though: the more assessment techniques a software security practice makes use of, the more types of vulnerabilities it can expect to report.  </p>
<p>-jOHN</p>
<p>(*1)  &#8211; Clarification: our use of dynamic tools is human-assisted (both in terms of crawl and in follow-up with manual effort or leveraging internally developed tools).</p>
<p>(*2) &#8211;  WASC, OWASP Top 10, CWE Top 25</p>
<p>(*3) &#8211; My data is comprised of reported vulnerabilities. Answering questions about what risk-level I reported requires some abstraction as clients differ in their requirements there. Likewise, behavior regarding instances vs. buckets of &#8216;related vulns&#8217; requires addl. explanation.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cigital.com/justice-league-blog/2011/05/03/when-all-you-have-is-a-hammer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Evading WAFs and other forms of Input Validation</title>
		<link>http://www.cigital.com/justice-league-blog/2011/02/16/evading-wafs-and-other-forms-of-input-validation/</link>
		<comments>http://www.cigital.com/justice-league-blog/2011/02/16/evading-wafs-and-other-forms-of-input-validation/#comments</comments>
		<pubDate>Wed, 16 Feb 2011 18:55:17 +0000</pubDate>
		<dc:creator>scott</dc:creator>
				<category><![CDATA[Defects, Bugs, and Flaws]]></category>
		<category><![CDATA[Software Security]]></category>

		<guid isPermaLink="false">http://www.cigital.com/justiceleague/?p=530</guid>
		<description><![CDATA[My colleague, David Lindsay, is one of the authors of a new book, Web Application Obfuscation, about obfuscation techniques. Even the title is somewhat obfuscated because the book is about obfuscation techniques that can be used to attack web applications. The set of techiques described in the book by David and the other authors is [...]]]></description>
			<content:encoded><![CDATA[<p>My colleague, David Lindsay, is one of the authors of a new book, <a href="http://www.amazon.com/Web-Application-Obfuscation-WAFs-Evasion-Filters-alert/dp/1597496049/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1297092092&amp;sr=8-1"><em>Web Application Obfuscation</em></a>, about obfuscation techniques. Even the title is somewhat obfuscated because the book is about obfuscation techniques that can be used to attack web applications. The set of techiques described in the book by David and the other authors is amazing. My personal favorite was the chapter on non-alphanumeric JavaScript: writing JavaScript expressions that evaluate to the actual attack strings.</p>
<p>The implication of these techniques is that bolt-on security controls like WAFs can be evaded using obfuscation techniques. Similarly, simple-minded input validation can also be bypassed.</p>
<p><a href="http://www.amazon.com/Web-Application-Obfuscation-WAFs-Evasion-Filters-alert/dp/1597496049/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1297092092&amp;sr=8-1"><img src="/justice-league-blog/files/2011/02/web-application-obfuscation-wafsevasionfiltersalertobfuscation.jpg" alt="" width="130" height="160" class="alignright size-full wp-image-533" border="0" align="right" style="padding: 0 0 10px 10px" /></a>You can get a copy of the book at Amazon. I highly recommend this book for software security practioners and developers.</p>
<p>Remember to click on the link to tell the publisher that I want the book on my Kindle. <img src='http://www.cigital.com/justice-league-blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>The implication of this book (IMO) is that simple input validation is a less compelling mitigation as the sole control for malicious input. So, WAFs and regex-based input validation frameworks are going to need to either become much smarter (unlikely) or adding output encoding is going to be required.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cigital.com/justice-league-blog/2011/02/16/evading-wafs-and-other-forms-of-input-validation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Increasing Static Visibility</title>
		<link>http://www.cigital.com/justice-league-blog/2011/02/06/increasing-static-visibility/</link>
		<comments>http://www.cigital.com/justice-league-blog/2011/02/06/increasing-static-visibility/#comments</comments>
		<pubDate>Sun, 06 Feb 2011 22:00:22 +0000</pubDate>
		<dc:creator>jOHN</dc:creator>
				<category><![CDATA[Assurance]]></category>
		<category><![CDATA[Defects, Bugs, and Flaws]]></category>
		<category><![CDATA[Software Security]]></category>
		<category><![CDATA[Software Security Touchpoints]]></category>

		<guid isPermaLink="false">http://www.cigital.com/justiceleague/?p=487</guid>
		<description><![CDATA[Sometimes, people talk loosely about an important difference between static and dynamic analyzers. Static analyzers, they say, achieve 100% coverage. They may complain that dynamic tools struggle to get even double-digit statement coverage of an application under test. Dan Cornell wrote a blog post on static analysis coverage. He observed that while the static tool [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes, people talk loosely about an important difference between static and dynamic analyzers. Static analyzers, they say, achieve 100% coverage. They may complain that dynamic tools struggle to get even double-digit statement coverage of an application under test.   </p>
<p><a href="https://twitter.com/#!/danielcornell">Dan Cornell</a> wrote a <a href="http://denimgroup.posterous.com/coverage-is-key-static-analysis-can-only-scan">blog post </a>on static analysis coverage. He observed that while the static tool he used completed its scan, it didn&#8217;t find things it should. He implicitly referred to this as coverage. </p>
<p>I&#8217;ve often put things as follows:</p>
<blockquote><p>Your tool can&#8217;t find what it can&#8217;t see and it can&#8217;t see what it doesn&#8217;t parse.</p></blockquote>
<p>This got said often years back because at the time it was quite difficult to integrate tools effectively into a builds so that they would in fact &#8216;see&#8217; everything and successfully parse it (*1). We referred to this concept of how well we, as operators, had integrated as providing <strong>visibility</strong> into the code. These days, market leading tools don&#8217;t have nearly the problem they used to with finding the code they need to parse&#8230; or parsing that code successfully (*2).</p>
<p>These days, the frameworks developers use for persistence, object remoting, application navigation, and view display challenge visibility most. Tools see the code for your controller and parse it successfully but they don&#8217;t necessarily understand what it represents. This happens in almost every application I scan, even the painfully simple ones. </p>
<p>We couldn&#8217;t have our Consultants going out into the world armed with tools bearing only spotty visibility into applications so I wrote a utility <code>identifyEntryPoints</code> to find entry points on its own. We don&#8217;t want Consultants guessing at what their static analysis tool missed or popping the hood open to try to discern what it found and <em>not doing what they&#8217;re paid to do: <strong>assess the application</strong></em>, so I wrote another utility <code>entryPointCompare</code> to compare what the tool found vs. what I was able to find programmatically. See actual output below (I&#8217;ve replaced the static tool&#8217;s name with &#8216;TOOL XXX&#8217;):</p>
<pre style="margin: 0 auto;padding: 1em 3px;width: 90%;overflow: scroll;border: 1px solid #999">
Sanguine:demo jsteven$ /Users/jsteven/code/demo/working/engine/util/entrypointCompare.py
2011-02-06 09:07:08,158 INFO     bois_1.0        bin.execPythonRobot STARTING: /Users/jsteven/code/demo/working/engine/util/entrypointCompare.py
Factory 31, [TOOL XXX] 0
 TOOL XXX missed set(['Index', 'csrchat', 'accountsList', 'Transfer', 'editProfileFormBean', 'newAccountFormBean', 'fileList', 'Auth', 'newClientFormBean', 'qaFormBean', 'UserProfile', 'SetupProfileAction', 'uploadFile', 'VerifyAnswerAction', 'BeanEditProfileAction', 'existingClientFormBean', 'GetDocuments', 'ChatPoll', 'announcements', 'modifyDocument', 'BeanCreateAccountAction', 'ChangePasswordAction', 'VerifyClientAction', 'ChatSend', 'Help', 'fileUploader', 'BackOfficeAdmin', 'passwordFormBean', 'BeanCreateClientAction', 'action', 'Accounting'])
</pre>
<p>Here, I ran the test on Cigital&#8217;s own internal &#8220;Bank of Insecurities&#8221;, which is a simple Struts1 application. The utility&#8217;s output represents all the actions and forms that account for web-based input in their own respective ways. Sure looks like some pretty important stuff was missed in there huh? </p>
<p>The next step was to write a third program <code>registerEntryPoints</code> which would write rules for the missing entry/exit points as appropriate so that the beefy commercial static analysis tool could do what it does best. These utilities represent just some of the internal workings of Cigital&#8217;s <a href="http://www.cigital.com/solutions/esp/">ESP platform</a>. </p>
<p><strong><em>Yes, but my tool finds stuff all the time</strong></em><br />
Would a tool not find any findings without detecting entry points? Well, it <em>would</em> likely find potential vulnerability but only using more local syntactic analysis. Remember, &#8220;you can&#8217;t find what you can&#8217;t see&#8230;&#8221;</p>
<p><strong><em>I&#8217;m sensing a theme in your posts jOHN</strong></em><br />
OK, so, that&#8217;s two blog posts (Mr. Cornell and my own) complaining about what I refer to visibility. Now what? </p>
<p><strong><em>Spend time cataloging your chosen tool&#8217;s performance</em></strong><br />
Cigital experience indicates that as few as 10-13 reasonably chosen applications can serve as a representative sample for as many as 300 applications on the Java platform. When you pilot those 10-13 applications, conduct the following steps to avoid the visibility failures seen above in the portfolio as a whole:</p>
<ol>
<li>On-board the application using whatever tool interface gives the most feedback about missing artifacts (*3) </li>
<li>Explore scan logs for identified entry points</li>
<li>Manually explore the application&#8217;s deployment descriptors and critical configuration files</li>
<li>Document controller logic as framework default or developer extended</li>
<li>Identify key entities within the DAO/persistence framework</li>
</ol>
<p>When you&#8217;ve done that for 10-13 apps, our representative sample, stop and take stock of what you&#8217;ve collected. You&#8217;ll have created a very good list of items for which you&#8217;ll want to create custom rules. Different tools call the kind of rules you&#8217;ll create different things, but suffice it to say you&#8217;ll be writing rules to tell the tool that it&#8217;s:</p>
<ul>
<li>Entry: Taking input from untrusted web sources</li>
<li>Entry: Taking input from untrusted partner applications</li>
<li>Exit: Placing data in a untrusted view (browser, service repsonse, etc.)</li>
<li>Exit: Conducting CRUD operations on entity data</li>
</ul>
<p>The above list is by no means exhaustive. Indeed, you&#8217;ll want to look at data originating from the persistence tier and headed to the web (not listed above) but we often consider this as a second phase of customization. You&#8217;ll also want to begin considering data entry/exit from 2nd and 3rd party components within the applications being tests. Again, another good subsequent customization phase. </p>
<p><strong><em>Gosh, this sounds expensive</em></strong><br />
Yes; &#8216;well. Compared to simply running a static analysis tool using its IDE-based GUI, triaging results, and calling it quits this is darned expensive. However, it dramatically raises your visibility into an application&#8217;s vulnerability (you should also expect false-positive reduction). </p>
<p>Compare this to the potential difference in quality and depth of a manual, tool-assisted penetration test and an automated vulnerability scan. An engineer running AppScan costs much less than an expert penetration test and organizations have come to not only expect different results, but see these as two very different services. I predict that we&#8217;ll see a similar distinction between two services (automated and more expert-driven) in the static space in a few years. </p>
<p><em><strong>Leveraging Manual Efforts Across Assurance Activities</em></strong><br />
If your organization doesn&#8217;t conduct manual penetration testing and is unwilling to pay your engineers to properly on-board applications into its static analysis tool, then neither static nor dynamic analysis will benefit from high visibility into applications under test. The cost will look &#8220;high&#8221; and &#8220;extra&#8221; as well.</p>
<p>Conducting the kind of analysis described by this entry (targeting entry and exit points) can inform both static and dynamic analysis alike. Conduct this exercise for applications built with representative technology stacks. On the static front, write custom rules based on your work. On the dynamic side, furnish this work to your dynamic testers (even if they are external vendors) so that their exploration benefits from it. </p>
<p>(*1) &#8211; Coverity&#8217;s Prevent was always a notable exception and able to integrate with even challenging build environments without much pain.<br />
(*2) &#8211; Limitations still exist with complex (distributed) build systems, code-generation schemes, and even the more mundane JSP compilation process.<br />
(*3) &#8211; Ask if you need help here, last time I published tool details, vendors got cranky.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cigital.com/justice-league-blog/2011/02/06/increasing-static-visibility/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>If it&#8217;s so hard why bother?</title>
		<link>http://www.cigital.com/justice-league-blog/2011/02/02/if-its-so-hard-why-bother/</link>
		<comments>http://www.cigital.com/justice-league-blog/2011/02/02/if-its-so-hard-why-bother/#comments</comments>
		<pubDate>Wed, 02 Feb 2011 22:49:13 +0000</pubDate>
		<dc:creator>jOHN</dc:creator>
				<category><![CDATA[Assurance]]></category>
		<category><![CDATA[Defects, Bugs, and Flaws]]></category>
		<category><![CDATA[Software Security]]></category>

		<guid isPermaLink="false">http://www.cigital.com/justiceleague/?p=482</guid>
		<description><![CDATA[Recently, internal and external discussion hit on the topic of static tool comparison. The difficulty of this topic caused me to write up my thoughts as what became an InformIT article. This prompted some to respond, If selecting and adopting a tool is so hard, even for experts, why should I bother? Good question. The [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, internal and external discussion hit on the topic of static tool comparison. The difficulty of this topic caused me to write up my thoughts as what became <a href="http://www.informit.com/articles/article.aspx?p=1680863">an InformIT article</a>. This prompted some to respond,</p>
<blockquote><p>If selecting and adopting a tool is so hard, even for experts, why should I bother?</p></blockquote>
<p>Good question. The article was not written as indictment or defense of static analysis&#8211;it was a cautionary tale whose moral: &#8220;organizations can get wrapped around the wrong axle when selecting and adopting a tool&#8221; I believe in to the utmost. </p>
<p>If it is worth adopting static analysis, as I believe it is, then the question becomes: How do I avoid doing it poorly? I&#8217;ll start by revisiting some suggestions made in the article&#8217;s conclusion and continue.</p>
<p><strong>Seek Experience</strong><br />
Expert consulting can dramatically improve the speed and effectiveness of an organization&#8217;s definition of and scaling static analysis and SCR practices. But, you don&#8217;t need experts&#8217; help to successfully pick and adopt a tool.</p>
<p>Leverage communities you&#8217;re already amongst to absorb their experience. Reach out to:</p>
<ol>
<li>Your local OWASP chapter</li>
<li>Organizations within your vertical</li>
<li>Similarly sized/structured organizations within your geography</li>
</ol>
<p>Within the communities, others have likely already selected and adopted a tool. Though some will not share their selection or adoption experiences openly, others will. And, I&#8217;ve found that human nature can&#8217;t resist sharing at least _some_ aspects of a good war story. </p>
<p>War stories hint at underlying data more valuable than the particular selected tool: the aspects of adoption that posed the most challenge or required the most effort. Having your troops pointed in the right direction when fighting breaks out will benefit you more than making the better choice between equipping troops with a carbine or a rifle. <img src='http://www.cigital.com/justice-league-blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>During last year&#8217;s BSIMM conference in Annapolis, MD, I saw tremendous inter-organizational knowledge sharing on the static analysis front. Not only was I impressed, but as usual, I learned things. War stories? Those improved with volume imbibed.  </p>
<p><strong>Eschew Deep Scientific Comparison for Trial Experience</strong><br />
Unless you graduated with an advanced degree focused on static analysis, or spent the last ten years building/analyzing it, I don&#8217;t feel that a comparative study will be satisfying. Many have asked me, &#8220;With you experience&#8211;come-on&#8211;tell me&#8230; which is better, A or B?&#8221; Individuals asking me almost always hear a variant of the following candor: </p>
<blockquote><p>Comparing the analysis engines of the two market leaders is a lot like wondering about the Audi S4 vs. the BMW M3. Both take a comparable approach to their flag-ship consumer performance car: both switch between ~3.xL six-cylinder blown engines or ~4.xL naturally-aspirated  V8s. In the end, both gobble premium fuel and get to 62mph in 4.x seconds. Both are fine pieces of engineering and each has its own religious following. </p>
<p>Like the previous advice, knowing how to drive it and where the car&#8217;s limits are likely provides lower track times than the selection of one car over the other for the average-to-enthusiast driver.  It simply doesn&#8217;t matter whether the trappings of boost pressure produced by the S4&#8242;s supercharger beat out the direct-injection, independent throttles of the M&#8217;s high-revving V8 (*1)</p></blockquote>
<p>I&#8217;ve digressed a bit too far, haven&#8217;t I? Don&#8217;t do the same with your static tool <img src='http://www.cigital.com/justice-league-blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<ul>
<li>Use a representative sample of <strong>your</strong> applications to observe a static analysis tool&#8217;s performance, not a contrived test suite.</li>
<li>Consider the tool&#8217;s findings relative to pen-testing findings on the same app. </li>
<ul>
<li>Did new and interesting findings result?</li>
<li>Did pen-testing findings found by the static tool provide adequate root-cause analysis and remediation advice to fix problems earlier?</li>
</ul>
<li>How long did it take to on-board an app? How will this scale to your portfolio of apps?</li>
<li>How long did it take to triage the results? How will this scale?</li>
</ul>
<p>As your trial encounters problems, make explicit note of them. As you move from 3-10 apps to the portfolio as a whole, can your organization withstand stresses at scale? If not, you may want to switch tools or approaches. </p>
<p>I&#8217;ve seen security managers I respect get incredibly far without any consulting help just by taking an iterative approach and asking questions like those listed above. </p>
<p><strong>Worry about what you can control</strong><br />
You control your organization&#8217;s staff size, skill set, scanning policy, and infrastructure. You do <strong>not</strong> control the architecture, implementation, or bugs associated with the static analysis tool you buy and deploy. </p>
<p>So, as you talk to others about their experiences selecting and adopting a tool&#8230; as you conduct trials with a selected tool&#8230; and as you plan a larger roll-out at scale of your static practices, think about strengths and weaknesses in a chosen tool <strong>not</strong> in terms of how its competition might perform relatively but in terms of whether or not they <em>compliment</em> or <em>expose</em> your organization&#8217;s staff-based, skill, policy, and infrastructure weaknesses (or play to its strengths in those same areas).</p>
<p>And finally, don&#8217;t be afraid to ask for help.<br />
-jOHN </p>
<p> (*1) &#8211; In the interest of full-disclosure, I cast my lot with the 2011 M3 over its Audi competition despite BMW&#8217;s &#8216;heretic&#8217; departure from their I6 engine architecture heritage in the 3-series. I can make no such clear claim to my allegiance on the static front.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cigital.com/justice-league-blog/2011/02/02/if-its-so-hard-why-bother/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gartner and Static Analysis</title>
		<link>http://www.cigital.com/justice-league-blog/2009/02/19/gartner-and-static-analysis/</link>
		<comments>http://www.cigital.com/justice-league-blog/2009/02/19/gartner-and-static-analysis/#comments</comments>
		<pubDate>Thu, 19 Feb 2009 22:39:30 +0000</pubDate>
		<dc:creator>jOHN</dc:creator>
				<category><![CDATA[Assurance]]></category>
		<category><![CDATA[Defects, Bugs, and Flaws]]></category>
		<category><![CDATA[Software Security]]></category>

		<guid isPermaLink="false">http://www.cigital.com/justiceleague/?p=132</guid>
		<description><![CDATA[James McGovern recently wrote a post on Gartner&#8217;s static analysis (SA) report. Among other things, he lamented the lack of actionable guidance within the report. A lack of implementation guidance doesn&#8217;t shock me from Gartner, I can&#8217;t say I expect that from them. I can help James and community out by giving some of that [...]]]></description>
			<content:encoded><![CDATA[<p>James McGovern recently <a href="http://duckdown.blogspot.com/2009/02/gartner-releases-paper-on-static.html">wrote a post on Gartner&#8217;s static analysis (SA) report</a>. Among other things, he lamented the lack of actionable guidance within the report. A lack of implementation guidance doesn&#8217;t shock me from Gartner, I can&#8217;t say  I expect that from them. </p>
<p>I can help James and community out by giving some of that guidance myself. I&#8217;ll try to do so in a tool-independent way. This topic deserves more than a &#8220;blog entry&#8221; format (admitting Cigital&#8217;s propensity for longer entries <img src='http://www.cigital.com/justice-league-blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> ) so if people want more information on the topic, they can ping me. </p>
<p>In essence, you want to know the following about static analysis tools:</p>
<ol>
<li> Who is going to run it (how will owners shepherd it)?</li>
<li> How much effort is it going to take to run (what budget will I need to support it)?</li>
<li> When do I run it and how often (Where does it fit within my SDL?)</li>
<li> What it&#8217;s going to find (How will the results enter/impact my organization)?</li>
<li> What won&#8217;t it find (How does it play with the rest of the assurance ecosystem)? </li>
</ol>
<p><strong>[Market Adoption and Making Your Choice]</strong><br />
Gartner seems underwhelmed by Microsoft&#8217;s ability to effect the commercial static analysis market. Cigital has always believed these technologies would make great features of a compiler/IDE and so we&#8217;re also disappointed. They&#8217;ve got great technologies but don&#8217;t exploit them commercially. I still like their freely available <a href="http://www.microsoft.com/downloads/details.aspx?familyid=3389F7E4-0E55-4A4D-BC74-4AEABB17997B&amp;displaylang=en">FXCop</a> but this opinion isn&#8217;t popular. Perhaps that&#8217;s because I see a lot of value to FXCop as a unit testing framework that enables security test and other people are comparing it to glossy commercial tools like Fortify and Ounce run by security analysts in a very hands-off fashion. Who&#8217;s considering the tool really does make a huge difference in how it will fare.</p>
<p>From my perspective, the most successful SA tool vendors have made answering  the &#8220;who should adopt the tool&#8221; question more difficult as they&#8217;ve waffled on licensing models. By the seat? By the core? By the KLoC? I&#8217;ve gotten complaints from prospective tool buyers indicating that a leading tool vendor&#8217;s price was 10X another vendor&#8217;s. Before you ask &#8220;Which one?&#8221;: I&#8217;ve heard specific examples in opposite directions! </p>
<p>Certain tools will look better to different potential buyers. Experience has shown positive response to Coverity&#8217;s C/C++ results from developers. Application security groups like Fortify and Ounce&#8217;s products, and several years ago, I saw QA Managers in two very different firms go ga-ga over Klockwork&#8217;s tool. I attribute people&#8217;s impressions not to a product vendor focusing on quality or security but to how closely the tool vendor&#8217;s conception of how roles interface with their tools throughout the vulnerability management and software development life cycles matches the organization&#8217;s own structure. Up until a few years ago I don&#8217;t believe SA vendors had fully conceived the &#8220;developer&#8221;, &#8220;analyst&#8221;, &#8220;security manager&#8221; roles in their products. Ounce was the one exception: they&#8217;ve always staunchly believed themselves to be principally a Security Analyst&#8217;s tool. Some vendors attempted to unify roles into use of a single interface while others attempted to split the product up into different configurations for each. This created confusion and friction between some adopting organizations and the tool vendor&#8217;s license model.</p>
<p>In the end you want SA tools to affect as many developers as possible and to get low-latency scan results as early in software&#8217;s life cycle as possible. However, having successfully deployed tools a variety of ways, I&#8217;m convinced central deployment is the way to go.  Application Security should run the tool. This will help manage rule/configuration update, as well as central measurement collection, risk management, and issue tracking. How do we get low-latency and early-lifecycle centrally? Treat the tool as a service. More on that later.</p>
<p>Notable exceptions to the central deployment model include business units possessing one or more of the following characteristics: </p>
<ul>
<li>Acquisitions of previously successful, culturally-independent companies</li>
<li>High-quality product development teams</li>
<li>Fundamentally different SDL, development platform, language, and toolkits</li>
</ul>
<p>For in-unit deployment one can &#8220;run locally&#8221; but must &#8220;report centrally&#8221; supporting security goals involving measurement and risk management. And, let&#8217;s be clear: if a business unit has a wicked-good continuous integration/build-management group, they-by all means-should be tapped to integrate with the SA service. Cigital and its clients have had success in integrating both the front (code submission) and back-end (bug/issue tracking) with Fortify and a variety of open source build/CI/bug-tracking products.  This maintains a central model, but reduces latency dramatically.</p>
<p><strong>[How Much Effort]</strong><br />
I&#8217;m sorely disappointed in the honesty of tool vendor sales-folk regarding level of effort. One of my first analogies for SA tools is this: Did your company buy Mercury products for load and performance testing? Think of your SA tool like Mercury&#8211;you&#8217;ll need at least as much money to deploy and implement the tool organization-wide as the licenses cost you. Sorry.</p>
<p>Organizations with more than 2-300 developers should plan on the following:</p>
<ul>
<li>3-4 man weeks to do initial tuning and pilot implementation</li>
<li>4-16 man hours / large application to integrate with the static analysis tool and assure appropriate configuration</li>
<li>4-8 man hours / 50-100KLoC (language-/complexity-dependent) to triage results on a new-application scan</li>
<li>1 person / year as tool shepherd (app integration, custom-rule creation, rule-pack maintenance and release, support)</li>
</ul>
<p>Organizations get into trouble when their SA tool enjoys broad acceptance by the organization before they effectively manage the submission and results triage/documentation process. My data indicates code submission can burn 8-24mhrs / application if security groups don&#8217;t &#8216;remember&#8217; (or automate) the submission and scan setup process. Security groups doing scans centrally and hand-writing code review results can waste another 16hrs documenting their findings / application. </p>
<p>&#8230;think about it: if your organization allots a week / tool-assisted code review and wastes 24 hours getting the tool&#8217;s first result set and 16hrs documenting findings&#8230; that only left 10 hrs to actually review the code! Since I believe that 4-8 hrs / 50-100KLoC is necessary to triage, you can imagine how deep I think such code reviews are <img src='http://www.cigital.com/justice-league-blog/wp-includes/images/smilies/icon_razz.gif' alt=':-P' class='wp-smiley' />  At Cigital, we&#8217;ve got dramatic benefits to depth by decreasing cost of submission and reporting. This is key to scaling SA efforts. Those adopting tools will feel overwhelmed if they don&#8217;t plan to solve submission and reporting problems before wider roll-out.</p>
<p><strong>[How Often]</strong><br />
As often as possible. If you&#8217;ve got a Continuous Integration initiative (CI), engage those folk. If you deploy your tool purely centrally, plan to scan each high-risk application at least once / release. No, to my knowledge, there isn&#8217;t a good answer to the &#8220;can these tools do incremental (partial) scans&#8221;. You should always keep old results around though, as they&#8217;ll (along with other measures) help you understand whether more or less vulnerabilities are being caught during each scan. Remember though, every time you add a rule to the scan, your vulnerability-finding bar just moved and your metrics might be thrown off.</p>
<p>Ounce, Fortify, and Klocwork seem pretty good about determining whether or not they&#8217;ve found a particular issue in a previous scan or not. This includes situations where code blocks move around a bit. This means that running regression scans to determine whether or not an issue has been fixed is viable. I can&#8217;t comment on Coverity&#8217;s capabilities here. </p>
<p><strong>[What's it going to find]</strong><br />
I&#8217;m impressed that Fortify has published its <a href="http://www.fortify.com/vulncat/en/vulncat/index.html">vulnerability taxonomy</a> and a bit shocked that others haven&#8217;t produced as public a resource. I&#8217;m excited too that vendors have agreed to comply with <a href="http://cwe.mitre.org/">CWE</a> labels when they report findings. I will say what I always do on this topic though: test the tool on your own code though. You simply don&#8217;t know what it will find until you throw all your idiosyncratic build, language, toolkit, and platform nonsense at the particular tool you&#8217;ve selected.  </p>
<p><strong>[What won't it find]</strong><br />
I&#8217;m continually shocked as to how much one can find by running tool Y after tool X on the same piece of code (replace X and Y as you see fit). As I&#8217;ve written time-and-time-again, the corner cases and exceptions missed by each engine are baffling. Let me put things in perspective for you: three of my clients have reported that their SA tool deployment find 17, 33, and 50% of the total number of issues found by assessment efforts respectively. If these percentages hold for your organization, inside a coding bug realm then your job is at best 50% done having run the tool and triaged its results. </p>
<p>Considering that Microsoft and Cigital believe that &#8220;bugs&#8221; account for only 50% of the vulnerability space, that leaves you unaware of 75% of your application&#8217;s vulnerability at the end of triage. As I always say, &#8220;use the tool to facilitate code review and increase a reviewer&#8217;s understanding of the code&#8211;not as a code reviewer that finds bugs automatically.&#8221;</p>
<p>Good luck out there, I&#8217;d love to hear about your particular experiences.<br />
-jOHN</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cigital.com/justice-league-blog/2009/02/19/gartner-and-static-analysis/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Confusion between &#8220;Logging and Debug&#8221;</title>
		<link>http://www.cigital.com/justice-league-blog/2007/11/08/confusion-between-logging-and-debug/</link>
		<comments>http://www.cigital.com/justice-league-blog/2007/11/08/confusion-between-logging-and-debug/#comments</comments>
		<pubDate>Thu, 08 Nov 2007 16:40:58 +0000</pubDate>
		<dc:creator>jOHN</dc:creator>
				<category><![CDATA[Defects, Bugs, and Flaws]]></category>
		<category><![CDATA[Software Security]]></category>

		<guid isPermaLink="false">http://www.cigital.com/justiceleague/2007/11/08/confusion-between-logging-and-debug/</guid>
		<description><![CDATA[I was talking with one of my consultants the other day about a common confusion Developers sometimes have regarding a pretty mundane piece of security guidance. Specifically, &#8220;What does it mean I have to turn off logging/debug in production?&#8221; In my mind, these two separate issues exist here, intertwined. Almost every logging framework has an [...]]]></description>
			<content:encoded><![CDATA[<p>I was talking with one of my consultants the other day about a common confusion Developers sometimes have regarding a pretty mundane piece of security guidance. Specifically, &#8220;What does it mean I have to turn off logging/debug in production?&#8221;</p>
<p>In my mind, these two separate issues exist here, intertwined.</p>
<p>Almost every logging framework has an in-place configuration option for increasing/decreasing log-level; most allow you to reconfigure on a running system without restart. The point here being that an application developer, with use of such a package, get to 1) keep a single code base, 2) turn a high level of logging off by default in a production environment, and 3) ratchet up log-level in circumstances requiring it (incident response or in-place debugging).</p>
<p>Often, people mix the above guidance with &#8220;don&#8217;t roll debug code out to production.&#8221; Code Analysis tools, for instance, give this advice. Two things principally concern me here. First, you don&#8217;t want a bunch of &#8220;main&#8221; or other &#8220;debug-only&#8221; entry points to the code. Attackers capable of compromising host systems could shoe-horn their way into an application this way. The situation becomes worse when said debug interfaces are web-based. Second, especially for thick clients or code running in less trusted environments, debug code tends to &#8216;express&#8217; things about the design (or leak critical data) in an undisciplined manner. Removing such code from deployments to untrusted zones CAN be advisable, but one must balance complete removal with the need to &#8216;turn on&#8217; nascent debug code in times of need as described by the previous paragraph. Only protection of the most sensitive information, and most invasive code qualifies for the extreme guidance &#8220;remove before deploying&#8221; that this paragraph describes.</p>
<p>The best thing one can do is give the developer guidance as to what types of test/debug code might qualify for wholesale removal. I&#8217;ll start you a list:</p>
<ol>
<li>Client &#8216;harness&#8217; code allowed to connect to server interfaces w/o<br />
authentication</li>
<li>Client code allowed to edit/manipulate local data repositories/stores<br />
directly</li>
<li>Command &#8216;harnesses&#8217;, allowed to (re)set or manipulate server state</li>
<li>Client code that dumps secret keys, tokens, or stored-but-otherwise-protected credentials</li>
<li>Backdoors</li>
<li>Code allowing for &#8216;insecure failure&#8217; or back off, say to an older protocol</li>
<li>&#8216;Re-implementation&#8217; outside a sandbox (native equivalents of a managed binary)</li>
</ol>
<p>Just a small tidbit, away from the glib towards concrete guidance.</p>
<p>-jOHN</p>
<p>[tags]logging,debugging[/tags] </p>
]]></content:encoded>
			<wfw:commentRss>http://www.cigital.com/justice-league-blog/2007/11/08/confusion-between-logging-and-debug/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sharing architecture ideas with the community</title>
		<link>http://www.cigital.com/justice-league-blog/2007/08/31/sharing-architecture-ideas-with-the-community/</link>
		<comments>http://www.cigital.com/justice-league-blog/2007/08/31/sharing-architecture-ideas-with-the-community/#comments</comments>
		<pubDate>Fri, 31 Aug 2007 19:26:54 +0000</pubDate>
		<dc:creator>justiceadmin</dc:creator>
				<category><![CDATA[Assurance]]></category>
		<category><![CDATA[Defects, Bugs, and Flaws]]></category>
		<category><![CDATA[Enterprise Software Security]]></category>
		<category><![CDATA[Software Quality]]></category>
		<category><![CDATA[Software Security Touchpoints]]></category>

		<guid isPermaLink="false">http://www.cigital.com/justiceleague/2007/08/31/sharing-architecture-ideas-with-the-community/</guid>
		<description><![CDATA[We’re pleased to have a guest blogger for this Justice League entry. Michael Cohen is a Senior Security Consultant at Cigital where he is responsible for leading, assessing, architecting and implementing secure software for Fortune 500 companies. Michael also works with Cigital teams on enterprise-wide security solutions intended to improve an organization&#8217;s security posture and [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>We’re pleased to have a guest blogger for this Justice League entry.  Michael Cohen is a Senior Security Consultant at Cigital where he is responsible for leading, assessing, architecting and implementing secure software for Fortune 500 companies. Michael also works with Cigital teams on enterprise-wide security solutions intended to improve an organization&#8217;s security posture and help them meet audit and regulatory requirements.  Michael just gave a talk to the Washington, DC <a href="http://www.iasahome.org/">IASA chapter</a> that was well received, and is now the subject of this entry:</p></blockquote>
<p>When I hear software architects talk about the architecture they’ve crafted to depict the various structures and behaviors of a system, they point out interesting techniques they’ve applied that best convey how the system should work and be put together. An architect’s enthusiasm for the little details reveals a great sense of accomplishment and creativity, but most of all good architecture conveys sorely needed information in order to help those who develop, test and maintain the system. Sharing the tips and tricks gathered from the field is what helps our community move forward to building better software. A classic example of this is the <a href="http://www.amazon.com/Design-Patterns-Object-Oriented-Addison-Wesley-Professional/dp/0201633612"><em>Design Patterns</em></a> book written by the Gang of Four. </p>
<p>Not too long ago I was also sharing my ideas on architecture and security at a local IASA chapter here in Washington, DC.  The group was a crowd of like-minded architects who work for large Fortune 500 companies, government agencies, and promising local startups. My topic was pragmatic secure architecture.  The basic idea was to look at some real ways to incorporate security into architecture using Cigital’s risk management and threat modeling practices. You can find the <a href="http://www.cigital.com/presentations/pragmatic/">slides for my presentation here</a>.</p>
<p>For the uninitiated, threat modeling is a way of depicting where threats (think malicious people, attackers, and so on) can touch a software architecture and how they may be able to exploit critical assets using various attack patterns.  Threat modeling is valuable for determining an architecture’s security posture. In addition, identifying risks in user requirements and business goals, and tying those risks to a threat model results in a map of how design flaws impact the system, its users and the overall business. Threat models coupled with identified high-level risks are a great way to get other stakeholders involved with security decisions.  And mind you, these are stakeholders who would otherwise be unable to contribute and supply critical feedback. </p>
<p>The attendees at the chapter meeting were glad they attended the presentation and heard something worthwhile that they could use in their daily architectural activities.  Many people brought up interesting points about how to best protect critical assets, what a real risk to a system is, and what is considered a good enough mitigation. What I found particularly interesting was how threat modeling provided a way for everyone to contribute interesting ideas about where security vulnerabilities may exist and how they could be mitigated (which, if you think about it, is the entire point of threat models).  </p>
<p>I encourage any architect to share their ideas on building a better architecture with their peers, whether it be at a local organization or at a conference. As a senior security consultant at Cigital, I like to take shared ideas and mold them into my own unique way of thinking about the world.   The best results come when I can apply new ideas to my daily activities as I help our customers assess and create more secure software. </p>
<p>… On an entirely separate note, McGraw still owes me money. I’m watching you, Gary.<br />
[tags]software architecture,software quality,software security,touchpoints[/tags] </p>
]]></content:encoded>
			<wfw:commentRss>http://www.cigital.com/justice-league-blog/2007/08/31/sharing-architecture-ideas-with-the-community/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Busting the SQL Stored Procedure Myth</title>
		<link>http://www.cigital.com/justice-league-blog/2007/03/15/busting-the-sql-stored-procedure-myth/</link>
		<comments>http://www.cigital.com/justice-league-blog/2007/03/15/busting-the-sql-stored-procedure-myth/#comments</comments>
		<pubDate>Thu, 15 Mar 2007 18:20:22 +0000</pubDate>
		<dc:creator>scott</dc:creator>
				<category><![CDATA[Defects, Bugs, and Flaws]]></category>

		<guid isPermaLink="false">http://www.cigital.com/justiceleague/2007/03/15/busting-the-sql-stored-procedure-myth/</guid>
		<description><![CDATA[One of the commonly proposed remedies for SQL Injection is to use SQL stored procedures. Use of stored procedures can greatly reduce the likelihood that you&#8217;ll code an SQL injection, but it&#8217;s not the stored procedure-ness that&#8217;s saving you. Stored procedures let you use Static-SQL instead of forcing you to always use Dynamic-SQL. In Static-SQL [...]]]></description>
			<content:encoded><![CDATA[<p>One of the commonly proposed remedies for SQL Injection is to use SQL stored procedures.  Use of stored procedures can greatly reduce the likelihood that you&#8217;ll code an SQL injection, but it&#8217;s not the stored procedure-ness that&#8217;s saving you.  Stored procedures let you use Static-SQL instead of forcing you to always use Dynamic-SQL.  In Static-SQL the metadata for the query is known at compile-time whereas in Dynamic-SQL the program constructs the query at runtime.  Dynamic-SQL is injectable; Static-SQL is not.</p>
<p>For most programs, Static-SQL is sufficient.  Only a small subset of features such as user driven filtering interfaces need Dynamic-SQL&#8217;s flexibility. Unfortunately, the common database access protocols, ODBC and JDBC, are based on Dynamic-SQL and there&#8217;s no provision in the interface for static queries.  It&#8217;s into this void that SQL stored procedures stepped in.</p>
<p>But SQL stored procedures aren&#8217;t limited to Static-SQL.  It&#8217;s possible to use Dynamic-SQL through the PREPARE, EXECUTE and EXECUTE IMMEDIATE statements (these are the ANSI SQL-92 statement names, your RDBMS have different names).  In fact, ODBC and JDBC are just wrappers that ship the SQL text from your program to the database server and make calls to the RDBMS through the runtime support for these Dynamic-SQL statements (actually).  So, stored procedures that execute Dynamic-SQL statements are equally vulnerable to SQL injection. It doesn&#8217;t matter if it&#8217;s Java code concatenating strings and passing them to JDBC or if the strings are concatenated in PL/SQL.  Both are equally vulnerable.</p>
<p>By now you&#8217;re probably wondering why I&#8217;m splitting this hair.  I&#8217;m splitting it because I want to ensure that we protect ourselves from the programmer we&#8217;ve not yet met.  It&#8217;s the programmer that goes and dutifully reads our coding guideline that says &#8220;Use SQL stored procedures to prevent SQL Injection&#8221; and now has to extend our application with the feature that introduces Dynamic-SQL.  But, because we haven&#8217;t properly articulated the guidance, s/he creates an SQL injection vulnerability.</p>
<p>Implementing your queries using Static-SQL will go a long way to protect your application from SQL Injection.  It&#8217;s also possible to simulate Static-SQL using ODBC/JDBC type interfaces with the religious use of SQL parameter markers.  This leaves the use of Dynamic-SQL only for truly dynamic queries like the dynamic user-defined filter I mentioned above.  There&#8217;s a pattern for securely implementing such a filter that&#8217;s floating around in my head.  I need to write that down, but you&#8217;ll have to wait until next month.  Sorry.</p>
<p>[tags]sql,defects,flaws[/tags] </p>
]]></content:encoded>
			<wfw:commentRss>http://www.cigital.com/justice-league-blog/2007/03/15/busting-the-sql-stored-procedure-myth/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

