<?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-3674683519924049928</id><updated>2012-02-20T22:19:31.792+01:00</updated><category term='Developer Outreach'/><category term='manifesto'/><category term='HSTS'/><category term='csrf'/><category term='Twitter'/><category term='2011'/><category term='iframe'/><category term='Comparison'/><category term='IT'/><category term='Software complexity'/><category term='paperware'/><category term='Summit'/><category term='Security'/><category term='Trustwave'/><category term='Attitude'/><category term='application security'/><category term='Static Analysis'/><category term='Summary'/><category term='Sweden'/><category term='2012'/><category term='OWASP'/><category term='case-sensitive'/><category term='stateful'/><category term='Chrome'/><category term='Mozilla'/><category term='input validation'/><category term='session id'/><category term='Certificates'/><category term='Mac OS X'/><category term='stateless'/><category term='SSL'/><category term='code'/><category term='letters'/><category term='HFS'/><category term='strict-transport-security'/><category term='Independence'/><category term='Klout'/><category term='Minefield'/><category term='REST'/><category term='retweets'/><category term='Java'/><category term='Challenge'/><category term='file system'/><category term='Defenders'/><category term='Firefox 4'/><category term='Builders'/><category term='Bias'/><category term='Developers'/><category term='Unicode'/><category term='Firefox'/><category term='jobs'/><category term='Board'/><category term='cross-site request forgery'/><category term='Civilization IV'/><category term='session'/><category term='Client-Oriented'/><category term='double submit'/><category term='JavaScript'/><category term='Struts 2'/><title type='text'>Apps and Security</title><subtitle type='html'>Application security is mostly about applications. Then comes security.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://appsandsecurity.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3674683519924049928/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://appsandsecurity.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>John Wilander</name><uri>http://www.blogger.com/profile/12586406716617551079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_tONVxa3WGQM/SoKElzN1hhI/AAAAAAAAAOo/6w0r1s-2Y1s/S220/090626-346-ed-sk.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>23</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3674683519924049928.post-4687256462862473706</id><published>2012-02-18T18:20:00.005+01:00</published><updated>2012-02-20T22:19:31.796+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSL'/><category scheme='http://www.blogger.com/atom/ns#' term='Mozilla'/><category scheme='http://www.blogger.com/atom/ns#' term='Trustwave'/><category scheme='http://www.blogger.com/atom/ns#' term='Certificates'/><category scheme='http://www.blogger.com/atom/ns#' term='Firefox'/><title type='text'>We Need a Free Browser, Not Just an Open Source Browser</title><content type='html'>The security community was chocked when &lt;a href="http://blog.spiderlabs.com/2012/02/clarifying-the-trustwave-ca-policy-update.html" target="_blank"&gt;Trustwave came clean&lt;/a&gt; and revoked a subordinate root certificate it had sold to a third party which explicitly said it would use it to introspect SSL traffic.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;The news of Trustwave's severe malpractice sparked demands for removing the Trustwave root certificates from the Mozilla trust stores (Firefox, Thunderbird, SeaMonkey). The demand was &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=724929" target="_blank"&gt;filed as a bug in Bugzilla&lt;/a&gt;&amp;nbsp;and the issue has also gotten a fair amount of attention on the &lt;a href="https://lists.mozilla.org/listinfo/dev-security-policy" target="_blank"&gt;Mozilla-dev-security-policy mailing list&lt;/a&gt;.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;We experienced the same process – Bugzilla + mailing list outbursts – during the recent DigiNotar and Comodo scandals.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"&gt;Kill or Not to Kill, That's the Question&lt;/span&gt;&lt;br /&gt;According to Trustwave they had to sell the man-in-the-middle certificate since other CAs do it. That in itself is extremely worrying. These bastards who've been charging us $$$ for maintaining trust on the Internet. They've not only been negligent in their security operations but also done business selling out the trust built in by all browsers.&lt;br /&gt;&lt;br /&gt;So, should Mozilla kill the Trustwave root because of their misconduct? Tricky question.&lt;br /&gt;&lt;br /&gt;On the one hand I feel Trustwave's CA business deserves nothing less than the ditch. They did the wrong thing with open eyes.&lt;br /&gt;&lt;br /&gt;On the other hand we probably have a large scale problem at our hand – CAs worldwide have been issuing subCA certs that allow employers, governments, and agencies to intercept the traffic we all thought was authenticated, encrypted, and integrity checked. Killing the Trustwave root doesn't fix that.&lt;br /&gt;&lt;br /&gt;Think about it. The whole trust model crumbles. Can customers now claim someone else must have manipulated their buy order for the stock that later plummeted? Can payment providers who leak credit cards now claim somebody must have MItMed them? Will the increase in online shopping continue once mainstream media understands and writes about this issue?&lt;br /&gt;&lt;br /&gt;Whichever path we take it has to lead to reestablished trust in the CA model. The alternatives such as building on DNSSEC or Moxie's excellent &lt;a href="http://convergence.io/" target="_blank"&gt;Convergence&lt;/a&gt; are nowhere near mainstream roll-out.&lt;br /&gt;&lt;br /&gt;But you know what? Democracy and openness seem to work. Mozilla has made the right decision.&lt;br /&gt;&lt;br /&gt;CAs world-wide have until April 27 to come clean. Mozilla says &lt;a href="http://blog.mozilla.com/security/2012/02/17/message-to-certificate-authorities-about-subordinate-cas/" target="_blank"&gt;the following&lt;/a&gt; on its security blog:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;"Earlier today we sent an email to all certificate authorities in the Mozilla root program to clarify our expectations around certificate issuance. In particular, we made it clear that the issuance of subordinate CA certificates for the purposes of SSL man-in-the-middle interception or traffic management is unacceptable. We made it clear that this practice remains unacceptable even when the intended deployment of such a certificate is restricted to a closed network.&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;In addition to this clarification, we have made several requests. We have requested that any such certificates be revoked, and their HSMs destroyed. We have requested the serial numbers of those certificates and fingerprints of their signing roots so that we, and other relying parties, can detect and distrust these subCA certificates if encountered. We have requested that any CAs who have issued subCA certificates fulfill these requests no later than April 27, 2012."&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;Where else did you see such a clear message to the CAs who have abused our trust? Mozilla makes me proud.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"&gt;We Need a Free Browser, Not Only an Open Source Browser&lt;/span&gt;&lt;/div&gt;&lt;div&gt;The handling of Comodo, DigiNotar and Trustwave tells me we truly need Mozilla and Firefox. Nowhere else in the web community have I seen such openness, freedom of speech, and focus on regular users' interests. Hey, even internet trolls get their say on the mailing list :).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Sure, I love my Chrome, I know Google is a high-paying partner to Mozilla, and I know Firefox has been lagging behind in performance and developer tools. But there's something really great and important in a free alternative.&lt;br /&gt;&lt;br /&gt;Speaking of lagging behind ...&amp;nbsp;JavaScript performance and Chrome's V8 have been industry standard for a few years. But when I run the SunSpider 0.9.1 benchmark on my new MacBook Air I get:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;Chrome&lt;/b&gt; v17.0.963.56: &lt;b&gt;280.8 ms&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;b&gt;Firefox&lt;/b&gt; v10.0.2: &lt;b&gt;233.0 ms&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;Therefore I would like to urge the Mozilla Foundation to get us tab sandboxing and silent auto-upgrades in Firefox so I can go all-in!&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;We need a free browser, not just an open source browser.&lt;/b&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3674683519924049928-4687256462862473706?l=appsandsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://appsandsecurity.blogspot.com/feeds/4687256462862473706/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://appsandsecurity.blogspot.com/2012/02/we-need-free-browser-not-just-open.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3674683519924049928/posts/default/4687256462862473706'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3674683519924049928/posts/default/4687256462862473706'/><link rel='alternate' type='text/html' href='http://appsandsecurity.blogspot.com/2012/02/we-need-free-browser-not-just-open.html' title='We Need a Free Browser, Not Just an Open Source Browser'/><author><name>John Wilander</name><uri>http://www.blogger.com/profile/12586406716617551079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_tONVxa3WGQM/SoKElzN1hhI/AAAAAAAAAOo/6w0r1s-2Y1s/S220/090626-346-ed-sk.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3674683519924049928.post-1248481719252559991</id><published>2012-01-06T17:09:00.005+01:00</published><updated>2012-01-06T17:15:09.730+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='stateless'/><category scheme='http://www.blogger.com/atom/ns#' term='csrf'/><category scheme='http://www.blogger.com/atom/ns#' term='application security'/><category scheme='http://www.blogger.com/atom/ns#' term='REST'/><category scheme='http://www.blogger.com/atom/ns#' term='double submit'/><category scheme='http://www.blogger.com/atom/ns#' term='cross-site request forgery'/><title type='text'>Stateless CSRF Protection</title><content type='html'>In the era of RESTful services and rich internet applications it's important to find security solutions that don't impose unnecessary state or computation on servers. I previously wrote a post on &lt;a href="http://appsandsecurity.blogspot.com/2011/04/rest-and-stateless-session-ids.html"&gt;stateless session ids&lt;/a&gt;. Let's have a look at how we can protect against cross-site request forgeries (CSRF) without server-side state.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"&gt;&lt;b&gt;CSRF Basics&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;Forged requests are nasty attacks. They rely on the fact that your browser automatically adds cookies to HTTP requests if it has cookies associated with the target domain and path. That includes session cookies.&lt;br /&gt;&lt;br /&gt;Let's say you're currently authenticated to twitter.com. If you visit another site on another domain that site can issue requests to twitter.com and your Twitter session cookie will be added to those requests.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-g5KN7XG2nDE/TwcaplSiRYI/AAAAAAAAAl4/zlnEOm-ZbEM/s1600/csrf.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="191" src="http://4.bp.blogspot.com/-g5KN7XG2nDE/TwcaplSiRYI/AAAAAAAAAl4/zlnEOm-ZbEM/s400/csrf.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;How can domain B issue requests to domain A, formally doing a cross-site HTTP request? Well, there are some obvious cases – images, JavaScript, and CSS.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;lt;img src="whatever.domain.org/path/logo.png" /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;… is allowed from any site, which means a malicious site can contain tags like …&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;lt;img src=”https://secure.bank.com/checkAccounts" height=0 width=0 /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Such a tag will issue an HTTP GET to secure.bank.com/checkAccounts including the victim's session cookie for *.bank.com should he or she be logged in. The browser doesn't know if there's an image on that URL or not. It just fires the request. And by setting the image size to 0x0 the victim will see nothing.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"&gt;&lt;b&gt;CSRF With POST&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;Most sensitive stuff require an HTTP POST since a GET &lt;i&gt;should&lt;/i&gt; be idempotent and not change any state server-side. So can a malicious page issue an HTTP POST to any domain? Yes.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-oMvbdJlvSkU/Twca2AFN0dI/AAAAAAAAAmA/bc-UQkOd99o/s1600/csrf-post.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="186" src="http://4.bp.blogspot.com/-oMvbdJlvSkU/Twca2AFN0dI/AAAAAAAAAmA/bc-UQkOd99o/s400/csrf-post.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;The CSRF code from the image above (&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;$&lt;/span&gt; is jQuery):&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;lt;form id="target" method="POST"   action="https://1-liner.org/form"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;input type="text" value="I hate OWASP!" name="oneLiner"/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;lt;input type="submit"  value="POST"/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; $(document).ready(function() {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;$('#target').submit();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; });&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"&gt;&lt;b&gt;CSRF Against RESTful Services&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;But maybe you've left HTML forms behind and go with rich clients, a RESTful backend and communication via JSON? Can a malicious page issue an HTTP POST targeting such services? Yes.&lt;br /&gt;&lt;br /&gt;You can change the encoding of HTML forms to text/plain and do some tricks to produce parseable JSON in the request body. Here's an example that I got working with a Java JAXRS backend:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;lt;form id="target" method="POST"  &lt;br /&gt;action="https://vulnerable.1-liner.org: 8444/ws/oneliners"  &lt;br /&gt;style="visibility:hidden"  &lt;b&gt;enctype="text/plain"&lt;/b&gt;&amp;gt;&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;input type="text" &lt;br /&gt;&amp;nbsp; &amp;nbsp;name='{"id": 0, "nickName": "John",&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "oneLiner": "I hate OWASP!", &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "timestamp": "20111006"}//'&lt;br /&gt;&amp;nbsp; &amp;nbsp;value="dummy" /&amp;gt;&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;input type="submit" value="Go" /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt; &amp;lt;&lt;/span&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;/form&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Notice the enctype and that the JSON is in the input name, not the value. The above form produces a request body looking like this:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: 'Courier New', Courier, monospace;"&gt;{"id": 0, "nickName": "John","oneLiner": "I hate OWASP!","timestamp": "20111006"}//=dummy&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;… which is accepted by for instance the Jackson parser.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"&gt;&lt;b&gt;CSRF Protection With Double Submit&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;Traditional anti-CSRF techniques use tokens issued by the server that the client has to post back. The server validates the request by comparing the incoming token with it's copy. But that small word "copy" means server-side state. Not good.&lt;br /&gt;&lt;br /&gt;Double submit is a variation of the token scheme where the client is required to submit the token both as a request parameter and as a cookie.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-ukVC7jdLTrI/Twca9giiQ9I/AAAAAAAAAmI/2fTIQrwnW6s/s1600/double_submit.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="128" src="http://1.bp.blogspot.com/-ukVC7jdLTrI/Twca9giiQ9I/AAAAAAAAAmI/2fTIQrwnW6s/s400/double_submit.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;A malicious page on another domain cannot read the anti-CSRF cookie before its request and thus cannot include it as a request parameter.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-3i1Io6hUgTQ/TwcbENYV0_I/AAAAAAAAAmQ/K1dRk0e7oxE/s1600/double_submit_attacker.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="228" src="http://1.bp.blogspot.com/-3i1Io6hUgTQ/TwcbENYV0_I/AAAAAAAAAmQ/K1dRk0e7oxE/s400/double_submit_attacker.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"&gt;&lt;b&gt;Two Misconceptions About Double Submit&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;There are two common misconceptions about the double submit CSRF protection.&lt;br /&gt;&lt;br /&gt;First, it has been suggested that the session cookie should be used for this purpose. Since you have to use JavaScript to pick up the cookie value and add it as a request parameter the cookie cannot have the HTTPOnly attribute. And you want HTTPOnly on your session cookie to prevent session hijacking via cross-site scripting.&lt;br /&gt;&lt;br /&gt;But &lt;b&gt;you should &lt;i&gt;not&lt;/i&gt; use the session cookie as anti-CSRF cookie&lt;/b&gt;. Instead add a specific anti-CSRF cookie which does not have the HTTPOnly attribute and keep your session cookie protected.&lt;br /&gt;&lt;br /&gt;Second, people have stuck with server-generated, stateful anti-CSRF cookies. But &lt;b&gt;double submit cookies can be generated client-side and don't have to be saved by the server&lt;/b&gt; at all.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"&gt;&lt;b&gt;Stateless CSRF Protection with Double Submit&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;The protective measure of double submit lies in the fact that a malicious site cannot &lt;i&gt;read&lt;/i&gt; the cookie and include it as request parameter. That condition still holds if the cookie is generated by the client and never saved by the server.&lt;br /&gt;&lt;br /&gt;So let the client generate the anti-CSRF value and only &lt;i&gt;compare&lt;/i&gt; and &lt;i&gt;check format&lt;/i&gt; of cookie and request parameter on the server. Ergo, stateless CSRF protection!&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-dnGcVThwMWk/TwcbMBqdlII/AAAAAAAAAmY/9cvYjbc7S-g/s1600/double_submit_client-generated.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="163" src="http://2.bp.blogspot.com/-dnGcVThwMWk/TwcbMBqdlII/AAAAAAAAAmY/9cvYjbc7S-g/s400/double_submit_client-generated.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"&gt;&lt;b&gt;Hardening the Double Submit Protection&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;Double submit protection breaks down if the attacker somehow can read or set the anti-CSRF value. We can harden double submit against malicious reads.&lt;br /&gt;&lt;br /&gt;First of all we make the client &lt;b&gt;change the anti-CSRF value upon every request&lt;/b&gt;. This is typically done by centralizing backend calls to a custom AJAX proxy, possibly inherited.&lt;br /&gt;&lt;br /&gt;Second, we &lt;b&gt;zero the anti-CSRF cookie directly after each backend call&lt;/b&gt;. This will allow for accurate server-side detection of forged requests. &lt;b&gt;A zeroed double submit cookie is a clear signal of either a client-side bug or a forged request&lt;/b&gt;. With zeroed anti-CRSF cookies the attacker has to issue his/her attack to exactly when the cookie is set by the client.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: Arial, Helvetica, sans-serif; font-size: large;"&gt;&lt;b&gt;Drawbacks of Double Submit&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;You typically hear two drawbacks of the double submit protection – it's reliance on JavaScript to add the cookie value as request parameter, and the possibility to read the anti-CSRF cookie via cross-site scripting.&lt;br /&gt;&lt;br /&gt;The issue with JavaScript is diminishing as JavaScript is becoming a requirement for more and more sites anyway.&lt;br /&gt;&lt;br /&gt;The cross-site scripting critique is invalid. If you can script the site you already own all of it and can setup your own AJAX proxy, read any tokens in the DOM etc.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3674683519924049928-1248481719252559991?l=appsandsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://appsandsecurity.blogspot.com/feeds/1248481719252559991/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://appsandsecurity.blogspot.com/2012/01/stateless-csrf-protection.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3674683519924049928/posts/default/1248481719252559991'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3674683519924049928/posts/default/1248481719252559991'/><link rel='alternate' type='text/html' href='http://appsandsecurity.blogspot.com/2012/01/stateless-csrf-protection.html' title='Stateless CSRF Protection'/><author><name>John Wilander</name><uri>http://www.blogger.com/profile/12586406716617551079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_tONVxa3WGQM/SoKElzN1hhI/AAAAAAAAAOo/6w0r1s-2Y1s/S220/090626-346-ed-sk.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-g5KN7XG2nDE/TwcaplSiRYI/AAAAAAAAAl4/zlnEOm-ZbEM/s72-c/csrf.png' height='72' width='72'/><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3674683519924049928.post-3377322617385267475</id><published>2011-12-17T19:38:00.006+01:00</published><updated>2011-12-18T12:21:06.556+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Twitter'/><category scheme='http://www.blogger.com/atom/ns#' term='Klout'/><category scheme='http://www.blogger.com/atom/ns#' term='retweets'/><title type='text'>The Anatomy of a Twitter Storm</title><content type='html'>Hi! I'm &lt;a href="https://twitter.com/johnwilander"&gt;@johnwilander&lt;/a&gt; and yesterday I unwillingly created a Twitter storm.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif; font-size: large;"&gt;#GodIsNotGreat and Twitter Trends&lt;/span&gt;&lt;br /&gt;It was Friday afternoon in Stockholm, Sweden and I came across a tweet with the interesting tag &lt;a href="https://twitter.com/#!/search?q=%23GodIsNotGreat"&gt;#GodIsNotGreat&lt;/a&gt;. Earlier that day I had read about famous atheist and writer Christopher Hitchens passing away but there was something else going on around this tag. In the tag stream I read about christians threatening tweeters using the tag and several claims that Twitter had pulled the tag from the trends list.&lt;br /&gt;&lt;br /&gt;I couldn't find the tag in &lt;i&gt;my&lt;/i&gt; trends list nor in the US or European list. Still, tweets with the tag were pouring in.&amp;nbsp;In the stream I found &lt;a href="https://twitter.com/#!/HillyFoz/status/147640530224951296"&gt;a tweet from @HillyFoz&lt;/a&gt; saying:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;"So Twitter, it's ok for #reasonstobeatyourgirlfriend to trend but you saw fit to put a stop to #GodIsNotGreat ?"&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;Apparently #ReasonsToBeatYourGirlfriend had been a trend. Now that's interesting too.&amp;nbsp;So I wrote &lt;a href="https://twitter.com/#!/johnwilander/status/147658223716012032"&gt;The Tweet&lt;/a&gt; what would become a Twitter storm:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-5o2iSi6bj_I/TuzSHguBamI/AAAAAAAAAlA/iKfnLyWqVaI/s1600/godisnotgreat_the_tweet.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://3.bp.blogspot.com/-5o2iSi6bj_I/TuzSHguBamI/AAAAAAAAAlA/iKfnLyWqVaI/s320/godisnotgreat_the_tweet.png" width="316" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;As you can see in the screenshot, numerous people eventually retweeted this.&lt;br /&gt;&lt;br /&gt;I could see the amplification within a minute. Suddenly around 10 people had retweeted it and new retweets where being reported faster than I could open them on the activity tab.&lt;br /&gt;&lt;br /&gt;At this point I reviewed my tweet and saw that I had claimed something I couldn't back up with a source or a reference. Such things make a about-to-be-PhD blush a little :). Soon enough I started to get complaints. I considered deleting the tweet but decided to let it live on to see what this storm would be like.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif; font-size: large;"&gt;Here Come the Trending Bots&lt;/span&gt;&lt;br /&gt;Time for the first bot to spot me. Apparently I was trending in the UK:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/-e1ItWMxsxa4/TuzVgZA8SJI/AAAAAAAAAlI/1_srG2H0f_8/s1600/godisnotgreat_trending_uk.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="152" src="http://2.bp.blogspot.com/-e1ItWMxsxa4/TuzVgZA8SJI/AAAAAAAAAlI/1_srG2H0f_8/s320/godisnotgreat_trending_uk.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;While the retweets, complaints and comments were pouring in I quickly became a trend in USA and Canada too:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-cdx-Jr5FATM/TuzVwlCU3JI/AAAAAAAAAlQ/cEl9ZUj8Kh8/s1600/godisnotgreat_trending_usa.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="209" src="http://1.bp.blogspot.com/-cdx-Jr5FATM/TuzVwlCU3JI/AAAAAAAAAlQ/cEl9ZUj8Kh8/s320/godisnotgreat_trending_usa.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-31vp9wkMsL0/TuzWYFKkfNI/AAAAAAAAAlY/lgYaqYa9Rx4/s1600/godisnotgreat_trending_in_us_and_canada.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="521" src="http://1.bp.blogspot.com/-31vp9wkMsL0/TuzWYFKkfNI/AAAAAAAAAlY/lgYaqYa9Rx4/s640/godisnotgreat_trending_in_us_and_canada.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;About 30 minutes later the spam bots had caught on and I started getting all kinds of weird stuff. Some of them I couldn't tell if they we're real people or bots. For instance this (not even a reply to my tweet):&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-Z8mL3oU3RvA/TuzXNPnjVPI/AAAAAAAAAlg/Bxx6vVXi5u8/s1600/godisnotgreat_weird_mention.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="110" src="http://4.bp.blogspot.com/-Z8mL3oU3RvA/TuzXNPnjVPI/AAAAAAAAAlg/Bxx6vVXi5u8/s320/godisnotgreat_weird_mention.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;I did not respond :).&lt;br /&gt;&lt;br /&gt;The final bot step was when the &lt;a href="https://twitter.com/#!/favstar50"&gt;@favstar50&lt;/a&gt; bot &lt;a href="https://twitter.com/#!/favstar50/status/147846097019211776"&gt;congratulated me&lt;/a&gt; to my first 50+&amp;nbsp;favorited tweet.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif; font-size: large;"&gt;Trying to Find a Source&lt;/span&gt;&lt;br /&gt;Some of the complaints I got where getting nasty so I thought I might be lucky enough to find a source and patch my earlier tweet. UK online paper &lt;a href="http://www.huffingtonpost.co.uk/2011/12/16/christopher-hitchens-dead_n_1153109.html"&gt;Huffington Post gave me at least half an excuse&lt;/a&gt;&amp;nbsp;as they wrote:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;"The hash tag #GodIsNotGreat also began trending, which was followed by a storm of protests by the religious, many unaware that the hash tag was a tribute to the author's passing.&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;b&gt;Twitter reportedly removed the topic from the trending lists&lt;/b&gt; following threats of violence towards the creators of the hash tag. The irony that Hitchens book, one that makes stark the link between religion and violence, had stirred the religious to then threaten violence was not lost on the twitterati."&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;But my antagonists quickly dismissed Huffington Post as a bad source and also pointed out that they said "reportedly" which I failed to do in my 140 chars. So much for the patchwork.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif; font-size: large;"&gt;The Day After&lt;/span&gt;&lt;br /&gt;When I got up Saturday I checked my email. Well ...&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-16kvm1QTk78/TuzbFGL4iyI/AAAAAAAAAlo/w93DNPXpJsM/s1600/godisnotgreat_gmail_twitter_followers.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="492" src="http://3.bp.blogspot.com/-16kvm1QTk78/TuzbFGL4iyI/AAAAAAAAAlo/w93DNPXpJsM/s640/godisnotgreat_gmail_twitter_followers.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;I had got quite a few new followers. Woot! But I guess&amp;nbsp;most of them will unfollow&amp;nbsp;when I go back to tweetin' about JavaScript and application security. Easy come, easy go, huh? Note the browser tab for Twitter with 19 new notifications that dropped in while I was taking the screenshot.&lt;br /&gt;&lt;br /&gt;I checked my Klout score:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-KsraZxBJFdA/Tuzb-nmYu_I/AAAAAAAAAlw/-eSSt6c8wrI/s1600/godisnotgreat_klout_score_cropped.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="191" src="http://4.bp.blogspot.com/-KsraZxBJFdA/Tuzb-nmYu_I/AAAAAAAAAlw/-eSSt6c8wrI/s400/godisnotgreat_klout_score_cropped.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;It looks like the revenue diagrams Uncle Scrooge has on his wall :).&lt;br /&gt;&lt;br /&gt;Later I found out that Gizmodo had written an article about it – &lt;a href="http://gizmodo.com/5868917/shutup-twitter-isnt-censoring-your-dumb-trends"&gt;Shutup, Twitter Isn't Censoring Your Dumb Trends&lt;/a&gt;. There, in the middle of their bashing was my tweet! Luckily, Gizmodo didn't dig out the source but rather took poor &lt;a href="https://twitter.com/#!/youngmetropoly"&gt;Jessica K&lt;/a&gt;'s commenting retweet as an example. Phew.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif; font-size: large;"&gt;Lessons Learned&lt;/span&gt;&lt;br /&gt;My lessons learned:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;I should probably check the sources of every tweet, not just my tech tweets.&lt;/li&gt;&lt;li&gt;Rumors spread extremely fast on Twitter. As long as the message is interesting, people retweet.&lt;/li&gt;&lt;li&gt;Twitter trends are not&amp;nbsp;based on volume, they're based on derivatives, or speed if you will. If the &lt;i&gt;increase&lt;/i&gt; of the #GodIsNotGreat tag would have been steady it would have still been a trend. But it wasn't.&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/3674683519924049928-3377322617385267475?l=appsandsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://appsandsecurity.blogspot.com/feeds/3377322617385267475/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://appsandsecurity.blogspot.com/2011/12/anatomy-of-twitter-storm.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3674683519924049928/posts/default/3377322617385267475'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3674683519924049928/posts/default/3377322617385267475'/><link rel='alternate' type='text/html' href='http://appsandsecurity.blogspot.com/2011/12/anatomy-of-twitter-storm.html' title='The Anatomy of a Twitter Storm'/><author><name>John Wilander</name><uri>http://www.blogger.com/profile/12586406716617551079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_tONVxa3WGQM/SoKElzN1hhI/AAAAAAAAAOo/6w0r1s-2Y1s/S220/090626-346-ed-sk.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-5o2iSi6bj_I/TuzSHguBamI/AAAAAAAAAlA/iKfnLyWqVaI/s72-c/godisnotgreat_the_tweet.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3674683519924049928.post-707910675520760603</id><published>2011-04-09T18:45:00.008+02:00</published><updated>2011-04-11T22:41:29.098+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='stateless'/><category scheme='http://www.blogger.com/atom/ns#' term='session id'/><category scheme='http://www.blogger.com/atom/ns#' term='REST'/><category scheme='http://www.blogger.com/atom/ns#' term='stateful'/><title type='text'>REST and Stateless Session IDs</title><content type='html'>Nowadays there's a general reluctance to introduce (more) server-side session state because of scalability. And there's specific reluctance to session state in RESTful web services,&amp;nbsp;due to design principles.&lt;br /&gt;&lt;br /&gt;In the stateless requirement of REST we read:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;"The client–server communication is constrained by &lt;b&gt;no client context being stored on the server between requests&lt;/b&gt;. Each request from any client contains all of the information necessary to service the request, and any session state is held in the client. The server can be stateful; this constraint merely requires that server-side state be addressable by URL as a resource."&lt;/i&gt; [&lt;a href="http://en.wikipedia.org/wiki/Representational_State_Transfer"&gt;Wikipedia&lt;/a&gt;]&lt;br /&gt;&lt;br /&gt;This is a tough requirement, especially if we want features such as authentication and sessions.&lt;br /&gt;&lt;br /&gt;So, can we have session ids without server-side session state? Yes.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;The Relation Between Sessions and Authentication&lt;/b&gt;&lt;br /&gt;There's often a tight relationship between authenticating users and holding their sessions. Anonymous sessions are not very sensitive whereas authenticated sessions have to be protected against hijacking, fixation, forging, and replay. Actually, a valid session token authenticates the session, so you're basically authenticating yourself every request. Which leads us to the first stateless session solution ...&lt;br /&gt;&lt;br /&gt;&lt;b&gt;No Sessions =&amp;gt; Authenticate Every Request&lt;/b&gt;&lt;br /&gt;If session ids are in fact authentication tokens we might as well use the mental model of no sessions, instead authenticate each request. The old HTTP Basic Authentication does this by storing your username and password for subsequent requests. But there are more advanced versions such as &lt;a href="http://docs.amazonwebservices.com/AmazonS3/latest/dev/index.html?RESTAuthentication.html"&gt;authentication in Amazon's S3 REST API&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;They use a custom HTTP scheme based on a keyed-HMAC (Hash Message Authentication Code). To authenticate a request, you first concatenate selected elements of the request to form a string. You then use a shared "AWS Secret Access Key" to calculate the HMAC of that string, i.e. you sign the request. Finally, you add this signature as a parameter of the request.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;GET /photos/puppy.jpg HTTP/1.1&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Host: johnsmith.s3.amazonaws.com&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Date: Mon, 26 Mar 2007 19:37:58 +0000&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Authorization: AWS 0PN5J17HBGZHT7JJ3X82:frJIUN8DYpKDtOLCwo//yllqDzg=&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Looking deeper into how this scheme works you find the following spec:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Authorization = "AWS" + " " + AWSAccessKeyId + ":" + Signature;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Signature = Base64( HMAC-SHA1( UTF-8-Encoding-Of( YourSecretAccessKeyID, StringToSign ) ) );&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;StringToSign = HTTP-Verb + "\n" +&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="color: white;"&gt;________&lt;/span&gt;Content-MD5 + "\n" +&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="color: white;"&gt;________&lt;/span&gt;Content-Type + "\n" +&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="color: white;"&gt;________&lt;/span&gt;Date + "\n" +&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="color: white;"&gt;________&lt;/span&gt;CanonicalizedAmzHeaders +&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;&lt;span class="Apple-style-span" style="color: white;"&gt;________&lt;/span&gt;CanonicalizedResource;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Canonicalization of course requires some processing such as converting headers to lower-case and sorting them lexicographically. The date works as a timestamp and narrows the replay window.&lt;br /&gt;&lt;br /&gt;The server then does the same signing with the shared secret associated with the AWSAccessKeyId. So we're switching from server-side session state to more cycles and latency on both client and server.&lt;br /&gt;&lt;br /&gt;Worth noting:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Signed requests are much stronger than mere session ids. Cross-site request forgeries will be mitigated with this scheme.&lt;/li&gt;&lt;li&gt;By authenticating all requests with a shared secret we don't have any time-bound sessions or timeouts. Just fire whenever you want.&lt;/li&gt;&lt;li&gt;The persistent shared secret is much more sensitive than a temporary session id. A cross-site scripting attack will steal the shared secret which is much worse than session hijacking. This means the scheme is less suitable for browsing sessions and more suitable for machine-to-machine communication.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;b&gt;Stateless, Hashed Session ID and Salt&lt;/b&gt;&lt;br /&gt;The server can generate session id cookies by hashing usernames and a random global salt:&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;sessionIdCookie_v1 = username ":" SHA256(username + global salt)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The salt is used for all sessions but only valid for a certain timeframe, say 15 minutes. A new salt is produced every 5 minutes and incoming session ids produced with the previous but still valid salt will be exchanged for a new session id with the fresh salt. That means a session timeout of 15-5=10 minutes.&lt;br /&gt;&lt;br /&gt;If we truly want to go stateless we cannot kill such a session since that would require a server-side table of revoked session ids. So in the stateless case an attacker will have a 15 minute replay window in which he/she will refresh the session and have endless access.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Stateless, Encrypted Session ID&lt;/b&gt;&lt;br /&gt;By just storing a server-side symmetric crypto key we can effectively decrypt incoming session IDs and trust their contents. Imagine a cookie based on:&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;sessionIdCookie_v2 = AES_&lt;a href="http://en.wikipedia.org/wiki/Galois/Counter_Mode"&gt;GCM&lt;/a&gt;(128 bit key, auth tag, username + timestamp)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This means we don't have to store each session ID. Instead we pay the price of decrypting incoming cookies and checking that the timestamp is within a timeframe, say 15 minutes. For all incoming session IDs older than 5 minutes we regenerate a new cookie to effectively run a 15-5=10 minute session timeout window.&lt;br /&gt;&lt;br /&gt;Again, if we want to go stateless we cannot kill such a session since that would require a server-side table of revoked session ids. So an attacker will have a 15 minute replay window in which he/she will refresh the session and have endless access.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;br /&gt;There are three competing parameters to prioritize between:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Server CPU cycles per request&lt;/li&gt;&lt;li&gt;Server-side session state&lt;/li&gt;&lt;li&gt;The replay window&lt;/li&gt;&lt;/ul&gt;The tradeoff between CPU cycles and memory footprint will change with new technologies such as non-blocking IO in node.js. So yesterday's best practice might not be valid today.&lt;br /&gt;&lt;br /&gt;The difference between regular session hijacking and hijacking of stateless session ids is that successful theft of a stateless session id authenticates the attacker even if the victim has logged out. Remember, the server doesn't store the session state. And even if the server would store the boolean &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;isLoggedIn&lt;/span&gt; for each user, an old session id will still be valid if the user logs in again, as long as it hasn't timed out.&lt;br /&gt;&lt;br /&gt;So ask yourselves what your tradeoff between CPU cycles and server-side state is. Then consider the replay+refresh leverage of a successful cross-site scripting attack.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3674683519924049928-707910675520760603?l=appsandsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://appsandsecurity.blogspot.com/feeds/707910675520760603/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://appsandsecurity.blogspot.com/2011/04/rest-and-stateless-session-ids.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3674683519924049928/posts/default/707910675520760603'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3674683519924049928/posts/default/707910675520760603'/><link rel='alternate' type='text/html' href='http://appsandsecurity.blogspot.com/2011/04/rest-and-stateless-session-ids.html' title='REST and Stateless Session IDs'/><author><name>John Wilander</name><uri>http://www.blogger.com/profile/12586406716617551079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_tONVxa3WGQM/SoKElzN1hhI/AAAAAAAAAOo/6w0r1s-2Y1s/S220/090626-346-ed-sk.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3674683519924049928.post-8791137222894341581</id><published>2011-04-08T13:23:00.002+02:00</published><updated>2011-04-08T13:28:13.464+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaScript'/><category scheme='http://www.blogger.com/atom/ns#' term='REST'/><category scheme='http://www.blogger.com/atom/ns#' term='Chrome'/><category scheme='http://www.blogger.com/atom/ns#' term='iframe'/><title type='text'>Friday JavaScript &amp; Web Dev Links</title><content type='html'>I'm summing up some reading tips for JavaScript and web development. Just thought you'd like 'em.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;&lt;b&gt;JavaScript&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Command-Line JavaScript on&amp;nbsp;Rhino&lt;/b&gt;&lt;br /&gt;So you want to write command-line JavaScript on&amp;nbsp;Rhino? Here's how you do it on Mac OS:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Download Rhino 1.7R2: &lt;a href="http://www.mozilla.org/rhino/download.html"&gt;http://www.mozilla.org/rhino/download.html&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Unzip Rhino in for instance Applications/Utilities/Java&lt;/li&gt;&lt;li&gt;Download JLine: &lt;a href="http://jline.sourceforge.net/"&gt;http://jline.sourceforge.net/&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Unzip JLine&amp;nbsp;in for instance Applications/Utilities/Java&lt;/li&gt;&lt;li&gt;Move jline-0.9.94.jar to /Library/Java/Extensions&lt;/li&gt;&lt;li&gt;In a shell: cd /Applications/Utilities/Java/rhino_1_7R2&lt;/li&gt;&lt;li&gt;In the very same shell: java org.mozilla.javascript.tools.shell.Main&lt;/li&gt;&lt;/ol&gt;&lt;div&gt;Code away!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Building Large-Scale jQuery&amp;nbsp;Applications&lt;/b&gt;&lt;/div&gt;&lt;div&gt;A good read on RIA architecture and links to lib and framework choices, not only for jQuery junkies:&lt;/div&gt;&lt;div&gt;&lt;a href="http://addyosmani.com/blog/large-scale-jquery"&gt;http://addyosmani.com/blog/large-scale-jquery&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;b&gt;JavaScript Primitive Types Becoming Objects&lt;/b&gt;&lt;/div&gt;&lt;div&gt;About JavaScript's primitive types and how they become objects when their properties are used:&lt;/div&gt;&lt;div&gt;&lt;a href="http://javascriptweblog.wordpress.com/2010/09/27/the-secret-life-of-javascript-primitives"&gt;http://javascriptweblog.wordpress.com/2010/09/27/the-secret-life-of-javascript-primitives&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Scoping and Hoisting in JavaScript&lt;/b&gt;&lt;/div&gt;&lt;div&gt;If you haven't looked into scoping and variable assignments in JavaScript, read this and improve your programs:&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.adequatelygood.com/2010/2/JavaScript-Scoping-and-Hoisting"&gt;http://www.adequatelygood.com/2010/2/JavaScript-Scoping-and-Hoisting&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;'String'.replace()&lt;/span&gt; Only Replaces First Instance&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;String.prototype.replace&lt;/span&gt;, i.e. &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;'yourString'.replace()&lt;/span&gt;, only replaces the first instance of the regexp. So beware. Twitter made the mistake and got vulnerable because of it. Read about it and a suggested patch:&lt;/div&gt;&lt;div&gt;&lt;a href="http://www.thespanner.co.uk/2010/09/27/string-replace-javascript-bad-design"&gt;http://www.thespanner.co.uk/2010/09/27/string-replace-javascript-bad-design&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Non-Blocking JavaScript Loading (and more) With &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;head.js&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;With Head JS your scripts load like images - completely separated from page rendering, and in parallel!&lt;/div&gt;&lt;div&gt;&lt;a href="http://headjs.com/"&gt;http://headjs.com&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-size: large;"&gt;&lt;b&gt;Web Development&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;RESTful Design, Patterns and Anti-Patterns&lt;/b&gt;&lt;/div&gt;&lt;div&gt;A nice webcast on REST design. For instance brings up the idea of session ids with constant state on the server. But as always, I wonder when the CSRF storm is going to hit all these REST services out there?&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;a href="http://www.parleys.com/parleysserver/indexing/presentation.form?id=1397"&gt;http://www.parleys.com/parleysserver/indexing/presentation.form?id=1397&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-weight: normal;"&gt;&lt;a href="http://www.parleys.com/parleysserver/indexing/presentation.form?id=1397"&gt;&lt;/a&gt;&lt;/span&gt;Chrome Web Dev Extensions&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Google Chrome is becoming many web developers' favorite browser. The bundled developer tools are good. But check out the extensions too, for instance the CSS reloader:&lt;/div&gt;&lt;div&gt;&lt;a href="https://chrome.google.com/extensions/featured/web_dev"&gt;https://chrome.google.com/extensions/featured/web_dev&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;iframe&lt;/span&gt; Loading Techniques and How They Affect Performance&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Want your iframes to stop blocking and allow onLoad to fire earlier? Check these techniques out:&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;a href="http://www.aaronpeters.nl/blog/iframe-loading-techniques-performance"&gt;http://www.aaronpeters.nl/blog/iframe-loading-techniques-performance&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="background-color: #cccccc;"&gt;&lt;span class="Apple-style-span" style="color: #444444;"&gt;Did I miss a good resource or read? Just fire away below.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3674683519924049928-8791137222894341581?l=appsandsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://appsandsecurity.blogspot.com/feeds/8791137222894341581/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://appsandsecurity.blogspot.com/2011/04/friday-javascript-web-dev-links.html#comment-form' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3674683519924049928/posts/default/8791137222894341581'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3674683519924049928/posts/default/8791137222894341581'/><link rel='alternate' type='text/html' href='http://appsandsecurity.blogspot.com/2011/04/friday-javascript-web-dev-links.html' title='Friday JavaScript &amp; Web Dev Links'/><author><name>John Wilander</name><uri>http://www.blogger.com/profile/12586406716617551079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_tONVxa3WGQM/SoKElzN1hhI/AAAAAAAAAOo/6w0r1s-2Y1s/S220/090626-346-ed-sk.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3674683519924049928.post-5418664945588212969</id><published>2011-03-24T10:31:00.000+01:00</published><updated>2011-03-24T10:31:38.748+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Security'/><category scheme='http://www.blogger.com/atom/ns#' term='Firefox 4'/><title type='text'>The new security features in Firefox 4</title><content type='html'>The new security features in Firefox 4.&lt;br /&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; color: black; font-family: Times; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: arial,sans-serif; font-size: 13px;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;li style="margin-left: 15px;"&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; color: black; font-family: Times; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: arial,sans-serif; font-size: 13px;"&gt;&lt;b&gt;Content Security Policy (CSP)&lt;/b&gt;. This is completely new opt-in security innovation and it's among the first to address the Internet&amp;nbsp;plague&amp;nbsp;called cross-site scripting (XSS). Currently Firefox 4 is the only browser supporting CSP but Webkit browsers (Chrome and Safari) are developing their own flavor. The feature lets the developer specify a whitelist of source domains for JavaScript, images, media, and styling. The servers passes on the whitelist policy in a response header and the browser then enforces the policy for all subsequent resource loads when rendering the page. CSP also demands that all JavaScript code be loaded from files and not be inline.&amp;nbsp;Since XSS attack code&amp;nbsp;typically is either from a domain not on the whitelist or inline, the browser will not execute it if CSP is enabled.&amp;nbsp;Coming up with the correct whitelist and moving all your JavaScript to files will be a burden on developers so adoption will take time. Twitter has already deployed a CSP on&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://mobile.twitter.com/" style="color: #2a5db0;" target="_blank"&gt;mobile.twitter.com&lt;/a&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;and will enable it for&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://twitter.com/" style="color: #2a5db0;" target="_blank"&gt;twitter.com&lt;/a&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;after a trial period (&lt;a href="http://engineering.twitter.com/2011/03/improving-browser-security-with-csp.html" style="color: #2a5db0;" target="_blank"&gt;http://engineering.twitter.&lt;wbr&gt;&lt;/wbr&gt;com/2011/03/improving-browser-&lt;wbr&gt;&lt;/wbr&gt;security-with-csp.html&lt;/a&gt;).&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; color: black; font-family: Times; font-size: small; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse; font-family: arial,sans-serif; font-size: 13px;"&gt;&lt;li style="margin-left: 15px;"&gt;&lt;b&gt;HTTP Strict Transport Security (HSTS)&lt;/b&gt;. This is also a policy mechanism. It allows developers to tell browsers that this domain should only be accessed over SSL and the certificate may not cause any browser warnings. The policy is again sent via a response header so you would think it could be included in CSP. But there is a crucial difference. HSTS also specifies a time for how long in the future the browser should enforce it. After all the policy directive is about future requests. So the browser caches the HSTS policy for a whole domain and possibly for its subdomains which is fundamentally different from CSP which applies its policy to each page individually and allows a new policy on every request. PayPal have been one of the main contributors to HSTS and have deployed a policy for some time. HSTS is already supported by Chome and the Firefox plugin NoScript.&lt;/li&gt;&lt;li style="margin-left: 15px;"&gt;&lt;b&gt;X-Frame-Options (XFO)&lt;/b&gt;. Again, a response header security directive, originally a Microsoft innovation. It specifies whether the page should be allowed to be framed by another page or not. As such it's a partial countermeasure for clickjacking. But it really shouldn't be presented as such, rather a non-framing option for developers.&lt;/li&gt;&lt;li style="margin-left: 15px;"&gt;&lt;b&gt;ES5/&lt;span style="font-weight: normal;"&gt;&lt;b&gt;JavaScript&lt;/b&gt;&lt;/span&gt;&amp;nbsp;Strict-Mode&lt;/b&gt;. Another Firefox first. JavaScript, formally named EcmaScript, is evolving and in version 5 there is an opt-in "strict mode" which gets rid of many of the nasty things in earlier versions. Attackers love the old oddities whereas developers hate them. So we can probably look forward to a fairly good adoption rate out there as soon as other browsers implement it (current status&lt;a href="http://kangax.github.com/es5-compat-table" style="color: #2a5db0;" target="_blank"&gt;http://kangax.github.com/es5-&lt;wbr&gt;&lt;/wbr&gt;compat-table&lt;/a&gt;).&lt;/li&gt;&lt;li style="margin-left: 15px;"&gt;&lt;b&gt;Do-Not-Track (DNT)&lt;/b&gt;. This is a privacy feature requested by the US Federal Trade Commission and jointly designed by Stanford Security Lab and Law School. It's an opt-in&amp;nbsp;&lt;i&gt;request&lt;/i&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;header, i e sent by the browser not the server, which specifies that the enduser doesn't want to be tracked. This is of course a major issue for advertise-driven companies such as Google and Facebook who earn money on tracking endusers and serving them in-context ads. Security professionals are arguing that nobody will be able to know if they've been tracked anyway so we'll probably have to wait for large enduser adoption and a public lawsuit on some major company before DNT starts to mean something.&lt;/li&gt;&lt;/span&gt;&lt;/span&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3674683519924049928-5418664945588212969?l=appsandsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://appsandsecurity.blogspot.com/feeds/5418664945588212969/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://appsandsecurity.blogspot.com/2011/03/new-security-features-in-firefox-4.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3674683519924049928/posts/default/5418664945588212969'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3674683519924049928/posts/default/5418664945588212969'/><link rel='alternate' type='text/html' href='http://appsandsecurity.blogspot.com/2011/03/new-security-features-in-firefox-4.html' title='The new security features in Firefox 4'/><author><name>John Wilander</name><uri>http://www.blogger.com/profile/12586406716617551079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_tONVxa3WGQM/SoKElzN1hhI/AAAAAAAAAOo/6w0r1s-2Y1s/S220/090626-346-ed-sk.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3674683519924049928.post-3188065152852907560</id><published>2011-03-21T18:17:00.002+01:00</published><updated>2011-03-21T18:22:37.587+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='application security'/><category scheme='http://www.blogger.com/atom/ns#' term='Software complexity'/><title type='text'>The 5 Complexity Dimensions of Software</title><content type='html'>I've used this image on countless occasions in my talks on software and on application security. I got it from an academic research presentation back in 2004 or so.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;The 5 Complexity Dimensions of Software&lt;/b&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="https://lh6.googleusercontent.com/-y-12-tYxu7U/TYeCy6rrP6I/AAAAAAAAAdU/wo1sFBoZoMs/s1600/john_wilander_complexity_in_5_dimensions.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://lh6.googleusercontent.com/-y-12-tYxu7U/TYeCy6rrP6I/AAAAAAAAAdU/wo1sFBoZoMs/s500/john_wilander_complexity_in_5_dimensions.png" width="500" /&gt;&lt;/a&gt;&lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;Complexity in this regard means complex for humans to understand and contribute to.&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;ol&gt;&lt;li&gt;&lt;b&gt;Scale&lt;/b&gt;. The larger the system, the more complex.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Diversity&lt;/b&gt;. The more frameworks, languages, integration techniques, tools, platforms, and design patterns used, the more complex.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Connectivity&lt;/b&gt;. The more connections, the more complex. This relates to &lt;a href="http://en.wikipedia.org/wiki/Coupling_%28computer_programming%29"&gt;coupling&lt;/a&gt;.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Dynamics&lt;/b&gt;. The more number of states or the larger state space, the more complex.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Refinement&lt;/b&gt;. Over time every living piece of software is refined, optimized, and polished. Corner cases are found and handled, and regression test suites grow. Refinement drives complexity.&lt;/li&gt;&lt;/ol&gt;In the context of application security there's always a relation between security and complexity. The more complex a system gets, the higher the risk of security vulnerabilities. Therefore managing application security is partly about managing the five dimensions above.&lt;br /&gt;&lt;br /&gt;Sadly, computer science undergraduates rarely meet or learn about this kind of software complexity. That's why industry is reluctant to hire them. Solving 100 coding assignments comprising 200 lines of code each, just doesn't equal developing a system of 20,000 lines of code.&lt;br /&gt;&lt;br /&gt;Tomorrow I will give a talk on why and how CS undergrads at Linköping University should learn about software complexity.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3674683519924049928-3188065152852907560?l=appsandsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://appsandsecurity.blogspot.com/feeds/3188065152852907560/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://appsandsecurity.blogspot.com/2011/03/5-complexity-dimensions-of-software.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3674683519924049928/posts/default/3188065152852907560'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3674683519924049928/posts/default/3188065152852907560'/><link rel='alternate' type='text/html' href='http://appsandsecurity.blogspot.com/2011/03/5-complexity-dimensions-of-software.html' title='The 5 Complexity Dimensions of Software'/><author><name>John Wilander</name><uri>http://www.blogger.com/profile/12586406716617551079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_tONVxa3WGQM/SoKElzN1hhI/AAAAAAAAAOo/6w0r1s-2Y1s/S220/090626-346-ed-sk.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='https://lh6.googleusercontent.com/-y-12-tYxu7U/TYeCy6rrP6I/AAAAAAAAAdU/wo1sFBoZoMs/s72-c/john_wilander_complexity_in_5_dimensions.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3674683519924049928.post-6752437135147261420</id><published>2011-03-01T01:56:00.004+01:00</published><updated>2011-03-01T03:54:03.889+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Independence'/><category scheme='http://www.blogger.com/atom/ns#' term='Comparison'/><category scheme='http://www.blogger.com/atom/ns#' term='OWASP'/><category scheme='http://www.blogger.com/atom/ns#' term='Bias'/><category scheme='http://www.blogger.com/atom/ns#' term='Static Analysis'/><category scheme='http://www.blogger.com/atom/ns#' term='Builders'/><category scheme='http://www.blogger.com/atom/ns#' term='Defenders'/><category scheme='http://www.blogger.com/atom/ns#' term='Client-Oriented'/><title type='text'>A Client-Oriented OWASP</title><content type='html'>Right now there are tons of thoughts, ideas, and discussions on where OWASP should go. I'm beginning to see an image of a &lt;i&gt;Client-Oriented OWASP&lt;/i&gt; (thanks Dinis, for finding the word). In that image there are great initiatives as well as a few things we have to set straight.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size: large;"&gt;&lt;b&gt;Current New Initiatives&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;A few samples of the thoughts going around: Jeff Williams sent his &lt;a href="http://owasp.blogspot.com/2010/12/owasp-40.html"&gt;OWASP 4.0 email&lt;/a&gt;, I wrote about the &lt;a href="http://appsandsecurity.blogspot.com/2011/02/security-people-vs-developers.html"&gt;gap between appsec and developers&lt;/a&gt;, Mark Curphey wrote about &lt;a href="http://www.curphey.com/2011/02/owasp-has-it-reached-a-tipping-point/"&gt;OWASP reaching a tipping point&lt;/a&gt;, and Michael Coates wrote about &lt;a href="http://michael-coates.blogspot.com/2011/02/vision-for-owasp.html"&gt;a vision for OWASP&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Since then Michael started the &lt;a href="http://www.owasp.org/index.php/Defenders"&gt;Defenders Community&lt;/a&gt; and I started the &lt;a href="http://appsandsecurity.blogspot.com/2011/02/developer-outreach-initiative.html"&gt;Developer Outreach Initiative&lt;/a&gt; which will become the Builders Community shortly.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="font-size: large;"&gt;Client-Oriented Part 1 – Builders and Defenders&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;If you combine the Defenders and Builders initiatives, a new, more client-oriented OWASP emerges. Client-oriented in the sense that we put more effort into understanding and helping the IT industry who builds, operates and maintains web applications. On the less technical side we're doing this already with processes and guides – great!&lt;br /&gt;&lt;br /&gt;But on the more technical side, OWASP needs to mix up the pentesting and appsec tooling with how to defend and how to build secure webapps. And that for me means Builders and Defenders projects but also &lt;b&gt;gearing our conferences and chapters more towards builders and defenders&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;I'm not saying we should cut down on pentesting or scanning tools. I love pentesters and ethical hackers. Heck, I read and retweet your blogs daily. I'm also very interested in static analysis tools, proven by my publications in the area in &lt;a href="http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.13.1979"&gt;2002&lt;/a&gt; and &lt;a href="http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.60.3883"&gt;2005&lt;/a&gt;. I'm just saying we need to address a larger crowd and get more balance into our efforts. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span style="font-size: large;"&gt;Client-Oriented Part 2 – Dealing With Independence&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;i&gt;"Our freedom from commercial pressures allows us to provide unbiased, practical, cost-effective information about application security."&lt;/i&gt; —&lt;a href="http://www.owasp.org/index.php/About_OWASP"&gt;About OWASP&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Independent or unbiased has two parts in my opinion:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;OWASP should be independent in the statements it publishes, all the way from chapters to the board.&lt;/li&gt;&lt;li&gt;OWASP should not avoid certain projects, results, or discussions &lt;i&gt;only&lt;/i&gt; because some individual/corporate member or sponsoring organization will be upset.&lt;/li&gt;&lt;/ol&gt;Right now I think OWASP is doing fine on number one. I hear no bashing nor promoting of brands or vendors except for publicly thanking them for their support. Thank you supporters!&lt;br /&gt;&lt;br /&gt;But number two is worrying me. At AppSec NYC 2008 there was a talk on comparing static analysis tools called "NIST and SAMATE Static Analysis Tool Exposition" (&lt;a href="http://video.google.com/videoplay?docid=-7567012344169452280&amp;amp;hl=en#"&gt;video&lt;/a&gt;). Some well-known brands were in the study. But the speaker refused to show figures for individual tools. There seemed to be a consensus in the community that we should not present anything that could be interpreted as negative for certain vendors, not even if the test setup was made totally transparent. That's a violation of point two above, in my opinion.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;2.5 years have gone and we're still not using our independence to compare and test appsec tools. Why?&lt;/b&gt; John Steven, an OWASP leader with immense experience in static analysis has published &lt;a href="http://www.cigital.com/justiceleague/2011/02/02/if-its-so-hard-why-bother/"&gt;serious obstacles to comparing static analysis tools&lt;/a&gt; but they are all saying "Just don't make &lt;i&gt;your&lt;/i&gt; tool choices based on a &lt;i&gt;general&lt;/i&gt; comparison" which is good advice. We should tell people that. But we still need to start putting appsec tools to the test.&lt;br /&gt;&lt;br /&gt;Creating the Client-Oriented OWASP means we'll have to start doing independent, client-oriented research. And &lt;u&gt;if&lt;/u&gt; OWASP has been implicitly silenced before I will not take it anymore. Here's a list of ideas:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;Commit to Stefano Di Paola's brand &lt;a href="http://www.owasp.org/index.php/OWASP_Myth_Breakers_Project"&gt;new OWASP Myth Breakers Project&lt;/a&gt;&lt;/b&gt;.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Create a &lt;/b&gt;&lt;b&gt;space for customer comments on appsec tools&lt;/b&gt; (free as well as commercial). Something like AppStore reviews, good and bad.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Start to &lt;/b&gt;&lt;b&gt;compare blackbox and whitebox scanning tools&lt;/b&gt;. I suggest we go for a synthesized testbed (i.e. a controlled environment) and invite tool vendors/builders to take part. They get a workday to configure their tools and then we go. The testbed, configurations, and versions will all be published along with due reservations such as John Steven's.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Start to &lt;/b&gt;&lt;b&gt;organize free pentests and design reviews of open platforms&lt;/b&gt;. In the best case we cooperate, in the worst case we make our information public in an ethical way to help clients make the right choices.&lt;/li&gt;&lt;li&gt;&lt;b&gt;Sign the Open Letter to WebAppSec Tool and Services Vendors&lt;/b&gt;: &lt;a href="http://www.owasp.org/index.php/Summit_2011/Open_letter_to_WebAppSec_Tool_and_Services_vendors:_Release_your_schemas_and_allow_automation"&gt;Release Your Schemas and Allow Automation &lt;/a&gt;&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/3674683519924049928-6752437135147261420?l=appsandsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://appsandsecurity.blogspot.com/feeds/6752437135147261420/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://appsandsecurity.blogspot.com/2011/03/client-oriented-owasp.html#comment-form' title='21 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3674683519924049928/posts/default/6752437135147261420'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3674683519924049928/posts/default/6752437135147261420'/><link rel='alternate' type='text/html' href='http://appsandsecurity.blogspot.com/2011/03/client-oriented-owasp.html' title='A Client-Oriented OWASP'/><author><name>John Wilander</name><uri>http://www.blogger.com/profile/12586406716617551079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_tONVxa3WGQM/SoKElzN1hhI/AAAAAAAAAOo/6w0r1s-2Y1s/S220/090626-346-ed-sk.jpg'/></author><thr:total>21</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3674683519924049928.post-3178261166782514390</id><published>2011-02-23T21:08:00.000+01:00</published><updated>2011-02-23T21:08:04.232+01:00</updated><title type='text'>Let's Get the Outreach Started</title><content type='html'>The &lt;a href="https://lists.owasp.org/mailman/listinfo/developer-outreach"&gt;developer outreach mailing&lt;/a&gt; list now has 52 subscribers. And we're starting right now. Here's the plan in which you can join directly.&lt;br /&gt;&lt;br /&gt;Reach out to developers you know or work with, asking what their security itches are. A two week first iteration, so "deadline" is March 10.&amp;nbsp;Whatever you get back you can dump to&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;john.wilander[@]owasp.org&lt;/span&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;and I'll organize it.&amp;nbsp;Please ask developers:&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1. Years in software development:&lt;/div&gt;&lt;div&gt;2. Programming languages most used:&lt;/div&gt;&lt;div&gt;3. What are your software security itches in design &amp;amp; code (not working, too complex, can't find it etc):&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;(And please make sure we don't taint this by asking ninja security guys. ;)&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3674683519924049928-3178261166782514390?l=appsandsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://appsandsecurity.blogspot.com/feeds/3178261166782514390/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://appsandsecurity.blogspot.com/2011/02/lets-get-outreach-started.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3674683519924049928/posts/default/3178261166782514390'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3674683519924049928/posts/default/3178261166782514390'/><link rel='alternate' type='text/html' href='http://appsandsecurity.blogspot.com/2011/02/lets-get-outreach-started.html' title='Let&apos;s Get the Outreach Started'/><author><name>John Wilander</name><uri>http://www.blogger.com/profile/12586406716617551079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_tONVxa3WGQM/SoKElzN1hhI/AAAAAAAAAOo/6w0r1s-2Y1s/S220/090626-346-ed-sk.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3674683519924049928.post-3700888386431012389</id><published>2011-02-22T01:24:00.002+01:00</published><updated>2011-02-22T15:29:05.060+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Developer Outreach'/><category scheme='http://www.blogger.com/atom/ns#' term='OWASP'/><title type='text'>Developer Outreach Initiative</title><content type='html'>Today I sent out an email to hopefully kick start OWASP's developer outreach. Recipients were an interesting mix of developers and appsec experts. If you want to join us just subscribe to the &lt;a href="https://lists.owasp.org/mailman/listinfo/developer-outreach"&gt;Developer Outreach mailing list&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Here's the content of the initial email:&lt;br /&gt;&lt;br /&gt;&lt;div style="font-family: inherit;"&gt;&lt;span style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; color: black; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse;"&gt;&lt;div&gt;&lt;b&gt;The Problem&lt;/b&gt;&lt;/div&gt;&lt;div&gt;The web is developing at great speed and I love it. But when I read that the average website has nearly 13&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;i&gt;serious&lt;/i&gt; vulnerabilities I get sad&amp;nbsp;[1]. It's hindering us from doing more stuff on Internet. Douglas Crockford even suggested we scrap the current HTML5 spec and fix cross-site scripting first [2]. We have a problem.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Developer Outreach&lt;/b&gt;&lt;/div&gt;&lt;div&gt;I'd like to get rid of those 13 vulnerabilities per site and I'm convinced&amp;nbsp;designers and developers of web frameworks and applications are the ones who can make it happen. We just have to get the right things into their toolboxes.&amp;nbsp;This has been called "developer outreach" and currently it's a failure.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Proposed Solution – Security Itches&lt;/b&gt;&lt;/div&gt;&lt;div&gt;My first proposition is this: Instead of pushing coding guidelines and security tools onto developers I think we should start by asking them "What are your security itches?". Whatever we get back will be our starting point. Maybe we'll pick ten itches and publish good solutions.&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; What if they have the *wrong* itches? Well, the goal of the outreach is 1) to find out what developers think, and 2) address their itches to build some well-needed credibility. Before we have credibility we cannot push coding guidelines. And if developers think SSL certs are their primary problem that *is* important.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Proposed Solution – Open Test Data&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Security people tell developers to "do input validation". Input validation is no news to developers. The problem is defining the data model and&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;i&gt;testing&lt;/i&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;the input validation. We can do something important here – building&amp;nbsp;&lt;span style="font-family: &amp;quot;Courier New&amp;quot;,Courier,monospace;"&gt;opentestdata.org&lt;/span&gt;. I own the domain and dream about the following beautiful community effort:&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; You go to the site and can either "submit test data" or "download test data". On the submission page you can anonymously enter&lt;span style="font-size: small;"&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; color: black; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse;"&gt; e.g.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt; a Portuguese postal address, an Indian human name, a Swedish postal/zip code ... or 100 SQL injection strings. The effort is almost zero.&lt;/div&gt;&lt;div&gt;&amp;nbsp;&amp;nbsp; On the download page you choose your format and download in context. "We have European customers so we want European human names, postal addresses, and phone numbers". Developers will love it. And that's where we can start promoting security testing!&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Questions for You&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li style="margin-left: 15px;"&gt;First question – do you like these ideas? Are they the right way forward? Would you like to be part of making it happen?&lt;/li&gt;&lt;li style="margin-left: 15px;"&gt;How should we ask for security itches? And how do we collect answers? Email? Remember we'll probably get one-liners&amp;nbsp;as well as small essays.&lt;/li&gt;&lt;li style="margin-left: 15px;"&gt;How do we get the test data site flying? App and infrastructure? Auditing à la Wikipedia with a couple of dedicated moderators?&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;span style="font-family: inherit; font-size: x-small;"&gt;&lt;span class="Apple-style-span" style="border-collapse: separate; color: black; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;"&gt;&lt;span class="Apple-style-span" style="border-collapse: collapse;"&gt;&lt;div&gt;References:&lt;/div&gt;&lt;div&gt;[1]&amp;nbsp;&lt;a href="https://www.whitehatsec.com/home/assets/WPstats_fall10_10th.pdf" style="color: #2a5db0;" target="_blank"&gt;https://www.whitehatsec.&lt;wbr&gt;&lt;/wbr&gt;com/home/assets/WPstats_&lt;wbr&gt;&lt;/wbr&gt;fall10_10th.pdf&lt;/a&gt;&lt;/div&gt;&lt;div&gt;[2]&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="http://blip.tv/play/g_MngeaxVgI" style="color: #2a5db0;" target="_blank"&gt;http://blip.tv/play/g_&lt;wbr&gt;&lt;/wbr&gt;MngeaxVgI&lt;/a&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;(jump to 20:55)&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;span xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;span xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;ul&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3674683519924049928-3700888386431012389?l=appsandsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://appsandsecurity.blogspot.com/feeds/3700888386431012389/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://appsandsecurity.blogspot.com/2011/02/developer-outreach-initiative.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3674683519924049928/posts/default/3700888386431012389'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3674683519924049928/posts/default/3700888386431012389'/><link rel='alternate' type='text/html' href='http://appsandsecurity.blogspot.com/2011/02/developer-outreach-initiative.html' title='Developer Outreach Initiative'/><author><name>John Wilander</name><uri>http://www.blogger.com/profile/12586406716617551079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_tONVxa3WGQM/SoKElzN1hhI/AAAAAAAAAOo/6w0r1s-2Y1s/S220/090626-346-ed-sk.jpg'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3674683519924049928.post-8910919422705969130</id><published>2011-02-13T21:31:00.000+01:00</published><updated>2011-02-13T21:31:22.777+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Summary'/><category scheme='http://www.blogger.com/atom/ns#' term='Summit'/><category scheme='http://www.blogger.com/atom/ns#' term='OWASP'/><category scheme='http://www.blogger.com/atom/ns#' term='2011'/><category scheme='http://www.blogger.com/atom/ns#' term='2012'/><title type='text'>Fears &amp; Hopes for OWASP</title><content type='html'>As I leave the OWASP Summit 2011 in Portugal several questions and thoughts are tumbling around in my head. Is the Summit format the right way to do productive conferences? Are we becoming a paperware organization? Will the right people run for the board considering all the formalities? Is the appsec community failing because of an attitude problem towards developers?&lt;br /&gt;&lt;br /&gt;I don't like long blog posts so I have split it up. Here's the menu:&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;1.&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;a href="http://appsandsecurity.blogspot.com/2011/02/new-owasp-board-my-10-questions.html"&gt;New OWASP Board – My 10 Questions&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;2.&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;a href="http://appsandsecurity.blogspot.com/2011/02/security-people-vs-developers.html"&gt;Security People vs Developers – Does OWASP Have an Attitude Problem?&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;3.&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;a href="http://appsandsecurity.blogspot.com/2011/02/another-owasp-paperware-project-anyone.html"&gt;OWASP Paperware Project – Will Non-Code Projects Take Over OWASP?&lt;/a&gt;&lt;br /&gt;&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;4.&lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&lt;a href="http://appsandsecurity.blogspot.com/2011/02/owasp-summit-is-right-direction.html"&gt;The Summit Is the Right Direction&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3674683519924049928-8910919422705969130?l=appsandsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://appsandsecurity.blogspot.com/feeds/8910919422705969130/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://appsandsecurity.blogspot.com/2011/02/fears-hopes-for-owasp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3674683519924049928/posts/default/8910919422705969130'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3674683519924049928/posts/default/8910919422705969130'/><link rel='alternate' type='text/html' href='http://appsandsecurity.blogspot.com/2011/02/fears-hopes-for-owasp.html' title='Fears &amp; Hopes for OWASP'/><author><name>John Wilander</name><uri>http://www.blogger.com/profile/12586406716617551079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_tONVxa3WGQM/SoKElzN1hhI/AAAAAAAAAOo/6w0r1s-2Y1s/S220/090626-346-ed-sk.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3674683519924049928.post-3164564202664955557</id><published>2011-02-13T21:28:00.000+01:00</published><updated>2011-02-13T21:28:41.548+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Summit'/><category scheme='http://www.blogger.com/atom/ns#' term='OWASP'/><category scheme='http://www.blogger.com/atom/ns#' term='session'/><title type='text'>The OWASP Summit Is the Right Direction</title><content type='html'>I was on the organizing team for the OWASP Summit 2011. Not as deeply involved as Sarah, Dinis, Lorna, Jason, Deb, Sandra, and Paulo ... but I did organize the four Browser Security sessions.&lt;br /&gt;&lt;br /&gt;I truly believe that the Summit format is the way OWASP conferences should go. We should not try to compete with Black Hat, Defcon, BSides or whatever conference out there. We should do something different, geared towards productivity.&lt;br /&gt;&lt;br /&gt;Below is how I setup the browser security track and my humble suggestion for making a difference:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;1. Prioritize People when Planning&lt;/b&gt;&lt;br /&gt;The success of your session boils down to people. If you're at a workshop and "the guy who has all the answers" is not there the workshop is not going to be productive. So my overall goal was to get the right people there. However, you cannot start by inviting people, you only need to start with it as your top priority.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;2. Build a Draft Agenda&lt;/b&gt;&lt;br /&gt;To be able to successfully invite the right people I had to have a relevant draft agenda. So I spent a weekend watching various webcasts of talks from the people I wanted to invite. From that I built my draft agenda. I basically adopted their agenda and tweaked it with some personal stuff.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;3. Reach Out to Key Players&lt;/b&gt;&lt;br /&gt;Now that you have a draft agenda you can reach out to key players you already know and that are likely to say yes. Ask them what they think of the draft agenda and more importantly, ask if they would consider co-chairing a topic or two. Get their names up there.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;4. Market Your Heroes&lt;/b&gt;&lt;br /&gt;When you have a first couple of key players onboard it's time to get the buzz started. Tweet about it. Blog about it. Talk about it. And make use of the heroes who are already booked.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;5. Reach Out in Waves&lt;/b&gt;&lt;br /&gt;Now you need to get key players onboard that you did not previously know. It's time consuming so I do it in waves. A good weekend with the right inspiration you can hunt down a few more of the people you need to get there, explain the agenda and who else is going. Make use of your network and CC people who might be able to vouch for your workshop. As soon as you get people hooked ask if they want to be involved.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;6. Have Faith&lt;/b&gt;&lt;br /&gt;A lot of the so called key players are very busy. You may have gotten a confirmation four weeks ago but not heard anything since. Just make sure you send them updates every other week anyway. They'll come. Have faith.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;7. Work Onsite&lt;/b&gt;&lt;br /&gt;At the workshop you need to tend to practical stuff. I think I was the only session chair who cleaned all the tables up on stage before my sessions. Fresh blocks of paper, new water glasses, no garbage. Also make sure you have an announcement up on the big screen and walk around reminding people that it's only 10 minutes to you session. Do not underestimate what this kind of lightweight service can do for your session.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3674683519924049928-3164564202664955557?l=appsandsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://appsandsecurity.blogspot.com/feeds/3164564202664955557/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://appsandsecurity.blogspot.com/2011/02/owasp-summit-is-right-direction.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3674683519924049928/posts/default/3164564202664955557'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3674683519924049928/posts/default/3164564202664955557'/><link rel='alternate' type='text/html' href='http://appsandsecurity.blogspot.com/2011/02/owasp-summit-is-right-direction.html' title='The OWASP Summit Is the Right Direction'/><author><name>John Wilander</name><uri>http://www.blogger.com/profile/12586406716617551079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_tONVxa3WGQM/SoKElzN1hhI/AAAAAAAAAOo/6w0r1s-2Y1s/S220/090626-346-ed-sk.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3674683519924049928.post-8304999696194323690</id><published>2011-02-13T21:25:00.000+01:00</published><updated>2011-02-13T21:25:54.303+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OWASP'/><category scheme='http://www.blogger.com/atom/ns#' term='paperware'/><category scheme='http://www.blogger.com/atom/ns#' term='code'/><title type='text'>Another OWASP Paperware Project, Anyone?</title><content type='html'>Summing up the OWASP 2011 Summit I fear OWASP is becoming more and more paperware and less and less software. On the Summit's fixed schedule we had 15&amp;nbsp;technical sessions and 27 non-technical sessions (my interpretation). That's almost two thirds non-tech.&lt;br /&gt;&lt;br /&gt;The only guys I saw actually coding at the summit were people we had invited and that are &lt;i&gt;not&lt;/i&gt; OWASP leaders (Powerpoint slides with code do not qualify as coding).&amp;nbsp;At the same time OWASP is getting desperate about not reaching developers.&lt;br /&gt;&lt;br /&gt;The solution is in my opinion to&lt;b&gt; cut down on paperware, pdfs, Powerpoint presentations, guidelines, and policies&lt;/b&gt;. Developers want code, not Word documents. I tried to bring this up during the OWASP Secure Coding Practice session but failed to convey my view. Who would have thought a coding guide did not contain code?&lt;br /&gt;&lt;br /&gt;If you hand a document to a developer that says "Do canonicalization" you will &lt;i&gt;not&lt;/i&gt; get canonicalization in the application. But if you hand a developer code snippets in a relevant language that show a couple of instances of canonicalization problems and how the solution could look you will get a change.&lt;br /&gt;&lt;br /&gt;So, why do we still have all these guidelines and policies that talk &lt;i&gt;about&lt;/i&gt; code? I believe the reason is that the authors don't know how to program. Guys writing appsec guidelines typically cannot code themselves and developers can smell it a mile away.&lt;br /&gt;&lt;br /&gt;Do you believe OWASP needs to reach developers?&lt;br /&gt;Are you right now working in a word processor rather than an IDE?&lt;br /&gt;Stop!&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Developers believe in other developers and working code. You want to change how they play? Get in their game.&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3674683519924049928-8304999696194323690?l=appsandsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://appsandsecurity.blogspot.com/feeds/8304999696194323690/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://appsandsecurity.blogspot.com/2011/02/another-owasp-paperware-project-anyone.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3674683519924049928/posts/default/8304999696194323690'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3674683519924049928/posts/default/8304999696194323690'/><link rel='alternate' type='text/html' href='http://appsandsecurity.blogspot.com/2011/02/another-owasp-paperware-project-anyone.html' title='Another OWASP Paperware Project, Anyone?'/><author><name>John Wilander</name><uri>http://www.blogger.com/profile/12586406716617551079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_tONVxa3WGQM/SoKElzN1hhI/AAAAAAAAAOo/6w0r1s-2Y1s/S220/090626-346-ed-sk.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3674683519924049928.post-6849618029621293330</id><published>2011-02-13T21:11:00.003+01:00</published><updated>2011-02-13T21:41:51.938+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Developers'/><category scheme='http://www.blogger.com/atom/ns#' term='Security'/><category scheme='http://www.blogger.com/atom/ns#' term='Attitude'/><title type='text'>Security People vs Developers</title><content type='html'>"Developers don't know shit about security". That may very well have been the most retweeted quote from the 2011 OWASP Summit. I heard it from stage firsthand and I wrote the original tweet about it, adding "Well, I got news. You don't know shit about development".&lt;br /&gt;&lt;br /&gt;I truly believe this is one of OWASP's biggest problems. I hear it all over the place – frustrated appsec people claiming that developers and managers are ignorant, lazy, or untrained since they don't prioritize security. But it's we, the appsec people who are ignorant, lazy, and untrained! And that's why we're failing in developer outreach. We keep going to our own conferences, pushing Powerpoint slides, discussing unsexy web 1.5 code, and still think we're on the top of the hill. We're at the bottom, guys!&lt;br /&gt;&lt;br /&gt;I've done surveys with 200+ developers to figure out how security is prioritized. In general, this is the picture:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Software Priorities According to Developers&lt;/b&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Functions and features as specified or envisioned&lt;/li&gt;&lt;li&gt;Performance&lt;/li&gt;&lt;li&gt;Usability&lt;/li&gt;&lt;li&gt;Uptime&lt;/li&gt;&lt;li&gt;Maintainability&lt;/li&gt;&lt;li&gt;Security&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;When I tell appsec people this they typically go "Yeah! See, that's the problem. We should be much higher on that list!" No. No, no, no. We belong at level six and unless we appreciate and understand how security fits in with functions, performance, usability, uptime, and maintainability we will keep being ignored by developers.&lt;br /&gt;&lt;br /&gt;Why? Well, a featureless system is useless. A security feature that hits performance notably is out. A system with poor usability will bring no business so usability is above security. "Uptime, hey that's a security thing!" No. Just because DoS attacks hit your uptime doesn't mean we own the issue. Many things affect uptime such as release and deploy cycles, maintainability, caching, scalability, configuration, and patching (no, not just security patching). Finally, maintainability affects ROI much more than security in the general case. Thus, security == level six.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Appsec friends, let 2011 be the year where you go to training to learn what's important in software and where security fits in the big picture&lt;/b&gt;. Then we won't hear anymore jokes on ignorant developers in 2012. Instead we'll be humble and get things done.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3674683519924049928-6849618029621293330?l=appsandsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://appsandsecurity.blogspot.com/feeds/6849618029621293330/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://appsandsecurity.blogspot.com/2011/02/security-people-vs-developers.html#comment-form' title='17 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3674683519924049928/posts/default/6849618029621293330'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3674683519924049928/posts/default/6849618029621293330'/><link rel='alternate' type='text/html' href='http://appsandsecurity.blogspot.com/2011/02/security-people-vs-developers.html' title='Security People vs Developers'/><author><name>John Wilander</name><uri>http://www.blogger.com/profile/12586406716617551079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_tONVxa3WGQM/SoKElzN1hhI/AAAAAAAAAOo/6w0r1s-2Y1s/S220/090626-346-ed-sk.jpg'/></author><thr:total>17</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3674683519924049928.post-4056303625629317870</id><published>2011-02-13T21:07:00.003+01:00</published><updated>2011-02-14T14:48:31.359+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Summit'/><category scheme='http://www.blogger.com/atom/ns#' term='OWASP'/><category scheme='http://www.blogger.com/atom/ns#' term='Board'/><title type='text'>New OWASP Board – My 10 Questions</title><content type='html'>At the OWASP 2011 Summit I attended some of the sessions on OWASP Bylaws and OWASP Governance. I agree we need to update and define roles and duties but there are more urgent issues.&lt;br /&gt;&lt;br /&gt;Discussing the board is complicated if you're not natively English speaking. Asian, South American, and European OWASPers tend to know English appsec terms but they do not know the nuances in what's being said about governance. This effectively means only &lt;b&gt;English speaking people will define how OWASP should be governed and mainly English speaking people will run for the board&lt;/b&gt;. Today the board consists of 4 Americans, 1 Irish, 1 Portuguese living in London, and 1 Belgian. That is neither representative nor good for OWASP.&lt;br /&gt;&lt;br /&gt;I'd like to see the OWASP board grow more diverse. Therefore I will ask the questions below to the members who run for the board. &lt;b&gt;Note, this is not a requirements list, rather parameters I'd like to see diversity in.&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Which human languages do you speak?&lt;/li&gt;&lt;li&gt;In which parts of the world have you lived at least 3 months?&lt;/li&gt;&lt;li&gt;Have you shipped production code? How long ago?&lt;/li&gt;&lt;li&gt;Please provide a list of web technologies you consider yourself proficient in (markup, styling, scripting, server-side code, server configuration and operational setup ...)&lt;/li&gt;&lt;li&gt;What is your typical appsec role (pentester, trainer, developer, project manager ...)? Are you a consultant, vendor, or do you have an appsec role &lt;i&gt;within&lt;/i&gt; an organization?&lt;/li&gt;&lt;li&gt;Please provide a list of appsec activities you consider yourself proficient in (code auditing, threat modeling, SDLC implementation ...)&lt;/li&gt;&lt;li&gt;Have you run or are you running an OWASP chapter? Which?&lt;/li&gt;&lt;li&gt;Have you run or are you running any OWASP projects? Which?&lt;/li&gt;&lt;li&gt;Do you have a college or university degree? (No requirement, I just want the right mix)&lt;/li&gt;&lt;li&gt;Do you have a postgraduate degree? (I'd like to have at least one on the board)&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;There are no correct or preferred answers to the questions above. I only want to ensure we have people from as many parts of the appsec community as possible. For me that's more important than knowing all the English terms in our bylaws or policies.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3674683519924049928-4056303625629317870?l=appsandsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://appsandsecurity.blogspot.com/feeds/4056303625629317870/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://appsandsecurity.blogspot.com/2011/02/new-owasp-board-my-10-questions.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3674683519924049928/posts/default/4056303625629317870'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3674683519924049928/posts/default/4056303625629317870'/><link rel='alternate' type='text/html' href='http://appsandsecurity.blogspot.com/2011/02/new-owasp-board-my-10-questions.html' title='New OWASP Board – My 10 Questions'/><author><name>John Wilander</name><uri>http://www.blogger.com/profile/12586406716617551079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_tONVxa3WGQM/SoKElzN1hhI/AAAAAAAAAOo/6w0r1s-2Y1s/S220/090626-346-ed-sk.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3674683519924049928.post-6456873212046372767</id><published>2011-01-27T15:25:00.000+01:00</published><updated>2011-01-27T15:25:06.184+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Sweden'/><category scheme='http://www.blogger.com/atom/ns#' term='IT'/><category scheme='http://www.blogger.com/atom/ns#' term='jobs'/><title type='text'>65,000 New Jobs in Sweden 2011</title><content type='html'>Sweden is in a better economic and fiscal shape than most other OECD countries, &lt;a href="http://www.oecd.org/document/34/0,3746,en_2649_34569_46897250_1_1_1_1,00.html"&gt;says OECD&lt;/a&gt;. That situation means labor demand is growing and The Swedish Public Employment Service today announced its predictions for empoyment in 2011.&lt;br /&gt;&lt;br /&gt;"A total of &lt;b&gt;65,000 more are expected to get jobs&lt;/b&gt; during the year and the number of occupations where there is a shortage of labor is increasing steadily. &lt;b&gt;Most difficult for employers to find staff will be in the computer professions&lt;/b&gt;, engineering professions and construction trades because there are too few trained."&lt;br /&gt;&lt;br /&gt;Here's their &lt;a href="http://www.arbetsformedlingen.se/For-arbetssokande/Stod-och-service/Nyheter-Arkiv/Nyheter-for-Arbetssokande/1-27-2011-Nu-okar-chansen-att-hitta-jobb.html"&gt;press release in Swedish&lt;/a&gt;. You can &lt;a href="http://translate.google.se/translate?hl=sv&amp;amp;sl=sv&amp;amp;tl=en&amp;amp;u=http://www.arbetsformedlingen.se/For-arbetssokande/Stod-och-service/Nyheter-Arkiv/Nyheter-for-Arbetssokande/1-27-2011-Nu-okar-chansen-att-hitta-jobb.html"&gt;translate it with Google&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;If you have IT skills – welcome to Sweden!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3674683519924049928-6456873212046372767?l=appsandsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://appsandsecurity.blogspot.com/feeds/6456873212046372767/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://appsandsecurity.blogspot.com/2011/01/65000-new-jobs-in-sweden-2011.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3674683519924049928/posts/default/6456873212046372767'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3674683519924049928/posts/default/6456873212046372767'/><link rel='alternate' type='text/html' href='http://appsandsecurity.blogspot.com/2011/01/65000-new-jobs-in-sweden-2011.html' title='65,000 New Jobs in Sweden 2011'/><author><name>John Wilander</name><uri>http://www.blogger.com/profile/12586406716617551079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_tONVxa3WGQM/SoKElzN1hhI/AAAAAAAAAOo/6w0r1s-2Y1s/S220/090626-346-ed-sk.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3674683519924049928.post-6988546053813404943</id><published>2011-01-26T13:27:00.000+01:00</published><updated>2011-01-26T13:27:38.961+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='JavaScript'/><category scheme='http://www.blogger.com/atom/ns#' term='Summit'/><category scheme='http://www.blogger.com/atom/ns#' term='OWASP'/><category scheme='http://www.blogger.com/atom/ns#' term='Challenge'/><title type='text'>Countdown Challenge for OWASP Summit</title><content type='html'>The official OWASP Summit Challenge is out – a JavaScript fighting arena where your script should show its name more prominently than its competitors. The first round attracted 8 contestants and "dross" scored the first point. Check out all the scripts and the next round of competition: &lt;a href="http://makexorbreak.com/"&gt;http://makeXORbreak.com&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The challenge starts the countdown to one of the most important meetings in application security history. February 8-11 we invite you all to join round-table discussions with industry and research leaders on how to solve XSS and enhance browser security, which appsec metrics work, security of HTML5 and EcmaScript 5 and more. We truly believe that crucial things can happen in a social, productivity-oriented environment. That's why OWASP is going all-in on the Summit.&lt;br /&gt;&lt;br /&gt;Google will be there. Mozilla will be there. Microsoft will be there. Facebook will be there. PayPal will be there. Apache will be there. The world's top appsec companies will be there. The authors of (my) favorite appsec books will be there.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.owasp.org/index.php/OWASP_Summit_2011"&gt;OWASP Summit 2011&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Best thing of all? You are most welcome to join!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3674683519924049928-6988546053813404943?l=appsandsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://appsandsecurity.blogspot.com/feeds/6988546053813404943/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://appsandsecurity.blogspot.com/2011/01/countdown-challenge-for-owasp-summit.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3674683519924049928/posts/default/6988546053813404943'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3674683519924049928/posts/default/6988546053813404943'/><link rel='alternate' type='text/html' href='http://appsandsecurity.blogspot.com/2011/01/countdown-challenge-for-owasp-summit.html' title='Countdown Challenge for OWASP Summit'/><author><name>John Wilander</name><uri>http://www.blogger.com/profile/12586406716617551079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_tONVxa3WGQM/SoKElzN1hhI/AAAAAAAAAOo/6w0r1s-2Y1s/S220/090626-346-ed-sk.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3674683519924049928.post-8992800201210950348</id><published>2011-01-07T01:47:00.005+01:00</published><updated>2011-01-07T01:50:23.099+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Civilization IV'/><category scheme='http://www.blogger.com/atom/ns#' term='file system'/><category scheme='http://www.blogger.com/atom/ns#' term='HFS'/><category scheme='http://www.blogger.com/atom/ns#' term='case-sensitive'/><category scheme='http://www.blogger.com/atom/ns#' term='Mac OS X'/><title type='text'>Running Civ IV on HFS+ Case-Sensitive</title><content type='html'>This post is completely unrelated to application security but since I struggled for two hours not finding my specific solution anywhere I just though I'd post ...&lt;br /&gt;&lt;br /&gt;How I got Civ IV working on my Mac OS X with case-sensitive file system (HFS+ case-sensitive).&lt;br /&gt;&lt;br /&gt;The basic trick is to create a new&amp;nbsp;&lt;i&gt;case-insensitive&lt;/i&gt;&amp;nbsp;disk image using the disk utility tool in /Applications/Utilities. Do it with the following specs (taken from &lt;a href="http://blog.andersonshatch.com/2010/05/13/using-steam-on-mac-with-case-sensitive-drive/"&gt;this blog post&lt;/a&gt;):&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Name: caseinsensitive (or any other lower-case name of your liking)&lt;/li&gt;&lt;li&gt;Size: Custom 30 Gb (it will only use up the space you need anyway)&lt;/li&gt;&lt;li&gt;Format: Mac OS Extended journaled (i e not case-sensitive)&lt;/li&gt;&lt;li&gt;Encryption: None&lt;/li&gt;&lt;li&gt;Partitions: No partition map&lt;/li&gt;&lt;li&gt;Image format: Sparse bundle disk image (this makes sure you only use the space necessary)&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;br /&gt;Now you &lt;i&gt;uninstall&lt;/i&gt; Civ IV from your regular drive (most probably from /Applications) by deleting these folders and files:&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;"Civilization IV Gold" folder which contains the game applications&lt;/li&gt;&lt;li&gt;"home folder\Documents\Civilization IV" folder&lt;/li&gt;&lt;li&gt;"home folder\Documents\Civilization IV Warlords" folder if you have Civ IV Gold Ed.&lt;/li&gt;&lt;li&gt;"home folder\Library\Application Support\Civilization IV" folder&lt;/li&gt;&lt;li&gt;"home folder\Library\Application Support\Civilization IV Warlords" folder&amp;nbsp;if you have Civ IV Gold Ed.&lt;/li&gt;&lt;li&gt;"home folder\Library\Preferences\com.aspyr.civ4.plist" file&lt;/li&gt;&lt;li&gt;"home folder\Library\Preferences\com.aspyr.civ4warlords.plist" file&amp;nbsp;if you have Civ IV Gold Ed.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Then you &lt;i&gt;install&lt;/i&gt; Civ IV from your DVD to the newly created disk image named "caseinsensitive". I additionally created a folder structure on the new disk image using these shell commands (don't know if they're needed):&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;mkdir /Volumes/caseinsensitive/Documents/&lt;/li&gt;&lt;li&gt;mkdir /Volumes/caseinsensitive/Documents/Civilization\ IV&lt;/li&gt;&lt;li&gt;mkdir /Volumes/caseinsensitive/Library&lt;/li&gt;&lt;li&gt;mkdir /Volumes/caseinsensitive/Library/Preferences&lt;/li&gt;&lt;li&gt;mkdir /Volumes/caseinsensitive/Library/Application\ Support&lt;/li&gt;&lt;li&gt;mkdir /Volumes/caseinsensitive/Library/Application\ Support/Civilization\ IV&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;Finally you just start Civ IV from the new disk image. Happy gaming!&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3674683519924049928-8992800201210950348?l=appsandsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://appsandsecurity.blogspot.com/feeds/8992800201210950348/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://appsandsecurity.blogspot.com/2011/01/running-civ-iv-on-hfs-case-sensitive.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3674683519924049928/posts/default/8992800201210950348'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3674683519924049928/posts/default/8992800201210950348'/><link rel='alternate' type='text/html' href='http://appsandsecurity.blogspot.com/2011/01/running-civ-iv-on-hfs-case-sensitive.html' title='Running Civ IV on HFS+ Case-Sensitive'/><author><name>John Wilander</name><uri>http://www.blogger.com/profile/12586406716617551079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_tONVxa3WGQM/SoKElzN1hhI/AAAAAAAAAOo/6w0r1s-2Y1s/S220/090626-346-ed-sk.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3674683519924049928.post-1801650340685142670</id><published>2010-12-13T10:02:00.000+01:00</published><updated>2010-12-13T10:02:16.081+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='input validation'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='letters'/><category scheme='http://www.blogger.com/atom/ns#' term='Unicode'/><title type='text'>Java regexp for Unicode letters</title><content type='html'>Just to get this out there ...&lt;br /&gt;&lt;br /&gt;Java regular expression for matching all Unicode letters:&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Pattern p = Pattern.compile("\\p{L}*");&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3674683519924049928-1801650340685142670?l=appsandsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://appsandsecurity.blogspot.com/feeds/1801650340685142670/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://appsandsecurity.blogspot.com/2010/12/java-regexp-for-unicode-letters.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3674683519924049928/posts/default/1801650340685142670'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3674683519924049928/posts/default/1801650340685142670'/><link rel='alternate' type='text/html' href='http://appsandsecurity.blogspot.com/2010/12/java-regexp-for-unicode-letters.html' title='Java regexp for Unicode letters'/><author><name>John Wilander</name><uri>http://www.blogger.com/profile/12586406716617551079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_tONVxa3WGQM/SoKElzN1hhI/AAAAAAAAAOo/6w0r1s-2Y1s/S220/090626-346-ed-sk.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3674683519924049928.post-7768797871536208573</id><published>2010-11-27T13:15:00.003+01:00</published><updated>2010-11-27T13:23:04.816+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Chrome'/><category scheme='http://www.blogger.com/atom/ns#' term='HSTS'/><category scheme='http://www.blogger.com/atom/ns#' term='Firefox'/><title type='text'>Chrome Behavior Confirmed, FF Checked With HSTS Add-On</title><content type='html'>Both Google and Mozilla have been very responsive in the discussion on HSTS behavior for non-default ports.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;Chrome Behavior Confirmed&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;Adam Langley from Google confirmed that Chrome doesn't enforce HSTS for non-default ports:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;From the write up you appear to be using a non-default HTTP port&lt;/i&gt;&lt;br /&gt;&lt;i&gt;(8080). That doesn't trigger rewriting in Chromium:&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush cpp"&gt;if (scheme == "http" &amp;amp;&amp;amp;&lt;br /&gt;     (request-&amp;gt;url().port().empty() || port == 80) &amp;amp;&amp;amp;&lt;br /&gt;     request-&amp;gt;context()-&amp;gt;transport_security_state() &amp;amp;&amp;amp;&lt;br /&gt;     request-&amp;gt;context()-&amp;gt;transport_security_state()-&amp;gt;IsEnabledForHost(&lt;br /&gt;         &amp;amp;domain_state, request-&amp;gt;url().host())) {&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;i&gt;I understand that the draft may be updated to cover this case in the&lt;/i&gt;&lt;br /&gt;&lt;i&gt;future, in which case the code will also be updated.&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;AGL&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;Firefox Nightly Behavior Checked With HSTS Add-On&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;Daniel Veditz asked me to use Sid Stamm's Firefox add-on for HSTS:&lt;br /&gt;&lt;a href="https://addons.mozilla.org/en-US/firefox/addon/246797/"&gt;https://addons.mozilla.org/en-US/firefox/addon/246797/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I installed it, accessed https://www.paypal.com to see that it showed up in the list which it did. But my site does not show up when I surf to it:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_tONVxa3WGQM/TPD2EKM1V5I/AAAAAAAAAbE/q3FCjgUWFfo/s1600/Minefield_HSTS_Add-On_Paypal_but_not_John.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="277" src="http://4.bp.blogspot.com/_tONVxa3WGQM/TPD2EKM1V5I/AAAAAAAAAbE/q3FCjgUWFfo/s320/Minefield_HSTS_Add-On_Paypal_but_not_John.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;So we're now trying to find out if this is because of any of the following:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Non-default port 8443&lt;/li&gt;&lt;li&gt;Self-signed SSL certificate added as a permanent security exception in Firefox&lt;/li&gt;&lt;li&gt;Domain john.com resolves to 127.0.0.1 on my machine via /etc/hosts&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;br /&gt;Stay tuned :).&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3674683519924049928-7768797871536208573?l=appsandsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://appsandsecurity.blogspot.com/feeds/7768797871536208573/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://appsandsecurity.blogspot.com/2010/11/chrome-behavior-confirmed-ff-checked.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3674683519924049928/posts/default/7768797871536208573'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3674683519924049928/posts/default/7768797871536208573'/><link rel='alternate' type='text/html' href='http://appsandsecurity.blogspot.com/2010/11/chrome-behavior-confirmed-ff-checked.html' title='Chrome Behavior Confirmed, FF Checked With HSTS Add-On'/><author><name>John Wilander</name><uri>http://www.blogger.com/profile/12586406716617551079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_tONVxa3WGQM/SoKElzN1hhI/AAAAAAAAAOo/6w0r1s-2Y1s/S220/090626-346-ed-sk.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_tONVxa3WGQM/TPD2EKM1V5I/AAAAAAAAAbE/q3FCjgUWFfo/s72-c/Minefield_HSTS_Add-On_Paypal_but_not_John.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3674683519924049928.post-7222465409666251404</id><published>2010-11-25T22:20:00.000+01:00</published><updated>2010-11-25T22:20:43.012+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='strict-transport-security'/><category scheme='http://www.blogger.com/atom/ns#' term='Chrome'/><category scheme='http://www.blogger.com/atom/ns#' term='HSTS'/><category scheme='http://www.blogger.com/atom/ns#' term='Firefox'/><title type='text'>Still no HSTS in FF4 nightly or Chrome 7</title><content type='html'>This weekend i blogged about my &lt;a href="http://appsandsecurity.blogspot.com/2010/11/strict-transport-security-in-struts-2.html"&gt;proof-of-concept implementation of Strict-Transport-Security in Struts 2&lt;/a&gt; and the fact that I didn't get the expected behavior in Firefox 4 nightly or Chrome 7, only in Firefox 3.6.12 + NoScript.&lt;br /&gt;&lt;br /&gt;Mozilla have responded and cannot reproduce the problem/bug. So I set up the stuff again and really made sure I did it right.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;The Problem&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;The problem is that the &lt;a href="http://tools.ietf.org/html/draft-hodges-strict-transport-sec-02"&gt;draft specification of HTTP Strict Transport Security&lt;/a&gt; (HSTS) doesn't make clear what should happen for non-default ports, i e 80 for HTTP and 443 for HTTPS.&amp;nbsp;Unclear specs typically lead to undefined and different behavior between implementations.&lt;br /&gt;&lt;br /&gt;For proper security HSTS should always switch from HTTP to HTTPS for HSTS-enabled sites within the max-age time space. After my blog post Andy Steingruebl addressed the issue &lt;a href="http://securityretentive.blogspot.com/2010/11/quick-clarification-on-hsts-http-strict.html"&gt;on his blog&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;My Setup&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;I've set my HSTS max-age to 30 seconds to be sure it won't time out. For each test I do the following:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Make sure the browser at hand fully trusts my self-signed SSL cert for &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;john.com&lt;/span&gt;. In the case of Chrome this means adding the cert to the Mac OS system keychain and activating SSL trust for it. In the case of Firefox it means adding a permanent security exception to the browser.&lt;/li&gt;&lt;li&gt;Load&amp;nbsp;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;http://john.com:8080/struts2/register&lt;/span&gt; to make sure it loads over HTTP.&lt;/li&gt;&lt;li&gt;Load &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;https://john.com:8443/struts2/register&lt;/span&gt; that should set the HSTS max-age to 30 seconds.&lt;/li&gt;&lt;li&gt;Load&amp;nbsp;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;http://john.com:8080/struts2/register&lt;/span&gt; to make sure it switches to HTTPS.&lt;/li&gt;&lt;/ol&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;Still Works in FF 3.6 + NoScript&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;First I confirmed that Firefox 3.6.12 + NoScript still detects my strict-transport-security header and switches from HTTP to HTTPS. Se screenshot below. Sorry for the Swedish error message :), but in essence Firefox has switched to HTTPS without changing the port and my server simply doesn't respond with an HTTPS connection on that port.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_tONVxa3WGQM/TO7OEeCXlEI/AAAAAAAAAa4/AZjENUjxtWc/s1600/Firefox_3_6_12_HSTS_http_8080.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="279" src="http://2.bp.blogspot.com/_tONVxa3WGQM/TO7OEeCXlEI/AAAAAAAAAa4/AZjENUjxtWc/s320/Firefox_3_6_12_HSTS_http_8080.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;Chrome 7 Does Not Switch to HTTPS&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;Performing the four test steps in Chrome 7.0.517.44 does not result in the browser switching to HTTPS. Instead it gladly loads &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;john.com&lt;/span&gt; over HTTP after having got the HSTS header. I tested this both by reloading a tab with the HTTP URL and by opening a new tab and entering the HTTP URL to make sure Chrome's sandboxing and one-process-per-tab was not the cause.&lt;br /&gt;&lt;br /&gt;The screenshots below also show the HSTS header. First the HTTPS load:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/_tONVxa3WGQM/TO7OD1R-JPI/AAAAAAAAAa0/8LZVHeYeSME/s1600/chrome_7_0_517_44_HSTS_https_8443.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="260" src="http://4.bp.blogspot.com/_tONVxa3WGQM/TO7OD1R-JPI/AAAAAAAAAa0/8LZVHeYeSME/s320/chrome_7_0_517_44_HSTS_https_8443.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;... then the HTTP load:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_tONVxa3WGQM/TO7OCR9Tx9I/AAAAAAAAAaw/-o4BZ_NygP0/s1600/chrome_7_0_517_44_HSTS_http_8080.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="260" src="http://2.bp.blogspot.com/_tONVxa3WGQM/TO7OCR9Tx9I/AAAAAAAAAaw/-o4BZ_NygP0/s320/chrome_7_0_517_44_HSTS_http_8080.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Firefox 4.0b8pre (aka Minefield) Does Not Switch to HTTPS&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;The four test steps in the nightly build of Firefox 4 beta does not result in a switch to HTTPS either. See screenshots below.&lt;br /&gt;&lt;br /&gt;First the HTTPS load:&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/_tONVxa3WGQM/TO7OFHkehvI/AAAAAAAAAbA/SJRw_Ay3xeE/s1600/Minefield_4_0_b8_pre_HSTS_https_8443.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="277" src="http://1.bp.blogspot.com/_tONVxa3WGQM/TO7OFHkehvI/AAAAAAAAAbA/SJRw_Ay3xeE/s320/Minefield_4_0_b8_pre_HSTS_https_8443.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;... then the HTTP load:&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_tONVxa3WGQM/TO7OEnrVjuI/AAAAAAAAAa8/PWiKf8GLwbw/s1600/Minefield_4_0_b8_pre_HSTS_http_8080.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="277" src="http://2.bp.blogspot.com/_tONVxa3WGQM/TO7OEnrVjuI/AAAAAAAAAa8/PWiKf8GLwbw/s320/Minefield_4_0_b8_pre_HSTS_http_8080.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;I am always humble in these kind of cases. There might be errors or misunderstandings in my setup. Nevertheless, I think these test should work, at least to make me confident in Chrome's and Firefox's support for HSTS.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3674683519924049928-7222465409666251404?l=appsandsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://appsandsecurity.blogspot.com/feeds/7222465409666251404/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://appsandsecurity.blogspot.com/2010/11/still-no-hsts-in-ff4-nightly-or-chrome.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3674683519924049928/posts/default/7222465409666251404'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3674683519924049928/posts/default/7222465409666251404'/><link rel='alternate' type='text/html' href='http://appsandsecurity.blogspot.com/2010/11/still-no-hsts-in-ff4-nightly-or-chrome.html' title='Still no HSTS in FF4 nightly or Chrome 7'/><author><name>John Wilander</name><uri>http://www.blogger.com/profile/12586406716617551079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_tONVxa3WGQM/SoKElzN1hhI/AAAAAAAAAOo/6w0r1s-2Y1s/S220/090626-346-ed-sk.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_tONVxa3WGQM/TO7OEeCXlEI/AAAAAAAAAa4/AZjENUjxtWc/s72-c/Firefox_3_6_12_HSTS_http_8080.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3674683519924049928.post-4983901164207961339</id><published>2010-11-21T18:55:00.002+01:00</published><updated>2010-11-21T21:39:27.081+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Struts 2'/><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><category scheme='http://www.blogger.com/atom/ns#' term='Minefield'/><category scheme='http://www.blogger.com/atom/ns#' term='strict-transport-security'/><category scheme='http://www.blogger.com/atom/ns#' term='Chrome'/><category scheme='http://www.blogger.com/atom/ns#' term='Firefox'/><title type='text'>Strict-Transport-Security in Struts 2</title><content type='html'>One of the topics of the upcoming &lt;a href="http://www.owasp.org/index.php/Summit_2011"&gt;OWASP Global Summit&lt;/a&gt; is Browser Security and the new security features in the form of optional HTTP headers.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Strict-Transport-Security&lt;/span&gt;, HSTS (&lt;a href="http://www.w3.org/Security/wiki/Strict_Transport_Security"&gt;draft spec&lt;/a&gt;)&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;X-Frame-Options&lt;/span&gt; (&lt;a href="http://blogs.msdn.com/b/ie/archive/2009/01/27/ie8-security-part-vii-clickjacking-defenses.aspx"&gt;announcement from Microsoft&lt;/a&gt;)&lt;/li&gt;&lt;li&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;X-Content-Security-Policy&lt;/span&gt; (&lt;a href="https://developer.mozilla.org/en/Introducing_Content_Security_Policy"&gt;announcement from Mozilla&lt;/a&gt;)&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Is this the path towards enduser security in the era of web applications? Perhaps. Anyway, I did some proof-of-concept implementations to check out how they work and which browsers support them. In this blog post I'll cover the first one ...&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;HTTP Strict-Transport-Security&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;All the details are in the draft specification so I won't spend too much time explaining it here. Basically, it's about a response header like this:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;Strict-Transport-Security: max-age=60; includeSubDomains&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;... where the &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;max-age&lt;/span&gt; is specified in seconds and the &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;includeSubDomains&lt;/span&gt; directive is optional. The header tells the browser to only accept or set up HTTPS connections with that domain for a number of seconds ahead. Further, the browser should not accept any kind of shortcomings of the SSL certificate presented by the server and should not let the user click through.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;Strict-Transport-Security as a Struts 2 Interceptor&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;I implemented this as a Struts 2 interceptor:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;pre class="brush: java"&gt;import com.opensymphony.xwork2.ActionContext;&lt;br /&gt;import com.opensymphony.xwork2.ActionInvocation;&lt;br /&gt;import com.opensymphony.xwork2.interceptor.AbstractInterceptor;&lt;br /&gt;import org.apache.commons.logging.Log;&lt;br /&gt;import org.apache.commons.logging.LogFactory;&lt;br /&gt;import org.apache.struts2.StrutsStatics;&lt;br /&gt;&lt;br /&gt;import javax.servlet.http.HttpServletResponse;&lt;br /&gt;&lt;br /&gt;public class StrictTransportSecurityInterceptor extends AbstractInterceptor {&lt;br /&gt;    private static final Log logger = LogFactory.getLog(StrictTransportSecurityInterceptor.class);&lt;br /&gt;    private static final String HSTS_HEADER = "Strict-Transport-Security";&lt;br /&gt;    private static final String HSTS_VALUE_NAME = "max-age=";&lt;br /&gt;    private static final int HSTS_VALUE_IN_SECONDS = 10;&lt;br /&gt;    private static final String HSTS_VALUE_INCLUDE_SUBDOMAINS = "; includeSubDomains";&lt;br /&gt;&lt;br /&gt;    @Override&lt;br /&gt;    public String intercept(ActionInvocation invocation) throws Exception {&lt;br /&gt;        ActionContext context = invocation.getInvocationContext();&lt;br /&gt;        HttpServletResponse response = (HttpServletResponse) context.get(StrutsStatics.HTTP_RESPONSE);&lt;br /&gt;        String headerValue = HSTS_VALUE_NAME + HSTS_VALUE_IN_SECONDS;&lt;br /&gt;        response.addHeader(HSTS_HEADER, headerValue);&lt;br /&gt;        logger.debug("HSTS interceptor with policy: " + headerValue);&lt;br /&gt;        return invocation.invoke();&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;And the interceptor can be used either directly (in &lt;span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"&gt;struts.xml&lt;/span&gt;):&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;pre class="brush xml"&gt;&amp;lt;package extends="struts-default" name="secureApp"&amp;gt;&lt;br /&gt;  &amp;lt;interceptors&amp;gt;&lt;br /&gt;   &amp;lt;interceptor class="se.johnwilander.secureApp.strutsInterceptors.StrictTransportSecurityInterceptor" name="strictTransportSecurityInterceptor"&amp;gt;&lt;br /&gt;   &amp;lt;/interceptor&amp;gt;&lt;br /&gt;  &amp;lt;/interceptors&amp;gt;&lt;br /&gt;&lt;br /&gt;  &amp;lt;action class="se.johnwilander.secureApp.strutsActions.RegisterAction" name="register"&amp;gt;&lt;br /&gt;    &amp;lt;interceptor-ref name="strictTransportSecurityInterceptor"&amp;gt;&amp;lt;/interceptor-ref&amp;gt;&lt;br /&gt;    &amp;lt;result name="success"&amp;gt;/index.jsp&amp;lt;/result&amp;gt;&lt;br /&gt;  &amp;lt;/action&amp;gt;&lt;br /&gt;&amp;lt;/package&amp;gt;&lt;/pre&gt;&lt;/div&gt;&lt;br /&gt;... or be included in your custom Struts 2 interceptor stack.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;Supported in Chrome 7, FF 3 + NoScript, and forthcoming FF 4&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;HSTS is only supported in Mozilla's and Google's browsers at the moment. But given the amount of attention around SSL problems and session hijacking lately (&lt;a href="http://www.thoughtcrime.org/software/sslstrip/"&gt;SSLStrip&lt;/a&gt;, &lt;a href="http://codebutler.github.com/firesheep/"&gt;Firesheep&lt;/a&gt;) I think Apple, Opera, and Microsoft will follow soon.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;HSTS Draft Spec Doesn't Cover Non-Default Ports&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;When I tested the above interceptor on my local setup I could only get it to work in Firefox + NoScript, not in Chrome or Minefield (Firefox 4 beta). After contacting Mozilla (and Google) they explained that the specification is unclear on what the browser should do with non-default ports such as 8080 and 8443. Here's what Sid Stamm at Mozilla told me:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Hi John,&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;Basically, HSTS is not specified to do anything with non-default ports.&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;With regards to the Minefield implementation,&amp;nbsp;&lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=495115#c57"&gt;https://bugzilla.mozilla.org/show_bug.cgi?id=495115#c57&lt;/a&gt; kind of explains&amp;nbsp;that non-default port handling is not addressed very well in the HSTS&amp;nbsp;specification. &amp;nbsp;Non-standard ports are not changed by the "upgrade"&amp;nbsp;performed by HSTS, but port 80 is changed to 443 (because 80 is default&amp;nbsp;for HTTP and 443 is default for HTTPS).&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;br /&gt;&lt;i&gt;&lt;/i&gt;&lt;i&gt;The main use case that triggered the development of HSTS is that users&amp;nbsp;don't usually type the scheme or port in address bar. &amp;nbsp;My reasoning for&amp;nbsp;implementing it to ignore non-default ports is as follows:&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;i&gt;If a user requests (by typing in address bar, following link or&amp;nbsp;bookmark, etc) a specific port, they should get that port.&lt;/i&gt;&lt;/li&gt;&lt;li&gt;&lt;i&gt;If the user doesn't type a port, they get the default port.&amp;nbsp;In the case where no port _or_ scheme is typed, they currently get&amp;nbsp;http on port 80 (which for HSTS hosts, is "upgraded").&lt;/i&gt;&lt;/li&gt;&lt;li&gt;&lt;i&gt;If the scheme&amp;nbsp;https is entered, HSTS is not needed.&lt;/i&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;i&gt;I hope this helps. Basically, what I'm saying is that the behavior you&amp;nbsp;noticed is intended. If you change the http server port to 80 and the&amp;nbsp;https port to 443, HSTS should work as specified.&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;&lt;/i&gt;This of course makes it a little bit harder to test on your own machine. You'll have to set up some kind of &amp;nbsp;forwarding of port 80 to 8080 and 443 to 8443 so that the browser detects the switch from default https to default http.&lt;br /&gt;&lt;br /&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;b&gt;MItM Attacks Possible By Abusing Non-Default Ports?&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;Making HSTS testing harder on your localhost is a minor problem compared to the possibility of circumventing the whole protection scheme by using non-default ports. Today SSLStrip just changes from default 443 to default 80 when it strips all https links, but it should be perfectly possible to change all those links to 8080 or the like. Client firewalls might refuse the request but I doubt it in the general case.&lt;br /&gt;&lt;br /&gt;I would rather like HSTS to be effective for all port configurations but allow the enduser to configure it under the browser's preferences menu.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3674683519924049928-4983901164207961339?l=appsandsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://appsandsecurity.blogspot.com/feeds/4983901164207961339/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://appsandsecurity.blogspot.com/2010/11/strict-transport-security-in-struts-2.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3674683519924049928/posts/default/4983901164207961339'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3674683519924049928/posts/default/4983901164207961339'/><link rel='alternate' type='text/html' href='http://appsandsecurity.blogspot.com/2010/11/strict-transport-security-in-struts-2.html' title='Strict-Transport-Security in Struts 2'/><author><name>John Wilander</name><uri>http://www.blogger.com/profile/12586406716617551079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_tONVxa3WGQM/SoKElzN1hhI/AAAAAAAAAOo/6w0r1s-2Y1s/S220/090626-346-ed-sk.jpg'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3674683519924049928.post-8458340984063477817</id><published>2010-11-21T16:07:00.001+01:00</published><updated>2010-11-21T16:12:26.348+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='manifesto'/><category scheme='http://www.blogger.com/atom/ns#' term='application security'/><title type='text'>AppSec Manifesto</title><content type='html'>To start this blog off I want to publish my personal AppSec Manifesto.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;AppSec Manifesto&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Developers are not lazy, rather quality oriented ⇒ Insecure applications do not stem from laziness.&lt;/li&gt;&lt;li&gt;Features and functions are always more important than security&amp;nbsp;⇒&amp;nbsp;Security should enable more features and functions.&lt;/li&gt;&lt;li&gt;Responsible disclosure is a good way of achieving more secure applications&amp;nbsp;⇒&amp;nbsp;Hackers are needed.&lt;/li&gt;&lt;li&gt;Technology is a crucial part of security&amp;nbsp;⇒ Therefore I keep coding.&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;br /&gt;This manifesto will most probably evolve along with my future insights.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3674683519924049928-8458340984063477817?l=appsandsecurity.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://appsandsecurity.blogspot.com/feeds/8458340984063477817/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://appsandsecurity.blogspot.com/2010/11/appsec-manifesto.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3674683519924049928/posts/default/8458340984063477817'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3674683519924049928/posts/default/8458340984063477817'/><link rel='alternate' type='text/html' href='http://appsandsecurity.blogspot.com/2010/11/appsec-manifesto.html' title='AppSec Manifesto'/><author><name>John Wilander</name><uri>http://www.blogger.com/profile/12586406716617551079</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://1.bp.blogspot.com/_tONVxa3WGQM/SoKElzN1hhI/AAAAAAAAAOo/6w0r1s-2Y1s/S220/090626-346-ed-sk.jpg'/></author><thr:total>2</thr:total></entry></feed>
