<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Security</title>
        <link>http://www.mostlylucid.net/category/24.aspx</link>
        <description>Security</description>
        <language>en-US</language>
        <copyright>Scott Galloway</copyright>
        <generator>Subtext Version 2.1.0.5</generator>
        <item>
            <title>SHA-1 has been broken...what's the big deal?</title>
            <link>http://mostlylucid.net/archive/2005/02/16/sha-1-has-been-broken.whats-the-big-deal.aspx</link>
            <description>&lt;a href="http://it.slashdot.org/article.pl?sid=05/02/16/0146218&amp;amp;tid=93&amp;amp;tid=172&amp;amp;tid=218"&gt;Slashdot &lt;/a&gt;recently reported on a post on &lt;a href="http://www.schneier.com/blog/archives/2005/02/sha1_broken.html"&gt;Bruce Schneiers blog &lt;/a&gt;which reports that the SHA-1 hashing algorithm has been ‘broken’ by a team in China (wonder why they were working on it &lt;img src="/uploads/smile3.gif" /&gt;) –  this is a pretty big deal; SHA-1 is the NSA / NIST &lt;a href="http://www.itl.nist.gov/fipspubs/fip180-1.htm"&gt;standard&lt;/a&gt; for hashing algorithms right now – though &lt;a href="http://miladus.typepad.com/etech/2005/02/nist_moving_to_.html"&gt;recently&lt;/a&gt; they announced that they’ll be recommending the stronger SHA-512 and SHA-256 variants (properly called SHA-2 variants) soo, – good timing! For most common applications though where there’s a possibility &lt;a href="http://blogs.msdn.com/shawnfa/archive/2004/03/05/84799.aspx"&gt;collision&lt;/a&gt; after 2^69 (&lt;!--StartFragment --&gt; 590295810358705651712 ) hash operations compared to 2^80 (&lt;!--StartFragment --&gt;1208925819614629174706176) really isn’t that bad then if you’re currently using SHA-1 I wouldn’t do a panic change (though next time you might want to change over to SHA-256 / 512).&lt;br /&gt;To try to clarify what this means, in order to generate the same hash code from two distinct inputs (so you’re comparing one hash against the other)  would mean hashing 590295810358705651712  times rather than 1208925819614629174706176 times with what was previously thought to be the possibility of collision. If you’re betting your life on a hashing function (so for instance you have a document containing the nuclear key codes signed only with a SHA-1 hash) I’d seriously considering moving to a longer one (SHA-256) – if you’re just storing passwords for a Barney fanclub site…I wouldn’t worry especially.  Of course if you’re really paranoid (ooh, the NSA developed SHA!) you’re probably using &lt;a href="http://planeta.terra.com.br/informatica/paulobarreto/WhirlpoolPage.html"&gt;Whirlpool &lt;/a&gt;already!&lt;br /&gt; UPDATE: If you really want to check out some amazing .NET implementations of pretty much every encryption / hashing function on the planet take a look at &lt;a href="http://www.bouncycastle.org/csharp/index.html"&gt;this&lt;/a&gt; , currently has MD2, MD4, MD5, RIPEMD128, RIPEMD160, RIPEMD256, RIPEMD320, SHA-1, SHA-224, SHA-256, SHA-384, SHA-512, and Tiger hashes (well message digests which are a little different but still...lots!)!&lt;br /&gt;&lt;img src="http://mostlylucid.net/aggbug/1014.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Blog Author</dc:creator>
            <guid>http://mostlylucid.net/archive/2005/02/16/sha-1-has-been-broken.whats-the-big-deal.aspx</guid>
            <pubDate>Thu, 17 Feb 2005 03:21:00 GMT</pubDate>
            <comments>http://mostlylucid.net/archive/2005/02/16/sha-1-has-been-broken.whats-the-big-deal.aspx#feedback</comments>
            <wfw:commentRss>http://mostlylucid.net/comments/commentRss/1014.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Eric Rounds it off </title>
            <link>http://mostlylucid.net/archive/2005/02/14/eric-rounds-it-off.aspx</link>
            <description>Following on from &lt;a href="http://www.mostlylucid.co.uk/archive/2005/02/03/1646.aspx"&gt;Part 3&lt;/a&gt; , Eric Lippert has posted &lt;a href="http://blogs.msdn.com/ericlippert/archive/2005/02/07/368569.aspx"&gt;Part 4&lt;/a&gt; of his series of posts on Hashing and security he also discusses Keberos...If you're really into this sort of stuff but not from an overly mathematical background (like me) the best book I've found on Cryptography is &lt;a href="http://www.amazon.co.uk/exec/obidos/ASIN/0471223573/mostlylucid-21"&gt;Practical Cryptography by Niels Ferguson and Bruce Schnier&lt;/a&gt; this covers pretty much everything the non-NSA employee could need to know about this topic.&lt;br /&gt;&lt;img src="http://mostlylucid.net/aggbug/1007.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Blog Author</dc:creator>
            <guid>http://mostlylucid.net/archive/2005/02/14/eric-rounds-it-off.aspx</guid>
            <pubDate>Mon, 14 Feb 2005 22:03:00 GMT</pubDate>
            <comments>http://mostlylucid.net/archive/2005/02/14/eric-rounds-it-off.aspx#feedback</comments>
            <wfw:commentRss>http://mostlylucid.net/comments/commentRss/1007.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Eric Lippert posts part 3 of his series on password security</title>
            <link>http://mostlylucid.net/archive/2005/02/03/eric-lippert-posts-part-3-of-his-series-on-password.aspx</link>
            <description>THis is a great series of articles - I posted on this &lt;a href="http://www.mostlylucid.co.uk/archive/2005/01/31/1624.aspx"&gt;previously&lt;/a&gt;  - &lt;a href="http://blogs.msdn.com/ericlippert/archive/2005/01/28/362587.aspx"&gt;part 3&lt;/a&gt; covers why you should use a salt (and I've mentioned &lt;a href="http://www.mostlylucid.co.uk/archive/2005/01/31/1624.aspx"&gt;how to generate them recently&lt;/a&gt; ) . These really are excellent articles!&lt;br /&gt;&lt;img src="http://mostlylucid.net/aggbug/1004.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Blog Author</dc:creator>
            <guid>http://mostlylucid.net/archive/2005/02/03/eric-lippert-posts-part-3-of-his-series-on-password.aspx</guid>
            <pubDate>Thu, 03 Feb 2005 23:19:00 GMT</pubDate>
            <comments>http://mostlylucid.net/archive/2005/02/03/eric-lippert-posts-part-3-of-his-series-on-password.aspx#feedback</comments>
            <wfw:commentRss>http://mostlylucid.net/comments/commentRss/1004.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Simple password hashing method...</title>
            <link>http://mostlylucid.net/archive/2005/02/03/simple-password-hashing-method.aspx</link>
            <description>Oh, thought I should mention, if you're just looking for a  really simple way to generate an alphanumeric hash for a password (as opposed to a byte array), the ASP.NET framework has a handy (if extensively named) method for doing this: &lt;a href="http://msdn.microsoft.com/library/shared/deeptree/asp/deeptreeDL.asp?stcfg=/library/searchtabconfig.xml&amp;amp;dtcfg=/library/deeptreeconfig.xml&amp;amp;url=/library/en-us/cpref/html/frlrfsystemwebsecurityformsauthenticationclasstopic.asp?frame=true"&gt;FormsAuthentication.HashPasswordForStoringInConfigFile&lt;/a&gt;&lt;br /&gt;&lt;img src="http://mostlylucid.net/aggbug/1003.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Blog Author</dc:creator>
            <guid>http://mostlylucid.net/archive/2005/02/03/simple-password-hashing-method.aspx</guid>
            <pubDate>Thu, 03 Feb 2005 18:47:00 GMT</pubDate>
            <comments>http://mostlylucid.net/archive/2005/02/03/simple-password-hashing-method.aspx#feedback</comments>
            <wfw:commentRss>http://mostlylucid.net/comments/commentRss/1003.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Gimme some Hash!</title>
            <link>http://mostlylucid.net/archive/2005/01/31/gimme-some-hash.aspx</link>
            <description>Just been reading what looks like the second part in a series on security from &lt;a href="http://weblogs.asp.net/EricLippert/"&gt;Eric Lippert &lt;/a&gt; on the use of hashes for &lt;a href="http://weblogs.asp.net/EricLippert/archive/2005/01/31/363844.aspx"&gt;protecting password information&lt;/a&gt; (&lt;a href="http://weblogs.asp.net/ericlippert/archive/2005/01/28/362587.aspx"&gt;first part is here&lt;/a&gt;) . I find this especially interesting since I've recently designed a system which uses salted-hash (as opposed to sticky-black hash which is a whole different thing ;-))  as a method to protect user passwords. As it turned out it wasn't all that easy to do this in .NET ; of course it might just be me...anyway here's the little function I came up with for hashing passwords (with a dash of salt...)&lt;font color="#ff0000"&gt;&lt;font color="#000000"&gt;&lt;br /&gt; &lt;br /&gt; UPDATE: Simpler version is below with much of the duplication removed - in addition, the defaults are smaller and quicker (16 byte salt and SHA-1 hashing algorithm), you can change either of these - any length of salt and any of the &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemsecuritycryptographyhashalgorithmclasstopic.asp"&gt;HashAlgorithms &lt;/a&gt;(SHA256, MD5, etc...). Hope someone finds it useful...&lt;/font&gt;&lt;/font&gt;&lt;br /&gt; &lt;br /&gt; &lt;div style="border: 1pt solid windowtext; padding: 0pt; background: white none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; font-family: Verdana; font-size: 8pt; color: black;"&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Security.Cryptography;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;using&lt;/span&gt; System.Text;&lt;/p&gt;&lt;p style="margin: 0px;"&gt; &lt;/p&gt;&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;namespace&lt;/span&gt; HashMaker&lt;/p&gt;&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;&lt;p style="margin: 0px;"&gt;    &lt;span style="color: blue;"&gt;public&lt;/span&gt;  &lt;span style="color: blue;"&gt;sealed&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; PasswordHasher&lt;/p&gt;&lt;p style="margin: 0px;"&gt;    {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;        &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;const&lt;/span&gt; &lt;span style="color: blue;"&gt;int&lt;/span&gt; DEFAULTBYTECOUNT = 16;&lt;/p&gt;&lt;p style="margin: 0px;"&gt; &lt;/p&gt;&lt;p style="margin: 0px;"&gt;        &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; GetRandomString()&lt;/p&gt;&lt;p style="margin: 0px;"&gt;        {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;            &lt;span style="color: blue;"&gt;return&lt;/span&gt; Convert.ToBase64String(GetRandomBytes(DEFAULTBYTECOUNT));&lt;/p&gt;&lt;p style="margin: 0px;"&gt;        }&lt;/p&gt;&lt;p style="margin: 0px;"&gt; &lt;/p&gt;&lt;p style="margin: 0px;"&gt;        &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; HashAlgorithm GetAlgorithm()&lt;/p&gt;&lt;p style="margin: 0px;"&gt;        {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;            &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: blue;"&gt;new&lt;/span&gt; SHA1Managed();&lt;/p&gt;&lt;p style="margin: 0px;"&gt;        }&lt;/p&gt;&lt;p style="margin: 0px;"&gt; &lt;/p&gt;&lt;p style="margin: 0px;"&gt;        &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;byte&lt;/span&gt;[] GetRandomBytes(&lt;span style="color: blue;"&gt;int&lt;/span&gt; byteCount)&lt;/p&gt;&lt;p style="margin: 0px;"&gt;        {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;            &lt;span style="color: blue;"&gt;byte&lt;/span&gt;[] byteBuff = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: blue;"&gt;byte&lt;/span&gt;[byteCount];&lt;/p&gt;&lt;p style="margin: 0px;"&gt;            RNGCryptoServiceProvider rn = &lt;span style="color: blue;"&gt;new&lt;/span&gt; RNGCryptoServiceProvider();&lt;/p&gt;&lt;p style="margin: 0px;"&gt;            rn.GetNonZeroBytes(byteBuff);&lt;/p&gt;&lt;p style="margin: 0px;"&gt;            &lt;span style="color: blue;"&gt;return&lt;/span&gt; byteBuff;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;        }&lt;/p&gt;&lt;p style="margin: 0px;"&gt; &lt;/p&gt;&lt;p style="margin: 0px;"&gt;        &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;byte&lt;/span&gt;[] GetHashedPasswordBytes(&lt;span style="color: blue;"&gt;byte&lt;/span&gt;[] passwordBytes, &lt;span style="color: blue;"&gt;out&lt;/span&gt; &lt;span style="color: blue;"&gt;byte&lt;/span&gt;[] saltBytes)&lt;/p&gt;&lt;p style="margin: 0px;"&gt;        {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;            saltBytes = GetRandomBytes(DEFAULTBYTECOUNT);&lt;/p&gt;&lt;p style="margin: 0px;"&gt;            &lt;span style="color: blue;"&gt;return&lt;/span&gt; GetHashedPasswordBytes(passwordBytes, saltBytes);&lt;/p&gt;&lt;p style="margin: 0px;"&gt;        }&lt;/p&gt;&lt;p style="margin: 0px;"&gt; &lt;/p&gt;&lt;p style="margin: 0px;"&gt;        &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;byte&lt;/span&gt;[] GetHashedPasswordBytes(&lt;span style="color: blue;"&gt;byte&lt;/span&gt;[] passwordBytes, &lt;span style="color: blue;"&gt;byte&lt;/span&gt;[] saltBytes)&lt;/p&gt;&lt;p style="margin: 0px;"&gt;        {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;            &lt;span style="color: blue;"&gt;byte&lt;/span&gt;[] combByt = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: blue;"&gt;byte&lt;/span&gt;[passwordBytes.Length + saltBytes.Length];&lt;/p&gt;&lt;p style="margin: 0px;"&gt;            passwordBytes.CopyTo(combByt,0);&lt;/p&gt;&lt;p style="margin: 0px;"&gt;            saltBytes.CopyTo(combByt,passwordBytes.Length);&lt;/p&gt;&lt;p style="margin: 0px;"&gt;            Array.Reverse(combByt);&lt;/p&gt;&lt;p style="margin: 0px;"&gt;            HashAlgorithm sm = GetAlgorithm();&lt;/p&gt;&lt;p style="margin: 0px;"&gt;            &lt;span style="color: blue;"&gt;byte&lt;/span&gt;[] buffArr =  sm.ComputeHash(combByt,0,combByt.Length);&lt;/p&gt;&lt;p style="margin: 0px;"&gt;            &lt;span style="color: blue;"&gt;return&lt;/span&gt; buffArr;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;        }&lt;/p&gt;&lt;p style="margin: 0px;"&gt; &lt;/p&gt;&lt;p style="margin: 0px;"&gt;        &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;byte&lt;/span&gt;[] GetHashedPasswordBytes(&lt;span style="color: blue;"&gt;string&lt;/span&gt; password, &lt;span style="color: blue;"&gt;out&lt;/span&gt; &lt;span style="color: blue;"&gt;byte&lt;/span&gt;[] saltBytes)&lt;/p&gt;&lt;p style="margin: 0px;"&gt;        {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;            &lt;span style="color: blue;"&gt;byte&lt;/span&gt;[] passByt = UnicodeEncoding.Unicode.GetBytes(password);&lt;/p&gt;&lt;p style="margin: 0px;"&gt;            &lt;span style="color: blue;"&gt;return&lt;/span&gt; GetHashedPasswordBytes(passByt, &lt;span style="color: blue;"&gt;out&lt;/span&gt; saltBytes);&lt;/p&gt;&lt;p style="margin: 0px;"&gt;        }&lt;/p&gt;&lt;p style="margin: 0px;"&gt; &lt;/p&gt;&lt;p style="margin: 0px;"&gt;        &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;byte&lt;/span&gt;[] GetHashedPasswordBytes(&lt;span style="color: blue;"&gt;string&lt;/span&gt; password,  &lt;span style="color: blue;"&gt;byte&lt;/span&gt;[] saltBytes)&lt;/p&gt;&lt;p style="margin: 0px;"&gt;        {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;            &lt;span style="color: blue;"&gt;byte&lt;/span&gt;[] passByt = UnicodeEncoding.Unicode.GetBytes(password);&lt;/p&gt;&lt;p style="margin: 0px;"&gt;            &lt;span style="color: blue;"&gt;return&lt;/span&gt; GetHashedPasswordBytes(passByt, saltBytes);&lt;/p&gt;&lt;p style="margin: 0px;"&gt;        }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;    }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;&lt;/div&gt; &lt;br /&gt; &lt;font color="#ff0000"&gt;UPDATE...AGAIN: &lt;font color="#000000"&gt;Umm...I'm going for the 'most updates to a single post' award OK? Anyway, just realised I forgot the little byte array comparison method after I updated this - in this context you'd need this script when comparing the stored array to freshly calculated one from the data entered by the user - you could convert to a Base64 string then just do string.Compare...but this is faster:&lt;br /&gt; &lt;br /&gt; &lt;/font&gt;&lt;/font&gt; &lt;div style="border: 1pt solid windowtext; padding: 0pt; background: white none repeat scroll 0%; font-family: Verdana; font-size: 8pt; color: black; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;"&gt;&lt;p style="margin: 0px;"&gt;        &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;bool&lt;/span&gt; CompareArrays(&lt;span style="color: blue;"&gt;byte&lt;/span&gt;[] Arr1, &lt;span style="color: blue;"&gt;byte&lt;/span&gt;[] Arr2)&lt;/p&gt;&lt;p style="margin: 0px;"&gt;        {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;            &lt;span style="color: blue;"&gt;if&lt;/span&gt; (Arr1.Length == Arr2.Length)&lt;/p&gt;&lt;p style="margin: 0px;"&gt;            {&lt;/p&gt;&lt;p style="margin: 0px;"&gt;                &lt;span style="color: blue;"&gt;int&lt;/span&gt; i = 0;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;                &lt;span style="color: blue;"&gt;while&lt;/span&gt; ((i &amp;lt; Arr1.Length) &amp;amp;&amp;amp; (Arr1[i] == Arr2[i]))&lt;/p&gt;&lt;p style="margin: 0px;"&gt;                    i += 1;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;                &lt;span style="color: blue;"&gt;if&lt;/span&gt; (i == Arr1.Length)&lt;/p&gt;&lt;p style="margin: 0px;"&gt;                    &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: blue;"&gt;true&lt;/span&gt;;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;            }&lt;/p&gt;&lt;p style="margin: 0px;"&gt;            &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: blue;"&gt;false&lt;/span&gt;;&lt;/p&gt;&lt;p style="margin: 0px;"&gt;        }&lt;/p&gt;&lt;/div&gt; &lt;br /&gt; Right, that's it, not more updates...promise!&lt;br /&gt;&lt;img src="http://mostlylucid.net/aggbug/998.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Blog Author</dc:creator>
            <guid>http://mostlylucid.net/archive/2005/01/31/gimme-some-hash.aspx</guid>
            <pubDate>Tue, 01 Feb 2005 00:48:00 GMT</pubDate>
            <comments>http://mostlylucid.net/archive/2005/01/31/gimme-some-hash.aspx#feedback</comments>
            <wfw:commentRss>http://mostlylucid.net/comments/commentRss/998.aspx</wfw:commentRss>
        </item>
        <item>
            <title>The ASP.NET vulnerability...not!</title>
            <link>http://mostlylucid.net/archive/2004/10/07/the-asp.net-vulnerability.not.aspx</link>
            <description>&lt;p&gt;So, &lt;a href="http://it.slashdot.org/it/04/10/07/1549224.shtml?tid=109&amp;amp;tid=172"&gt;Slashdot got a hold of the story&lt;/a&gt; about the ASP.NET vulnerability (the backslash bug), as usual they're loving it over there. What I haven't seen much of though is mention of the fact that many sites were never affected by this - reason? &lt;a href="http://www.microsoft.com/windows2000/downloads/recommended/urlscan/default.asp"&gt;URLScan for IIS 5&lt;/a&gt; and &lt;a href="http://www.microsoft.com/technet/security/tools/urlscan.mspx"&gt;IIS 6 (which incorporates much of URLScan already&lt;/a&gt;) have always &lt;a href="http://pluralsight.com/blogs/keith/archive/2004/10/06/2688.aspx"&gt;blocked this type of attack &lt;/a&gt;- remember, &lt;a href="http://www.microsoft.com/windows2000/downloads/recommended/urlscan/default.asp"&gt;URLScan was released in 2001&lt;/a&gt; and it blocks a host of malformed URL type attacks (there've been a bunch before). &lt;br /&gt;The current Microsoft advice is to &lt;a href="http://www.microsoft.com/security/incident/aspnet.mspx"&gt;add some code to each ASP.NET application&lt;/a&gt;, fine - but if you have a properly configured URLScan or IIS 6.0 - you've never been at risk of this attack. Whilst I'm pretty disgusted that such a simple error got through testing (and let's face it this will probably cost a few companies developing with ASP.NET a bit of business) it does reinforce the fact that you should never rely on a piece of code you can't inspect personally for your application's security.&lt;/p&gt; &lt;p&gt;&lt;font color="#ff0000"&gt;UPDATE:&lt;/font&gt; The piece below has some new info - including an HttpModule which can patch all your apps...&lt;/p&gt; &lt;p&gt;&lt;!--StartFragment --&gt; &lt;/p&gt; &lt;div class="singlepost"&gt; &lt;div class="posttitle"&gt;&lt;a class="singleposttitle" id="viewpost" href="http://weblogs.asp.net/bgold/archive/2004/10/07/239544.aspx"&gt;Updated info on the reported ASP.NET vulnerability&lt;/a&gt; &lt;/div&gt; &lt;p&gt;Today we posted updated information to &lt;a href="http://www.microsoft.com/security/incident/aspnet.mspx"&gt;http://www.microsoft.com/security/incident/aspnet.mspx&lt;/a&gt; with additional information about the nature of the reported vulnerability and an additional mitigation best practice.  Our additional guidance is an HTTP Module that you can install onto a server that will mitigate all ASP.NET applications on the box and protect them against canonicalization issues we knew about at the time of publication.  This is easier then updating the global.asax for each application and if you are dealing with a whole lot of servers much easier to deploy.  You can grab the MSI installer for the HTTP Module at &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=DA77B852-DFA0-4631-AAF9-8BCC6C743026"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyId=DA77B852-DFA0-4631-AAF9-8BCC6C743026&lt;/a&gt;.  There is also a new KB posted at &lt;a href="http://support.microsoft.com/?kbid=887289"&gt;http://support.microsoft.com/?kbid=887289&lt;/a&gt; that describes how to deploy the MSI and HTTP Module.&lt;/p&gt; &lt;p&gt;We will continue to update the landing page as new information or guidance becomes available, so keep checking back.&lt;/p&gt; &lt;div class="itemdesc"&gt;posted on Thursday, October 07, 2004 5:34 PM &lt;/div&gt;&lt;/div&gt;&lt;img src="http://mostlylucid.net/aggbug/959.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Blog Author</dc:creator>
            <guid>http://mostlylucid.net/archive/2004/10/07/the-asp.net-vulnerability.not.aspx</guid>
            <pubDate>Fri, 08 Oct 2004 01:29:00 GMT</pubDate>
            <comments>http://mostlylucid.net/archive/2004/10/07/the-asp.net-vulnerability.not.aspx#feedback</comments>
            <wfw:commentRss>http://mostlylucid.net/comments/commentRss/959.aspx</wfw:commentRss>
        </item>
        <item>
            <title>DNS Problems now resolved - and on to some reflection stuff</title>
            <link>http://mostlylucid.net/archive/2004/08/20/dns-problems-now-resolved---and-on-to-some-reflection.aspx</link>
            <description>Well, seems my DNS provider uses some kind of procedure which can be prone to failure. Anyway, my DNS stuff is now functional again- yay! My plan for today is now to move on to playing a bit more with reflection and attributes...this could get interesting! Oh, in case you're wondering, I'm playing with the &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspnet/html/asp04212004.asp"&gt;Provider Pattern&lt;/a&gt; for a project I'm working on, also looking at doing some sort of low-maintainance security model for 'operational' security on method calls; so I can define that a particular method requires that my system provides the 'Edit' permission for that user / object before allowing the method call...probably going to involve extending the Provider Pattern to allow for permission attribute introspection as part of the provider...may be interesting &lt;img src="http://www.mostlylucid.co.uk/uploads/smile3.gif" /&gt;&lt;img src="http://mostlylucid.net/aggbug/912.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Blog Author</dc:creator>
            <guid>http://mostlylucid.net/archive/2004/08/20/dns-problems-now-resolved---and-on-to-some-reflection.aspx</guid>
            <pubDate>Fri, 20 Aug 2004 22:22:00 GMT</pubDate>
            <comments>http://mostlylucid.net/archive/2004/08/20/dns-problems-now-resolved---and-on-to-some-reflection.aspx#feedback</comments>
            <wfw:commentRss>http://mostlylucid.net/comments/commentRss/912.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Eliminating SQL Injection...</title>
            <link>http://mostlylucid.net/archive/2004/07/10/eliminating-sql-injection.aspx</link>
            <description>&lt;p&gt;Read on &lt;a href="http://dotnetjunkies.com/WebLog/stefandemetz/archive/2004/07/10/18763.aspx"&gt;Stefan Demetz's blog&lt;/a&gt; about a &lt;a href="http://dotnetjunkies.com/WebLog/stefandemetz/archive/2004/07/10/18763.aspx"&gt;movement afoot to lobby Microsoft&lt;/a&gt; to change how textboxes allow passed in data. &lt;a href="http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=25d26b9a-11b4-49fe-be42-ca38ad0d1256"&gt;See here&lt;/a&gt; for the comment. Sorry but I think this is a plain awful idea and is very reminiscent of the horrible &lt;a href="http://www.asp.net/faq/RequestValidation.aspx"&gt;RequestValidation &lt;/a&gt;nonsense introduced in .NET 1.1. I am in favour of a simple method of encrypting and validating QueryString input such as &lt;a href="http://www.dotnetjunkies.com/HowTo/99201486-ACFD-4607-A0CC-99E75836DC72.dcik"&gt;presented here&lt;/a&gt; (apart from the fact that it used 3DES - DO NOT DO THIS! 3DES is MUCH slower and not as secure as AES). So what's my problem with changing the default behaviour of input controls? Simple, three things:&lt;/p&gt;&lt;p&gt;1. If it happens, this will likely be implemented in such a way that it breaks exisitng applications (this also happened with 1.1 and as a result there's still a few apps still running 1.0 out there).&lt;br /&gt;2. If it is done it would have to be totally bulletproof, otherwise every app would rely on a single security mechanism - which is so NOT a good idea!&lt;br /&gt;3. Abdication of responsibility by developers, if this were done so it had to be explicitly enabled either at web.config or in page level, I would be much happier. Put simply I prefer developers know what's happening in their code and therefore are more likely to be aware of any issues surrounding it.&lt;/p&gt;&lt;p&gt;Oh, and Microsoft, if you do do this, don't do it like Viewstate where you hardcode 3DES encryption with no way of replacing your implementation, at least make it a Provider!&lt;/p&gt;&lt;img src="http://mostlylucid.net/aggbug/895.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Blog Author</dc:creator>
            <guid>http://mostlylucid.net/archive/2004/07/10/eliminating-sql-injection.aspx</guid>
            <pubDate>Sun, 11 Jul 2004 03:06:00 GMT</pubDate>
            <comments>http://mostlylucid.net/archive/2004/07/10/eliminating-sql-injection.aspx#feedback</comments>
            <wfw:commentRss>http://mostlylucid.net/comments/commentRss/895.aspx</wfw:commentRss>
        </item>
        <item>
            <title>For future reference...pronouncable password generator</title>
            <link>http://mostlylucid.net/archive/2004/04/02/for-future-reference.pronouncable-password-generator.aspx</link>
            <description>From &lt;a href="http://weblogs.asp.net/garethbrown"&gt;Gareth Brown&lt;/a&gt;, a very handle little tool which I can think of a dozen uses for right now - a &lt;a href="http://weblogs.asp.net/garethbrown/archive/2004/04/02/106216.aspx"&gt;pronouncable password generator&lt;/a&gt;.&lt;img src="http://mostlylucid.net/aggbug/792.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Blog Author</dc:creator>
            <guid>http://mostlylucid.net/archive/2004/04/02/for-future-reference.pronouncable-password-generator.aspx</guid>
            <pubDate>Fri, 02 Apr 2004 22:46:00 GMT</pubDate>
            <comments>http://mostlylucid.net/archive/2004/04/02/for-future-reference.pronouncable-password-generator.aspx#feedback</comments>
            <wfw:commentRss>http://mostlylucid.net/comments/commentRss/792.aspx</wfw:commentRss>
        </item>
        <item>
            <title>Security through Diversity - why I don't like ValidateRequest</title>
            <link>http://mostlylucid.net/archive/2004/03/02/security-through-diversity---why-i-dont-like-validaterequest.aspx</link>
            <description>&lt;p&gt;I'm aware this is a &lt;a href="http://weblogs.asp.net/ShankuN/archive/2004/03/02/82534.aspx"&gt;fairly controversial viewpoint&lt;/a&gt;, I should explain some of my own background as a precursor to my dislike of this. In the bad old days, I was a penetration tester; I ran my own little company which provided this service to a number of customers, my job was to essentially crack / in other ways break web sites and 'other' networks. In my time as a pen tester, one of the most annoying things was flaws which could effect a huge number of sites / installations at the same time, classics were Cisco password flaws, Perl and PHP security flaws and, worst of all, backdoors in Web Applications. So, as time has progressed and I moved more into actually writing applications rather than breaking them I've always been aware that application security systems should not be inherently trusted, while less likely to be flawed than some ad-hoc implementation, that flaw can be potentially more serious since is is almost certain to become widely know and exploited within a very short space of time.&lt;br /&gt;That's part of the problem I have with ValidateRequest, it provides a crutch, a shortcut for the lazy developer. OK, it is useful, it blocks any incoming 'html' like request information - and will therefore block many XSS (Cross Site Scripting) attacks which can be pretty serious. Problem is, &lt;a href="http://weblogs.asp.net/gad/archive/2003/11/12/37219.aspx"&gt;flaws have already been found in this&lt;/a&gt; and the patch is not obvious / easy to find (had you heard of it before?) - so not there's an issue which will effect ALL ASP.NET 1.1 sites which rely on this feature to protect them from XSS attacks. Even worse, how many sites do you think will take additional precautions over and above this to protect their input - do you know if it protects you from &lt;a href="http://www.developer.com/db/article.php/2243461"&gt;SQL Injection attacks&lt;/a&gt;, &lt;a href="http://nts.jhu.edu/alerts/alert.detail.cfm?aid=218"&gt;Buffer Overflow attacks&lt;/a&gt; and various others (including such gems as simple backdoors, &lt;a href="http://www.experts-exchange.com/Security/Q_20851738.html"&gt;Cookie Hijacking&lt;/a&gt; and the like).&lt;br /&gt;&lt;br /&gt;My point is, in my view, responsibility for application security should lie with the developer - they should understand and plan for the consequences of choices they make in application design. Read a book like &lt;a href="http://www.amazon.co.uk/exec/obidos/ASIN/0735617228/mostlylucid-21"&gt;Michael Howard's Writing Secure Code&lt;/a&gt; [&lt;a href="http://www.amazon.com/exec/obidos/ASIN/0735617228/mostlylucid-21"&gt;US&lt;/a&gt;] - get to know where the vulnerabilities in your application may lie and compensate for them.&lt;br /&gt;In short, don't rely on things like ValidateRequest as your only line of defence - use it by all means, it will stop many things getting through which you may not want - but learn &lt;a href="http://weblogs.asp.net/vga/archive/2003/05/02/6329.aspx"&gt;what it actually does&lt;/a&gt; and what it doesn't.&lt;br /&gt;&lt;br /&gt;For instance, what will you do when you only want certain tags to get through and not others? You may need to look at &lt;a href="http://www.mostlylucid.co.uk/uploads/HtmlTagRemover.zip"&gt;something like this &lt;/a&gt;(I wrote this a while ago - I'm not claiming it's entirely or even partially foolproof - just proof of a concept). &lt;br /&gt;&lt;br /&gt;Anyway, views always welcome - how much application security should you delegate to the framework - has anyone else come up with their own little 'security' toys which they use to validate user input?&lt;/p&gt;
&lt;p&gt;&lt;font color="#ff0000"&gt;UPDATE:&lt;/font&gt; Forgot to mention, if you're still on IIS 5.0 be sure to check out &lt;a href="http://www.microsoft.com/windows2000/downloads/recommended/iislockdown/default.asp"&gt;IISLockdown&lt;/a&gt; - you MUST have this installed, it will help you avoid a huge number of security holes, known / future...if you have IIS 6.0 , it's already there but be sure to &lt;a href="http://weblogs.asp.net/lbarbieri/archive/2003/10/06/30678.aspx"&gt;check out this&lt;/a&gt; to avoid any development problems...&lt;/p&gt;&lt;img src="http://mostlylucid.net/aggbug/763.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Blog Author</dc:creator>
            <guid>http://mostlylucid.net/archive/2004/03/02/security-through-diversity---why-i-dont-like-validaterequest.aspx</guid>
            <pubDate>Tue, 02 Mar 2004 23:10:00 GMT</pubDate>
            <comments>http://mostlylucid.net/archive/2004/03/02/security-through-diversity---why-i-dont-like-validaterequest.aspx#feedback</comments>
            <wfw:commentRss>http://mostlylucid.net/comments/commentRss/763.aspx</wfw:commentRss>
        </item>
    </channel>
</rss>
