<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.0.5" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Bugs vs. Flaws</title>
	<link>http://taossa.com/index.php/2008/10/13/bugs-vs-flaws/</link>
	<description>Continued ramblings on software security and code auditing</description>
	<pubDate>Fri, 30 Jul 2010 13:29:58 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.5</generator>

	<item>
		<title>by: thanasisk</title>
		<link>http://taossa.com/index.php/2008/10/13/bugs-vs-flaws/#comment-39824</link>
		<pubDate>Sat, 10 Jan 2009 13:35:00 +0000</pubDate>
		<guid>http://taossa.com/index.php/2008/10/13/bugs-vs-flaws/#comment-39824</guid>
					<description>1. One thing that is not mentioned in this conversation is that, the

      significance of implementation vs design varies regarding on the

      actual development platform.

      In the case of software developed in C/C++, an implementation

      error can mean &#226;&#128;&#156;game over&#226;&#128;&#157;. So, essentially, if you are

      pen-testing software written in the aforementioned languages, even

      when you have somewhat deducted that the design holds its own, you

      have to be extra careful about the quality of the implementation

      (and I am not talking strcpy() either  :)  ) Guys who cut their

      teeth auditing software in C/C++ tend to be more focused on the

      implementation side of things.

      In the case of say .Net or Java, implementation errors can still

      spell &#226;&#128;&#156;game over&#226;&#128;&#157; but if you are pen-testing your typical web

      application, chances are you will have found already much more

      severe (and perhaps easier?) design flaws (once again, this is

      from my (limited?) personal experiences so YMMV).</description>
		<content:encoded><![CDATA[<p>1. One thing that is not mentioned in this conversation is that, the</p>
<p>      significance of implementation vs design varies regarding on the</p>
<p>      actual development platform.</p>
<p>      In the case of software developed in C/C++, an implementation</p>
<p>      error can mean &#226;&#8364;&#339;game over&#226;&#8364;. So, essentially, if you are</p>
<p>      pen-testing software written in the aforementioned languages, even</p>
<p>      when you have somewhat deducted that the design holds its own, you</p>
<p>      have to be extra careful about the quality of the implementation</p>
<p>      (and I am not talking strcpy() either  :)  ) Guys who cut their</p>
<p>      teeth auditing software in C/C++ tend to be more focused on the</p>
<p>      implementation side of things.</p>
<p>      In the case of say .Net or Java, implementation errors can still</p>
<p>      spell &#226;&#8364;&#339;game over&#226;&#8364; but if you are pen-testing your typical web</p>
<p>      application, chances are you will have found already much more</p>
<p>      severe (and perhaps easier?) design flaws (once again, this is</p>
<p>      from my (limited?) personal experiences so YMMV).
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: jm</title>
		<link>http://taossa.com/index.php/2008/10/13/bugs-vs-flaws/#comment-34158</link>
		<pubDate>Fri, 17 Oct 2008 04:57:00 +0000</pubDate>
		<guid>http://taossa.com/index.php/2008/10/13/bugs-vs-flaws/#comment-34158</guid>
					<description>Thanks for the thoughtful response Riley.

First, I think it&#8217;s important to take time to understand the design, even in a coarse form. You have to understand what the system you are evaluating does, what systems it talks to, and you have to understand its security policy. Otherwise, you can&#8217;t formulate attacks against it that are meaningful. Implementation bugs in code that are of no consequence are useless.

Critiquing the design, however, is usually not the majority of my personal workload in an application review. This is primarily because I rarely have the mandate to actually change fundamental design beyond making suggestions in a deliverable that are intended for long-term product driection. The exeception is if there is such an exceptionally egregious error that I can advise a third-party client (be it VC or a corporation) that there is a *serious* problem. If I&#8217;m working with a software vendor themselves, then it&#8217;s more an issue of, you guys are in big trouble. Often times, however, they can&#8217;t easily address it barring massive re-architecture.

That said, I didn&#8217;t do a particularly excellent job at explaining my arguments, while at the same time probably mis-characterized McGraw&#8217;s position somewhat. While I do think low-level implementation flaws are very important, one of my main contentions is that &#8220;design&#8221; vs. &#8220;implementation&#8221; itself is a false dichotomy. In essence I think the word &#8220;implementation&#8221; is wrong, as it encapsulates everything from extremely low-level detail (will this allocation cause regular TLB/cache misses or branch prediction pipeline stalls), to the design of expressions (do I use arithmetic or logical shift.. short circuit logic/tertriary operator?), algorithms (doubly linked list or hash table), functions (state machine or recursion ok?), classes (how much inheritence.. do i need polymorphism?), modules(do i expose internal state.. static data or not?), interfaces (how do i signify errors?), thread and synchronization design(consumer/producer, event loops?), and data structures(FIFO/splay tree/RDBMS?). 

You can make security mistakes in *all* of those things, and we aren&#8217;t talking strcpy().

Or conversely, maybe some of these things are under the domain of design and not implementation. The point is that it&#8217;s not clear and fast where to draw the line really. If you look at data flow diagrams specifically, I don&#8217;t believe you see this level of detail, but it depends on the process you use. McGraw&#8217;s process is never explicitly documented in his books beyond a single page PDF, as (I believe) it&#8217;s essentially proprietary work product of Cigital.

That said, there is wisdom in your conclusion. Performing security assessment on a large and complicated system is an incredibly difficult task, especially given the compressed time lines and resources necessitated by the value the market current places on software security. The search space is too vast for any realistic hope of a full and exhaustive search.

Time management is, in essence, the name of the game.

We have different philosophies, and even possibly different mandates, but I think we both strive to deliver the most effective result for the time invested.

I understand McGraw&#8217;s concern about myopic focus on technical attacks, and that is a real risk when time is at a premium. However, at the same time, I think relegating implementation review to the domain of automatic analysis is essentially dangerously reckless optimism. But, it largely depends on where you draw the line.</description>
		<content:encoded><![CDATA[<p>Thanks for the thoughtful response Riley.</p>
<p>First, I think it&#8217;s important to take time to understand the design, even in a coarse form. You have to understand what the system you are evaluating does, what systems it talks to, and you have to understand its security policy. Otherwise, you can&#8217;t formulate attacks against it that are meaningful. Implementation bugs in code that are of no consequence are useless.</p>
<p>Critiquing the design, however, is usually not the majority of my personal workload in an application review. This is primarily because I rarely have the mandate to actually change fundamental design beyond making suggestions in a deliverable that are intended for long-term product driection. The exeception is if there is such an exceptionally egregious error that I can advise a third-party client (be it VC or a corporation) that there is a *serious* problem. If I&#8217;m working with a software vendor themselves, then it&#8217;s more an issue of, you guys are in big trouble. Often times, however, they can&#8217;t easily address it barring massive re-architecture.</p>
<p>That said, I didn&#8217;t do a particularly excellent job at explaining my arguments, while at the same time probably mis-characterized McGraw&#8217;s position somewhat. While I do think low-level implementation flaws are very important, one of my main contentions is that &#8220;design&#8221; vs. &#8220;implementation&#8221; itself is a false dichotomy. In essence I think the word &#8220;implementation&#8221; is wrong, as it encapsulates everything from extremely low-level detail (will this allocation cause regular TLB/cache misses or branch prediction pipeline stalls), to the design of expressions (do I use arithmetic or logical shift.. short circuit logic/tertriary operator?), algorithms (doubly linked list or hash table), functions (state machine or recursion ok?), classes (how much inheritence.. do i need polymorphism?), modules(do i expose internal state.. static data or not?), interfaces (how do i signify errors?), thread and synchronization design(consumer/producer, event loops?), and data structures(FIFO/splay tree/RDBMS?). </p>
<p>You can make security mistakes in *all* of those things, and we aren&#8217;t talking strcpy().</p>
<p>Or conversely, maybe some of these things are under the domain of design and not implementation. The point is that it&#8217;s not clear and fast where to draw the line really. If you look at data flow diagrams specifically, I don&#8217;t believe you see this level of detail, but it depends on the process you use. McGraw&#8217;s process is never explicitly documented in his books beyond a single page PDF, as (I believe) it&#8217;s essentially proprietary work product of Cigital.</p>
<p>That said, there is wisdom in your conclusion. Performing security assessment on a large and complicated system is an incredibly difficult task, especially given the compressed time lines and resources necessitated by the value the market current places on software security. The search space is too vast for any realistic hope of a full and exhaustive search.</p>
<p>Time management is, in essence, the name of the game.</p>
<p>We have different philosophies, and even possibly different mandates, but I think we both strive to deliver the most effective result for the time invested.</p>
<p>I understand McGraw&#8217;s concern about myopic focus on technical attacks, and that is a real risk when time is at a premium. However, at the same time, I think relegating implementation review to the domain of automatic analysis is essentially dangerously reckless optimism. But, it largely depends on where you draw the line.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: are</title>
		<link>http://taossa.com/index.php/2008/10/13/bugs-vs-flaws/#comment-34152</link>
		<pubDate>Thu, 16 Oct 2008 23:16:00 +0000</pubDate>
		<guid>http://taossa.com/index.php/2008/10/13/bugs-vs-flaws/#comment-34152</guid>
					<description>It seems to me that Dr. McGraw is saying that there is a strategic and a tactical component to the art of assessment. The design causes major tectonic motion and the implementation determines the terrain therein. Understanding both is crucial to the impact of an audit. By contrast, John seems to be saying that the implementation is much more important. That doesn&#8217;t seem like a very deep argument, but maybe I can dig the trenches a bit.

Anyone who writes or reads enough code knows that the majority of the future anguish for the coders on a new project will come from failures of design. Since design cost is a counter-value, there is a kind of tensegrity that should yield an appropriate balance of design versus implementation time. Less experienced coders will tend to screw up that balancing act worse than journeymen. Those mistakes will tend to increase the total difficult of the project which is a primary factor in determining the locii of vulnerabilities. Overdone design will tend to rush the schedule and reduce the quality of peer review, which would support a researcher spreading a wide net to find low-hanging fruit. Underdone design will instead tend to give more time to each work item, but also to fail to handle some problems which must then be tackled by the developer. This would reward a researcher who focuses on the grinding gears where they don&#8217;t quite line up.

So from a certain argument, understanding the design issues can provide a clear path for finding the implementation issues. My problem with this perspective is that it aligns the evaluation process too neatly with the development, which tended to stunt my creativity as an analyst. McGraw points at the myopia that might come from focusing too hard on the bottom-up work, but on some level I think John might avoid making some kinds of mistakes that come from sympathy with the design. Instead, he seems to me to be saying, the very strong analyst works in an information space constructed of the *artifacts* of the design and implementation and all the tools used therein.

An artist, I think, might say that one is talking about the positive space (things the code does) and the other the negative space (things the code doesn&#8217;t do). My feeling is that the former is more approachable for novices and the latter is more powerful for initiates. Neither approach can avoid the reality that fully searching the space is untenable.

ObHoglund: Me too.</description>
		<content:encoded><![CDATA[<p>It seems to me that Dr. McGraw is saying that there is a strategic and a tactical component to the art of assessment. The design causes major tectonic motion and the implementation determines the terrain therein. Understanding both is crucial to the impact of an audit. By contrast, John seems to be saying that the implementation is much more important. That doesn&#8217;t seem like a very deep argument, but maybe I can dig the trenches a bit.</p>
<p>Anyone who writes or reads enough code knows that the majority of the future anguish for the coders on a new project will come from failures of design. Since design cost is a counter-value, there is a kind of tensegrity that should yield an appropriate balance of design versus implementation time. Less experienced coders will tend to screw up that balancing act worse than journeymen. Those mistakes will tend to increase the total difficult of the project which is a primary factor in determining the locii of vulnerabilities. Overdone design will tend to rush the schedule and reduce the quality of peer review, which would support a researcher spreading a wide net to find low-hanging fruit. Underdone design will instead tend to give more time to each work item, but also to fail to handle some problems which must then be tackled by the developer. This would reward a researcher who focuses on the grinding gears where they don&#8217;t quite line up.</p>
<p>So from a certain argument, understanding the design issues can provide a clear path for finding the implementation issues. My problem with this perspective is that it aligns the evaluation process too neatly with the development, which tended to stunt my creativity as an analyst. McGraw points at the myopia that might come from focusing too hard on the bottom-up work, but on some level I think John might avoid making some kinds of mistakes that come from sympathy with the design. Instead, he seems to me to be saying, the very strong analyst works in an information space constructed of the *artifacts* of the design and implementation and all the tools used therein.</p>
<p>An artist, I think, might say that one is talking about the positive space (things the code does) and the other the negative space (things the code doesn&#8217;t do). My feeling is that the former is more approachable for novices and the latter is more powerful for initiates. Neither approach can avoid the reality that fully searching the space is untenable.</p>
<p>ObHoglund: Me too.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: jm</title>
		<link>http://taossa.com/index.php/2008/10/13/bugs-vs-flaws/#comment-34054</link>
		<pubDate>Tue, 14 Oct 2008 20:47:00 +0000</pubDate>
		<guid>http://taossa.com/index.php/2008/10/13/bugs-vs-flaws/#comment-34054</guid>
					<description>Gary,

First, I think we agree far more than we disagree. My argument admittedly was all over the map, but here&#8217;s what I&#8217;m getting at:

I like to work from the code up. The code is just a language, and it necessarily explains what the system does. If you work (hard) at developing the skill set for it, you can develop mental models at higher and higher levels of abstraction by working from the bottom up.

Your philosophy, as I interpret it, seems to imply that this is impossible, and that implementation review is a context-agnostic exercise in rote pattern recognition.

I disagree. My preferred approach is obviously very time consuming and it is just one tool in the arsenal of a security practitioner, but I believe it requires a fundamentally different philosophy from the way in which you conceptualize code review.

It&#8217;s more a matter of approach, as we probably would agree to some extent that the essence of both top-tier vulnerability research and application security review is &#8220;understand the system first; find vulnerabilities second.&#8221;

As far as the 50/50 thing, it doesn&#8217;t concur with my experiences reviewing software, but I&#8217;m not sure if it&#8217;s a matter of us having subtly different definitions, confirmation/selection bias, or simply that one of us is wrong. (I hope it&#8217;s you.. I hate being wrong.) Unfortunately, the data in question is probably guarded behind 50 NDAs on either side.

BTW, Exploiting Software is a great book, and I&#8217;ve read it a couple of times, so no need to re-read it. :&#62; (Hell, Hoglund and I ran in the same circles literally a decade ago, and we&#8217;ve both been exploiting software in various capacities for a living full-time since then. The ideas contained within aren&#8217;t exactly foreign to me.)

Anyway, I sentence you to go read a few million lines of code until you start seeing the forest from inside the trees. :&#62;

Cheers,

John</description>
		<content:encoded><![CDATA[<p>Gary,</p>
<p>First, I think we agree far more than we disagree. My argument admittedly was all over the map, but here&#8217;s what I&#8217;m getting at:</p>
<p>I like to work from the code up. The code is just a language, and it necessarily explains what the system does. If you work (hard) at developing the skill set for it, you can develop mental models at higher and higher levels of abstraction by working from the bottom up.</p>
<p>Your philosophy, as I interpret it, seems to imply that this is impossible, and that implementation review is a context-agnostic exercise in rote pattern recognition.</p>
<p>I disagree. My preferred approach is obviously very time consuming and it is just one tool in the arsenal of a security practitioner, but I believe it requires a fundamentally different philosophy from the way in which you conceptualize code review.</p>
<p>It&#8217;s more a matter of approach, as we probably would agree to some extent that the essence of both top-tier vulnerability research and application security review is &#8220;understand the system first; find vulnerabilities second.&#8221;</p>
<p>As far as the 50/50 thing, it doesn&#8217;t concur with my experiences reviewing software, but I&#8217;m not sure if it&#8217;s a matter of us having subtly different definitions, confirmation/selection bias, or simply that one of us is wrong. (I hope it&#8217;s you.. I hate being wrong.) Unfortunately, the data in question is probably guarded behind 50 NDAs on either side.</p>
<p>BTW, Exploiting Software is a great book, and I&#8217;ve read it a couple of times, so no need to re-read it. :&gt; (Hell, Hoglund and I ran in the same circles literally a decade ago, and we&#8217;ve both been exploiting software in various capacities for a living full-time since then. The ideas contained within aren&#8217;t exactly foreign to me.)</p>
<p>Anyway, I sentence you to go read a few million lines of code until you start seeing the forest from inside the trees. :&gt;</p>
<p>Cheers,</p>
<p>John
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: gem</title>
		<link>http://taossa.com/index.php/2008/10/13/bugs-vs-flaws/#comment-34048</link>
		<pubDate>Tue, 14 Oct 2008 18:41:00 +0000</pubDate>
		<guid>http://taossa.com/index.php/2008/10/13/bugs-vs-flaws/#comment-34048</guid>
					<description>huh?

Nice rant, but what exactly are you getting at here?  I like defining an admittedly slippery slope between bugs and flaws precisely because people have been OVEREMPHASIZING the importance of code review and static analysis.  My purpose is to get people&#8217;s faces up out of the code trough and into the design so they can find big picture design problems as well as stupid coding mistakes.  Gotta do both.

The 50/50 thing comes from real data&#8230;both mine (actually at Cigital we used to tend to find more flaws than bugs, but these days the automated code review tools help push the numbers up on the bug end of things) and Mike Howard&#8217;s (yes, the evil empire has been doing this for a while and taking names).

You and I agree that in the end an attacker only needs to find a defect (be it a bug or a flaw) to sploit your ass silly.  I sentence you to go read &#8220;Exploiting Software&#8221; until you either fall asleep or come up with another angle.

gem</description>
		<content:encoded><![CDATA[<p>huh?</p>
<p>Nice rant, but what exactly are you getting at here?  I like defining an admittedly slippery slope between bugs and flaws precisely because people have been OVEREMPHASIZING the importance of code review and static analysis.  My purpose is to get people&#8217;s faces up out of the code trough and into the design so they can find big picture design problems as well as stupid coding mistakes.  Gotta do both.</p>
<p>The 50/50 thing comes from real data&#8230;both mine (actually at Cigital we used to tend to find more flaws than bugs, but these days the automated code review tools help push the numbers up on the bug end of things) and Mike Howard&#8217;s (yes, the evil empire has been doing this for a while and taking names).</p>
<p>You and I agree that in the end an attacker only needs to find a defect (be it a bug or a flaw) to sploit your ass silly.  I sentence you to go read &#8220;Exploiting Software&#8221; until you either fall asleep or come up with another angle.</p>
<p>gem
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: jm</title>
		<link>http://taossa.com/index.php/2008/10/13/bugs-vs-flaws/#comment-34013</link>
		<pubDate>Tue, 14 Oct 2008 01:36:00 +0000</pubDate>
		<guid>http://taossa.com/index.php/2008/10/13/bugs-vs-flaws/#comment-34013</guid>
					<description>lol, yeah, this is what happens when I don&#8217;t have a copy editor. I assure you that this all sounded quite good when I wrote it. At least, it seemed better than saying &#8220;Sorry I haven&#8217;t posted anything in, uhm, wow.. wait, is that the right year?&#8221; My usual system of checks and balances failed me since they were asleep and/or drunk. Jerks.

Also, sorry I missed you last time you were up here. I was out of town, but I&#8217;m also deathly afraid of people. :&#62;</description>
		<content:encoded><![CDATA[<p>lol, yeah, this is what happens when I don&#8217;t have a copy editor. I assure you that this all sounded quite good when I wrote it. At least, it seemed better than saying &#8220;Sorry I haven&#8217;t posted anything in, uhm, wow.. wait, is that the right year?&#8221; My usual system of checks and balances failed me since they were asleep and/or drunk. Jerks.</p>
<p>Also, sorry I missed you last time you were up here. I was out of town, but I&#8217;m also deathly afraid of people. :&gt;
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Jordan</title>
		<link>http://taossa.com/index.php/2008/10/13/bugs-vs-flaws/#comment-34010</link>
		<pubDate>Tue, 14 Oct 2008 00:40:00 +0000</pubDate>
		<guid>http://taossa.com/index.php/2008/10/13/bugs-vs-flaws/#comment-34010</guid>
					<description>That introduction sure is a lot of words to say: &#8220;blogging&#8221; == &#8220;trolling&#8221;.

As for the rest of it, well, I read the words but my thick skull was able to repel the invasion.  

Don&#8217;t get me wrong; often I&#8217;m all for a healthy debate on disclosure practices, static versus dynamic analysis, fuzzing versus The Way Real Men Find Bugs, or any other of the fun things security geeks like to discuss.  

But I just can&#8217;t dredge up the will right now.  Hopefully I can dredge up a few more brain cells and try again later.  So instead I&#8217;ll just stick to my comment on the introduction and mention it was at least a very /funny/ way of equating blogging with trolling.  

Oh yeah &#8212; you had a typo:

s/Visio //g

There, fixed it for you.</description>
		<content:encoded><![CDATA[<p>That introduction sure is a lot of words to say: &#8220;blogging&#8221; == &#8220;trolling&#8221;.</p>
<p>As for the rest of it, well, I read the words but my thick skull was able to repel the invasion.  </p>
<p>Don&#8217;t get me wrong; often I&#8217;m all for a healthy debate on disclosure practices, static versus dynamic analysis, fuzzing versus The Way Real Men Find Bugs, or any other of the fun things security geeks like to discuss.  </p>
<p>But I just can&#8217;t dredge up the will right now.  Hopefully I can dredge up a few more brain cells and try again later.  So instead I&#8217;ll just stick to my comment on the introduction and mention it was at least a very /funny/ way of equating blogging with trolling.  </p>
<p>Oh yeah &#8212; you had a typo:</p>
<p>s/Visio //g</p>
<p>There, fixed it for you.
</p>
]]></content:encoded>
				</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.089 seconds -->
