News for hackers. Stuff that matters.
Re:Break Google by pavpanchekha on Thursday September 15, 2011 @11:45PM (#3003117)
No. Django solves the 90% problem, which is usually a fine approach but will llikely lead to security vulnerabilities down the line.

I'll refer to something I wrote last time I had this argument: http://pavpanchekha.com/programming/injection.html.

Re:Break Google by orclev on Friday September 16, 2011 @11:59AM (#3004968)
Nice article. In response to the last part I can think of a way to achieve the sort of smart escaping via template you talk about using Haskell and Hamlet (among other templating systems used by yesod). I believe, although I can't absolutely confirm that Hamlet already performs context appropriate escaping, based mostly on the type signatures and the names of a few of the functions.
Re:Break Google by gregwebs on Friday September 16, 2011 @05:05PM (#3006309)
Yes, Hamlet does context specific escaping. It will handle all the examples given, except you can't mix your javascript in with your html (which is generally good advice anyways).

I disagree with the articles premise that injection is always a display issue. In the [Yesod web framework](http://www.yesodweb.com) which uses Hamlet, we sanitize, not strip html by default before it is ever put in the database. The more you can make injection not a display issue, the better- you just have to know your options.

Re:Break Google by dmm on Friday September 16, 2011 @10:35AM (#3004567)
You should replace your '<' with '&lt' if you're going to claim your page is xhtml.
Re:Break Google by pavpanchekha on Friday September 16, 2011 @04:44PM (#3006231)
Thanks. Pages are compiled with org-mode, I'll report a bug.
Re:Break Google by dmm on Saturday September 17, 2011 @10:24AM (#3008074)
I love org-mode.
Re:Break Google by AndyKelley on Sunday September 18, 2011 @05:59PM (#3011388)
I don't know what you mean by "90% problem", but unlike what your blog article suggests, Django's template engine escapes everything by default. You have to explicitly pass content through a filter to request that it not be escaped.

Based on the fact that the suggestions in your blog article could easily support someone forgetting the "|escape" on a variable, I would accuse your methodology of only solving the "90% problem".