<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-2281490675396238353</atom:id><lastBuildDate>Sun, 19 Feb 2012 04:01:24 +0000</lastBuildDate><category>Tools</category><category>Administrivia</category><category>CSRF</category><category>PCI</category><category>Forgot Password</category><category>Code Review</category><category>XSS</category><category>Industry</category><category>Session Management</category><category>Architecture/Design</category><title>AppSec Notes</title><description>Mulling over various topics in application security.</description><link>http://appsecnotes.blogspot.com/</link><managingEditor>noreply@blogger.com (Dave Ferguson)</managingEditor><generator>Blogger</generator><openSearch:totalResults>35</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/AppSecNotes" /><feedburner:info uri="appsecnotes" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2281490675396238353.post-7319015855028560201</guid><pubDate>Fri, 29 Jul 2011 03:29:00 +0000</pubDate><atom:updated>2011-07-28T22:41:16.568-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Industry</category><category domain="http://www.blogger.com/atom/ns#">XSS</category><title>Latest OWASP Educational Video</title><description>The &lt;a href="http://www.youtube.com/watch?v=_Z9RQSnf8-g"&gt;latest episode&lt;/a&gt; in the educational video series from Jerry Hoff and &lt;a href="http://www.owasp.org"&gt;OWASP&lt;/a&gt; is out.  This one is all about stored XSS, aka persistent XSS.  Another outstanding resource to introduce concepts of web application security to developers!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2281490675396238353-7319015855028560201?l=appsecnotes.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AppSecNotes/~4/gHaEX8hNnwo" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AppSecNotes/~3/gHaEX8hNnwo/latest-owasp-educational-video.html</link><author>noreply@blogger.com (Dave Ferguson)</author><thr:total>0</thr:total><feedburner:origLink>http://appsecnotes.blogspot.com/2011/07/latest-owasp-educational-video.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2281490675396238353.post-7885759426349034661</guid><pubDate>Sat, 02 Jul 2011 02:17:00 +0000</pubDate><atom:updated>2011-07-02T21:14:47.254-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Architecture/Design</category><category domain="http://www.blogger.com/atom/ns#">Forgot Password</category><title>Account Lockout Fail</title><description>A while back I was hunting for vulnerabilities in a web app's Forgot Password feature.  On the first page you had to enter your username and email address.  The second page asked a personal security question.  That is quite weak.  I recommend asking for at least 3 pieces of data on the first step.  Asking for only two inputs, especially when they are username and email address, is not very secure.  Username and email address are often related.  If you know one, you might be able to guess the other.  For example, the email address for user "jthomas" could be "jthomas@yahoo.com".  I also recommend asking two personal security questions on the second page, not just one.&lt;br /&gt;&lt;br /&gt;Anyway, one of the things I like to check is whether or not the account is locked after a certain number of failed attempts to answer the security question(s).  This is an important defense against attackers who are trying to break in via the Forgot Password functionality.  Sure enough, the message "account has been locked" appeared after I purposefully entered 3 wrong answers.&lt;br /&gt;&lt;br /&gt;I was just about to make a note about this commendable practice, but something caught my eye.  The input field was still there on the page.  That's not something you normally see.  Usually the application takes it away after a lockout occurs.  So being a curious fellow, I proceeded to enter the correct answer to the question.  Lo and behold the application sent me to the next page where I was allowed to reset the password on the account.   Now that's an account lockout fail!  I'm not sure why or how the developers created a lockout message without actually coding the lockout.  Just another example of how difficult app security can be.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2281490675396238353-7885759426349034661?l=appsecnotes.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AppSecNotes/~4/1tlog0u9ptU" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AppSecNotes/~3/1tlog0u9ptU/account-lockout-fail.html</link><author>noreply@blogger.com (Dave Ferguson)</author><thr:total>0</thr:total><feedburner:origLink>http://appsecnotes.blogspot.com/2011/07/account-lockout-fail.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2281490675396238353.post-2924542704731988336</guid><pubDate>Thu, 21 Apr 2011 05:38:00 +0000</pubDate><atom:updated>2011-04-21T01:36:17.198-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Industry</category><category domain="http://www.blogger.com/atom/ns#">XSS</category><title>Blackhole Exploit Kit</title><description>Something I found surprising at first when learning about real-world SQL injection attacks on web applications is that hackers will strive to &lt;span style="font-style: italic; font-weight: bold;"&gt;insert &lt;/span&gt;data into the database, not necessarily try to extract data from it.  Why would they do this?  They want to inject JavaScript code.  Basically, the goal is to leverage SQL injection to create a &lt;a href="http://en.wikipedia.org/wiki/Cross-site_scripting#Persistent"&gt;stored XSS attack&lt;/a&gt; on application users.  It really shows you how supremely dangerous stored XSS vulnerabilities are, huh?&lt;br /&gt;&lt;br /&gt;If successful, the malicious JavaScript code will execute in users' browsers.  This is bad.  Think of it as executable code, chosen by an attacker, running on a victim's computer.   One example of the nastiness that can result is the &lt;a href="http://community.websense.com/blogs/securitylabs/pages/black-hole-exploit-kit.aspx"&gt;Blackhole Exploit Kit&lt;/a&gt;.  This malware originated in Russia and is openly for sale.  Blackhole is designed to compromise victim computers by exploiting known vulnerabilities in certain software products like Adobe Reader or Java.   Symantec researchers have provided a &lt;a href="http://www.symantec.com/connect/blogs/blackhole-theory"&gt;nice writeup of how Blackhole works&lt;/a&gt;.   Typically, the badness begins with an iframe (created by JavaScript of course) that points to a Blackhole server.&lt;br /&gt;&lt;br /&gt;A U.S. Postal Service website was recently &lt;a href="http://www.darkreading.com/advanced-threats/167901091/security/attacks-breaches/229401258/us-postal-service-website-hit-with-blackhole-exploit.html"&gt;found to have been compromised with Blackhole&lt;/a&gt;. There is some question how it happened.  Regardless, the thing to keep in mind is that a web application that allows for SQL injection might very well lead to stored XSS attacks.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2281490675396238353-2924542704731988336?l=appsecnotes.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AppSecNotes/~4/hbvYE4OFc44" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AppSecNotes/~3/hbvYE4OFc44/blackhole-exploit-kit.html</link><author>noreply@blogger.com (Dave Ferguson)</author><thr:total>0</thr:total><feedburner:origLink>http://appsecnotes.blogspot.com/2011/04/blackhole-exploit-kit.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2281490675396238353.post-1214774017698740523</guid><pubDate>Mon, 07 Mar 2011 04:25:00 +0000</pubDate><atom:updated>2011-03-06T22:50:59.112-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Industry</category><title>Educational Videos about Web Application Security</title><description>A terrific and free resource for introducing developers to web application security concepts is a video tutorial series from OWASP.  Jerry Hoff is the leader on this tutorial project.  The first two episodes are complete - &lt;a href="http://www.youtube.com/watch?v=CDbWvEwBBxo"&gt;AppSec Basics&lt;/a&gt; and &lt;a href="http://www.youtube.com/watch?v=pypTYPaU7mM"&gt;Injection Attacks&lt;/a&gt;.  The videos are very well done, with nice graphics, sound, and animation.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2281490675396238353-1214774017698740523?l=appsecnotes.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AppSecNotes/~4/XNkP1QZmYWs" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AppSecNotes/~3/XNkP1QZmYWs/educational-videos-about-web.html</link><author>noreply@blogger.com (Dave Ferguson)</author><thr:total>1</thr:total><feedburner:origLink>http://appsecnotes.blogspot.com/2011/03/educational-videos-about-web.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2281490675396238353.post-3581711274910124705</guid><pubDate>Sat, 11 Sep 2010 17:23:00 +0000</pubDate><atom:updated>2011-07-01T21:52:05.145-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Architecture/Design</category><category domain="http://www.blogger.com/atom/ns#">Forgot Password</category><title>Latest Forgot Password Best Practices Doc</title><description>A new version of my white paper entitled "Best Practices for a Secure Forgot Password Feature" is available.  You can &lt;a href="http://www.fishnetsecurity.com/Resource_/PageResource/White_Papers/FishNetSecurity_SecureForgotPassword.pdf"&gt;download the white paper here&lt;/a&gt;.  No significant changes were made in terms of content, but it does have fewer pages and a more pleasing look now.  The link I had given out previously is no longer valid.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2281490675396238353-3581711274910124705?l=appsecnotes.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AppSecNotes/~4/tdSVjLMbaJM" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AppSecNotes/~3/tdSVjLMbaJM/latest-forgot-password-best-practices.html</link><author>noreply@blogger.com (Dave Ferguson)</author><thr:total>2</thr:total><feedburner:origLink>http://appsecnotes.blogspot.com/2010/09/latest-forgot-password-best-practices.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2281490675396238353.post-815339077442235253</guid><pubDate>Thu, 09 Sep 2010 02:43:00 +0000</pubDate><atom:updated>2010-09-09T11:52:10.323-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Architecture/Design</category><title>Password Complexity Rules</title><description>A Consumer Reports blogger has been &lt;a href="http://blogs.consumerreports.org/electronics/2010/08/facebook-weak-passwords-account-security-danger-flaw-hackers-guess-password-access-accounts-con-artists-hijack-scammers-crack.html"&gt;taking Facebook to task&lt;/a&gt; for allowing dictionary words to be used as passwords.  I can't confirm that Facebook actually forbids the use of these words like the blogger claims.  The &lt;a href="http://www.facebook.com/r.php"&gt;signup page&lt;/a&gt; did not reject the word "animal" when I tried it, and their &lt;a href="http://www.facebook.com/help/?faq=13665"&gt;password strength FAQ&lt;/a&gt; does not state that dictionary words are banned.&lt;br /&gt;&lt;br /&gt;The flak got me to thinking about password complexity rules in general. It needs to be evaluated when assessing the security posture of a web application.  I see huge variety in the password rules that are being used.  That's not the problem.  It makes sense that highly sensitive applications, such as financial or governmental, should enforce stricter requirements.   The problem I see is that the password rules simply aren't strong enough, ever.  Identifying this weakness calls for a manual test  or a code review.  It is not something a web app scanner like  WebInspect or AppScan would flag.  Maybe that's part of the problem.&lt;br /&gt;&lt;br /&gt;Below are the password rules I normally recommend for Internet-facing web applications.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Minimum password length of 7&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Maximum password length of 20 or more&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Require at least one uppercase letter&lt;/li&gt;&lt;li&gt;Require at least one lowercase letter&lt;/li&gt;&lt;li&gt;Require at least one number&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Allow special characters&lt;/li&gt;&lt;li&gt;Do not allow any part of username to appear in the password&lt;/li&gt;&lt;li&gt;Do not allow the user's first or last name to appear in the password&lt;/li&gt;&lt;li&gt;Do not allow any form of the word “password”&lt;/li&gt;&lt;li&gt;Do not allow the same character three or more times in succession&lt;/li&gt;&lt;/ul&gt;Notice there is nothing about banning dictionary words (other than a number being required).   Applications can mitigate that particular risk by using an account lockout  mechanism to prevent automated password guessing.   Also, it probably goes without saying, but &lt;a href="http://appsecnotes.blogspot.com/2009/05/importance-of-case-sensitive-passwords.html"&gt;passwords should be case sensitive&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Please let me know if you have any other suggestions on this subject!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2281490675396238353-815339077442235253?l=appsecnotes.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AppSecNotes/~4/qAI8WxsSIRU" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AppSecNotes/~3/qAI8WxsSIRU/password-complexity-rules.html</link><author>noreply@blogger.com (Dave Ferguson)</author><thr:total>0</thr:total><feedburner:origLink>http://appsecnotes.blogspot.com/2010/09/password-complexity-rules.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2281490675396238353.post-130709605124777231</guid><pubDate>Fri, 28 May 2010 23:26:00 +0000</pubDate><atom:updated>2010-05-28T18:26:00.709-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Tools</category><title>Bug Editing Cookies in Web Developer Extension</title><description>Just a quick note I've been meaning to post about a small bug in Chris Pederick's Firefox &lt;a href="https://addons.mozilla.org/en-US/firefox/addon/60"&gt;Web Developer extension&lt;/a&gt;.  It is a fantastic extension and I use it all the time, especially for working with cookies.  Kudos to Mr. Pederick!&lt;br /&gt;&lt;br /&gt;Unfortunately, what I noticed is that if you have "accept third-party cookies" unchecked in Firefox's privacy options, you can't edit cookies or add cookies. In fact it ends up deleting the cookies that you try to edit.  D'oh!&lt;br /&gt;&lt;br /&gt;This bug bit me a few times when I was trying to demonstrate session hijacking while teaching an application security class. This bug is a &lt;a href="http://chrispederick.com/work/web-developer/issues/#item-946"&gt;known issue&lt;/a&gt; and I'm hoping Chris can find a way to make it work in the next version.  In the meantime, I will keep using the extension and trying to remember to enable third-party cookies whenever I teach the class.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2281490675396238353-130709605124777231?l=appsecnotes.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AppSecNotes/~4/DcfHkvqTLrw" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AppSecNotes/~3/DcfHkvqTLrw/bug-editing-cookies-in-web-developer.html</link><author>noreply@blogger.com (Dave Ferguson)</author><thr:total>0</thr:total><feedburner:origLink>http://appsecnotes.blogspot.com/2010/05/bug-editing-cookies-in-web-developer.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2281490675396238353.post-7437890683553814296</guid><pubDate>Mon, 17 May 2010 13:26:00 +0000</pubDate><atom:updated>2010-05-17T23:14:49.404-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Session Management</category><category domain="http://www.blogger.com/atom/ns#">XSS</category><title>A Case for HttpOnly</title><description>Last month the Apache Infrastructure Team fell victim to a common web application attack.  Rather than keep the information secret, they were kind enough to &lt;a href="http://blogs.apache.org/infra/entry/apache_org_04_09_2010"&gt;explain how the attack occurred&lt;/a&gt;.  The initial attack leveraged cross-site scripting to steal users' session IDs.  This is something that could have been prevented if the web app's session cookie had been marked with the &lt;a href="http://www.owasp.org/index.php/HttpOnly"&gt;HttpOnly&lt;/a&gt; attribute.  When a web app sets a cookie, the presence of HttpOnly instructs browsers to disallow client-side script from accessing the cookie.&lt;br /&gt;&lt;br /&gt;You will sometimes hear or read that HttpOnly helps prevent XSS attacks.  That is not quite true.  It helps prevent session hijacking.  Specifically, it helps guard against one attack vector, namely where session cookies are stolen via XSS.  HttpOnly can be used for any sensitive cookie that you don't want falling into the hands of fraudsters. (I should use "fraudster" more often - it is a fun word)&lt;br /&gt;&lt;br /&gt;There is one caveat to using HttpOnly.  It might break your application if it was written in such a way that the functionality depends on JavaScript having access to the cookie.  That is fairly uncommon however.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2281490675396238353-7437890683553814296?l=appsecnotes.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AppSecNotes/~4/WLpuXPNb5Rg" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AppSecNotes/~3/WLpuXPNb5Rg/case-for-httponly.html</link><author>noreply@blogger.com (Dave Ferguson)</author><thr:total>0</thr:total><feedburner:origLink>http://appsecnotes.blogspot.com/2010/05/case-for-httponly.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2281490675396238353.post-7659668842693348750</guid><pubDate>Wed, 12 May 2010 14:19:00 +0000</pubDate><atom:updated>2010-05-16T18:36:03.808-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Architecture/Design</category><title>Dynamically-Generated PDFs</title><description>Many web applications will generate PDF files for users so they can view nicely-formatted statements, reports, etc.  These dynamically-generated PDFs are typically accessed by users in two different ways.&lt;br /&gt;&lt;br /&gt;1) The application creates an actual PDF file on the server and redirects the user's browser to the file (via 302 response code).&lt;br /&gt;&lt;br /&gt;2) The application streams the bytes for the PDF directly to the user's browser as part of the HTTP response.&lt;br /&gt;&lt;br /&gt;This second method is much more secure.  The reason is that a PDF file sitting on a server can probably be accessed by anyone.  The only information needed is the directory and the file name. That said, I have seen the first method implemented securely, but two important mitigating factors were employed.  First, the application used randomized file names.  A &lt;a href="http://en.wikipedia.org/wiki/Guid"&gt;globally-unique identifier (GUID)&lt;/a&gt; is great for this.  Second, the files were deleted within about 10 seconds of them being created.  These two factors, when combined, made it almost impossible to gain access to another user's PDF file.&lt;br /&gt;&lt;br /&gt;Testing for this vulnerability is simple.  If you run across an application that allows you to download a dynamic PDF, make note of the URL when viewing the PDF.  Is it a direct link to the PDF file?  If so, copy the link, open a different browser (not another window of the same browser), and paste the URL.  Is the PDF loaded?  If so, then you have a problem, especially if the file name is guessable or follows a pattern.  You might also check to see if the PDF is deleted from the server after a time.&lt;br /&gt;&lt;br /&gt;This topic applies to other static files that your application might generate dynamically too, such as Excel files.  PDFs just seem to be the most common.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2281490675396238353-7659668842693348750?l=appsecnotes.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AppSecNotes/~4/n5bgXcezajU" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AppSecNotes/~3/n5bgXcezajU/generating-pdfs.html</link><author>noreply@blogger.com (Dave Ferguson)</author><thr:total>0</thr:total><feedburner:origLink>http://appsecnotes.blogspot.com/2010/05/generating-pdfs.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2281490675396238353.post-8860176040881900271</guid><pubDate>Tue, 20 Apr 2010 03:45:00 +0000</pubDate><atom:updated>2010-04-21T11:54:21.582-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Architecture/Design</category><title>Authentication Flaw</title><description>During an assessment of a financial web application, I found a serious flaw in authentication. The web security scanners at my disposal gave a "seal of approval" on the unauthenticated surface area of the application.  Yet, in a matter of a few hours after getting the go-ahead to test the application, I had fully compromised a user's account.  How?  Basically, by using my brain as a hacker might.  Screen shots proving my authenticated access were probably eye-opening to the customer as they had given me only the URL for the site, not any user credentials.&lt;br /&gt;&lt;br /&gt;This was a case of flawed forgot password functionality.  For users who had forgotten their password, the application worked as follows:&lt;br /&gt;&lt;br /&gt;Step 1 - Enter username&lt;br /&gt;Step 2 - Answer question to personal security question and enter email  address&lt;br /&gt;Step 3 - Receive email with a new, system-generated password&lt;br /&gt;&lt;br /&gt;Can you find the flaws?  First, the application asked for only one piece of data initially: the username.  It is not hard to guess a valid username.  I found that "jsmith" was a valid username. Second, the application asked the user to enter his email address on the second step.  Um, shouldn't this be part of the user's profile and already known to the application?  Why trust a value entered by the user? Third, which I didn't actually tell you, is that the application allowed an unlimited number of attempts to answer the personal security question.&lt;br /&gt;&lt;br /&gt;It happened to be that jsmith's security question was "What was the name of your first pet?".  I fired up &lt;a href="http://portswigger.net/intruder/"&gt;Burp Intruder&lt;/a&gt; with the 100 most common &lt;a href="http://dogtime.com/top-100-dog-names.html"&gt;dog &lt;/a&gt;and &lt;a href="http://www.youpet.com/cat-names/"&gt;cat &lt;/a&gt;names.  Very soon I received an email with jsmith's newly reset password.  It turned out that his first pet was named "Rocky" (I'm assuming jsmith is a man here - would a girl naming her pet "Rocky"?).&lt;br /&gt;&lt;br /&gt;This is an example where a scanner (and a web app firewall most likely) would not alert you to this security hole.  All requests, data, and URLs were perfectly legitimate in my attack.  The flaws were caused by poor design decisions.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2281490675396238353-8860176040881900271?l=appsecnotes.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AppSecNotes/~4/BanUCcRdLCo" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AppSecNotes/~3/BanUCcRdLCo/business-logic-flaw.html</link><author>noreply@blogger.com (Dave Ferguson)</author><thr:total>4</thr:total><feedburner:origLink>http://appsecnotes.blogspot.com/2010/04/business-logic-flaw.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2281490675396238353.post-1782683862027873020</guid><pubDate>Wed, 03 Mar 2010 07:38:00 +0000</pubDate><atom:updated>2010-03-03T10:05:01.651-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Architecture/Design</category><title>Don't Need No Stinkin' Coupon Print Activator</title><description>This is a real-life example of exploiting a web application security flaw.   I received an email from Discover Card offering some Lowe's coupons.&lt;span style="text-decoration: underline;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ux58bmqGooQ/S44TzB-WtPI/AAAAAAAAAFc/FpnMHE4bbYc/s1600-h/email.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 294px;" src="http://3.bp.blogspot.com/_ux58bmqGooQ/S44TzB-WtPI/AAAAAAAAAFc/FpnMHE4bbYc/s400/email.png" alt="" id="BLOGGER_PHOTO_ID_5444310766961734898" border="0" /&gt;&lt;/a&gt;I was needing to buy some stuff there anyway, so I decided to grab them.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ux58bmqGooQ/S44T7ZxUpWI/AAAAAAAAAFk/uF4UtxwZRvI/s1600-h/print_1.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 337px;" src="http://2.bp.blogspot.com/_ux58bmqGooQ/S44T7ZxUpWI/AAAAAAAAAFk/uF4UtxwZRvI/s400/print_1.png" alt="" id="BLOGGER_PHOTO_ID_5444310910788478306" border="0" /&gt;&lt;/a&gt;I was soon shocked and amazed. Turns out they expect you to download an executable (something called a"Coupon Print Activator") and run it just to print the coupons.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ux58bmqGooQ/S44VuF2MMOI/AAAAAAAAAF0/X9xLflEF9NY/s1600-h/print_2.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 360px;" src="http://1.bp.blogspot.com/_ux58bmqGooQ/S44VuF2MMOI/AAAAAAAAAF0/X9xLflEF9NY/s400/print_2.png" alt="" id="BLOGGER_PHOTO_ID_5444312881125142754" border="0" /&gt;&lt;/a&gt;I am not in the habit of running strange .exe's.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ux58bmqGooQ/S44V4MisN0I/AAAAAAAAAF8/G-c0pBBND6g/s1600-h/print_3.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 223px;" src="http://1.bp.blogspot.com/_ux58bmqGooQ/S44V4MisN0I/AAAAAAAAAF8/G-c0pBBND6g/s400/print_3.png" alt="" id="BLOGGER_PHOTO_ID_5444313054721095490" border="0" /&gt;&lt;/a&gt;But, I really wanted those coupons (and perhaps sensed my hacking skillz were being challenged).  I looked at the requests being made to the server, and noticed that dsppreprint.cfm had some JavaScript pointing to interesting URLs, one to "print.cfm" and one to "print_noplugin_redirect.cfm". The query strings were radically different between the two, so I decided to append the query string from print.cfm onto the other .cfm file.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ux58bmqGooQ/S44XCA1ruLI/AAAAAAAAAGE/kmAVOdXFjbo/s1600-h/print_4.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 101px;" src="http://4.bp.blogspot.com/_ux58bmqGooQ/S44XCA1ruLI/AAAAAAAAAGE/kmAVOdXFjbo/s400/print_4.png" alt="" id="BLOGGER_PHOTO_ID_5444314322889849010" border="0" /&gt;&lt;/a&gt;This hybrid URL ended up in a round-about way returning some HTML with an "embed" tag with a bunch of attributes.  One of the attributes was very interesting to me.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ux58bmqGooQ/S44XtyCrQ_I/AAAAAAAAAGM/-SZrlvlSJts/s1600-h/print_5.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 60px;" src="http://3.bp.blogspot.com/_ux58bmqGooQ/S44XtyCrQ_I/AAAAAAAAAGM/-SZrlvlSJts/s400/print_5.png" alt="" id="BLOGGER_PHOTO_ID_5444315074832057330" border="0" /&gt;&lt;/a&gt;A request to this URL returned some raw data that appeared to be meant for consumption by the Coupon Print Activator.  It also led me to discover yet another URL.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ux58bmqGooQ/S44YNYFS5MI/AAAAAAAAAGU/UavM0M76Lqk/s1600-h/print_6.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 90px;" src="http://4.bp.blogspot.com/_ux58bmqGooQ/S44YNYFS5MI/AAAAAAAAAGU/UavM0M76Lqk/s400/print_6.png" alt="" id="BLOGGER_PHOTO_ID_5444315617619535042" border="0" /&gt;&lt;/a&gt;A request to this URL returned the following jpeg image (numbers masked to protect something or other):&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ux58bmqGooQ/S44Y2SKtMcI/AAAAAAAAAGc/y6eTzCwLJgo/s1600-h/print_7.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 143px;" src="http://3.bp.blogspot.com/_ux58bmqGooQ/S44Y2SKtMcI/AAAAAAAAAGc/y6eTzCwLJgo/s400/print_7.png" alt="" id="BLOGGER_PHOTO_ID_5444316320406254018" border="0" /&gt;&lt;/a&gt;So I got a bar code. Wonder if I could print this bar code and use it at the self-checkout at Lowe's?  This would not be unethical as I was entitled to the coupon anyway.  I just didn't want ro run that Activator thingy!  As a simple test, I jumped over to &lt;a href="http://www.lowes.com/"&gt;Lowes.com&lt;/a&gt; and added a ceiling fan to my shopping cart.  There was an input field for "Promotional Code".&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_ux58bmqGooQ/S44aNVRxmrI/AAAAAAAAAGs/euk_PYecL8k/s1600-h/print_8.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 137px;" src="http://3.bp.blogspot.com/_ux58bmqGooQ/S44aNVRxmrI/AAAAAAAAAGs/euk_PYecL8k/s400/print_8.png" alt="" id="BLOGGER_PHOTO_ID_5444317815889828530" border="0" /&gt;&lt;/a&gt;Proceeding to enter the number that appeared below my bar code, I was pleased to see my $10.00 discount applied.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ux58bmqGooQ/S44a3u9lh9I/AAAAAAAAAG8/R7LITYN-pA4/s1600-h/print_9.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 166px;" src="http://4.bp.blogspot.com/_ux58bmqGooQ/S44a3u9lh9I/AAAAAAAAAG8/R7LITYN-pA4/s400/print_9.png" alt="" id="BLOGGER_PHOTO_ID_5444318544338978770" border="0" /&gt;&lt;/a&gt;To sum up, coupon obtained, Activator thingy bypassed.  Sorry I do not have time get into how this site could have been written more securely.  Suffice it to say that exposing data, URLs, and client side logic is not good.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2281490675396238353-1782683862027873020?l=appsecnotes.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AppSecNotes/~4/j_OLcENbit4" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AppSecNotes/~3/j_OLcENbit4/dont-need-no-stinkin-coupon-print.html</link><author>noreply@blogger.com (Dave Ferguson)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_ux58bmqGooQ/S44TzB-WtPI/AAAAAAAAAFc/FpnMHE4bbYc/s72-c/email.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://appsecnotes.blogspot.com/2010/03/dont-need-no-stinkin-coupon-print.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2281490675396238353.post-8591379614773633197</guid><pubDate>Fri, 22 Jan 2010 05:36:00 +0000</pubDate><atom:updated>2010-01-22T21:24:02.207-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Tools</category><category domain="http://www.blogger.com/atom/ns#">Code Review</category><title>Counting Lines of Code</title><description>Want some interesting metrics about your code?  A nice little Windows utility called &lt;a href="http://www.locmetrics.com/"&gt;LOCmetrics&lt;/a&gt; could be just what you are looking for.  When preparing for an application source code review, I usually need an estimate for the number of lines of code involved.  I've found the numbers provided by development teams can vary significantly from what we actually see when we get the code.   That is why I am going to start recommending they run LocMetrics.&lt;br /&gt;&lt;br /&gt;LocMetrics has a simple GUI and works with &lt;span class="center"&gt;C#, C++, Java, and SQL code&lt;/span&gt;.   Run LocMetrics and it will dump out physical LOC, executable-physical LOC, and executable-logical LOC.  Plus, you get bonus information like number of comment lines, blank lines, &lt;a href="http://en.wikipedia.org/wiki/Cyclomatic_complexity"&gt;cyclomatic complexity&lt;/a&gt; (aka McCabe VG complexity) and LOC counts broken down by directory.  The most important results are shown in the GUI itself and you get a HTML file containing more detail.&lt;br /&gt;&lt;br /&gt;Here's a screen shot of the GUI:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ux58bmqGooQ/S1pp0ZhQ9YI/AAAAAAAAAFU/fmhlmwdY0zM/s1600-h/antisamy-1.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 318px;" src="http://2.bp.blogspot.com/_ux58bmqGooQ/S1pp0ZhQ9YI/AAAAAAAAAFU/fmhlmwdY0zM/s400/antisamy-1.png" alt="" id="BLOGGER_PHOTO_ID_5429768649673078146" border="0" /&gt;&lt;/a&gt;I ran LocMetrics on a few Java libraries for comparison sake.  Here are the results.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;OWASP &lt;/span&gt;&lt;a style="font-weight: bold;" href="http://www.owasp.org/index.php/Category:OWASP_AntiSamy_Project"&gt;AntiSamy&lt;/a&gt;&lt;span style="font-weight: bold;"&gt; 1.3&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family: courier new;"&gt;Lines of Code = 4,576&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;Executable physical LOC = 1,972&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt;Executable logical LOC = 1,444&lt;br /&gt;Cyclomatic complexity = 259&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;OWASP &lt;/span&gt;&lt;a style="font-weight: bold;" href="http://www.owasp.org/index.php/Category:OWASP_Enterprise_Security_API#tab=Java_EE"&gt;ESAPI &lt;/a&gt;&lt;span style="font-weight: bold;"&gt;1.4.2&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family: courier new;"&gt;Lines of Code = 21,263&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;Executable physical LOC = 8,926&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;Executable logical LOC = 6,172&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family: courier new;"&gt;Cyclomatic complexity = 1,547 &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;JSE 1.6.0_17 (java.* package only)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family: courier new;"&gt;Lines of Code = 556,018&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family: courier new;"&gt;Executable physical LOC = 200,567&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: courier new;"&gt;Executable logical LOC = 136,076&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family: courier new;"&gt;Cyclomatic complexity = 38,106 &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family: courier new;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2281490675396238353-8591379614773633197?l=appsecnotes.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AppSecNotes/~4/jrylLT62-Mo" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AppSecNotes/~3/jrylLT62-Mo/counting-lines-of-code.html</link><author>noreply@blogger.com (Dave Ferguson)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_ux58bmqGooQ/S1pp0ZhQ9YI/AAAAAAAAAFU/fmhlmwdY0zM/s72-c/antisamy-1.png" height="72" width="72" /><thr:total>3</thr:total><feedburner:origLink>http://appsecnotes.blogspot.com/2010/01/counting-lines-of-code.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2281490675396238353.post-6647925823085549214</guid><pubDate>Thu, 26 Nov 2009 00:24:00 +0000</pubDate><atom:updated>2009-11-29T12:15:27.110-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Session Management</category><category domain="http://www.blogger.com/atom/ns#">XSS</category><title>Tomcat and HttpOnly Session Cookies</title><description>Just wanted to let you know that Apache Tomcat can now be configured to use HttpOnly session cookies.  I had forgotten about &lt;a href="https://lists.owasp.org/pipermail/webappsec/2008-March/000528.html"&gt;Jim Manico's crusade&lt;/a&gt; to get HttpOnly support in Tomcat.   It is a shame that it took so long to happen.  Microsoft had &lt;a href="http://msdn.microsoft.com/en-us/library/ms533046.aspx"&gt;introduced the concept of HttpOnly cookies&lt;/a&gt; primarily as a defense against session hijacking where a cross-site scripting attack is used to steal a session cookie.  If a web application sets a cookie with the HttpOnly attribute, web browsers do not allow client-side script to access the cookie.  The first browser to support HttpOnly was Internet Explorer 6 SP1 and for a long while IE was the only browser that supported it.  That has changed as &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=178993"&gt;Firefox&lt;/a&gt; and &lt;a href="http://my.opera.com/community/forums/topic.dml?id=183209"&gt;Opera&lt;/a&gt;, for example, now support HttpOnly as well.&lt;br /&gt;&lt;br /&gt;In Tomcat, enabling HttpOnly for the JSESSIONID is done at the context level, which means it can be controlled for each individual web application.  You simply need need to add the following attribute to the &lt;a href="http://tomcat.apache.org/tomcat-6.0-doc/config/context.html"&gt;&amp;lt;context&amp;gt; element&lt;/a&gt;:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;useHttpOnly="true"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The default is "false", so you must explicitly add the line above to implement an HttpOnly session cookie. This capability first appeared in Tomcat 6.0.19 (current version = 6.0.20) as well as Tomcat 5.5.28, which is currently the latest version in the 5.5 branch.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2281490675396238353-6647925823085549214?l=appsecnotes.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AppSecNotes/~4/n0uFrs4O4cY" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AppSecNotes/~3/n0uFrs4O4cY/tomcat-and-httponly-session-cookies.html</link><author>noreply@blogger.com (Dave Ferguson)</author><thr:total>0</thr:total><feedburner:origLink>http://appsecnotes.blogspot.com/2009/11/tomcat-and-httponly-session-cookies.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2281490675396238353.post-1134930670710524176</guid><pubDate>Thu, 19 Nov 2009 02:03:00 +0000</pubDate><atom:updated>2009-11-18T23:06:17.756-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Industry</category><title>OWASP Top Ten Changing for 2010</title><description>A new version of the OWASP Top Ten will be arriving in early 2010.  At the AppSec DC conference, I attended a session by &lt;a href="http://www.owasp.org/index.php/About_OWASP#Global_Board_Members"&gt;OWASP board&lt;/a&gt; member Dave Wichers that described the proposed changes.  First, the emphasis will be on risk, whereas the 2007 version focused on the most prevalent vulnerabilities. The updated list considers not just prevalence, but also the damage level that could result from successful exploitation.&lt;br /&gt;&lt;br /&gt;The biggest changes are that &lt;span style="font-style: italic;"&gt;Malicious File Execution&lt;/span&gt; and &lt;span style="font-style: italic;"&gt;Information Leakage/Improper Error Handling&lt;/span&gt; are dropping off the list for 2010.  In their place, &lt;span style="font-style: italic;"&gt;Security Misconfiguration&lt;/span&gt; and &lt;span style="font-style: italic;"&gt;Unvalidated Redirects/Forwards&lt;/span&gt; are being added.  Some other items are shifting around.  The chart below sums up the changes very nicely.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ux58bmqGooQ/SwRkBalmocI/AAAAAAAAAFM/sxWPqBpD9NE/s1600/owasp_top10_chgs2.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 279px;" src="http://2.bp.blogspot.com/_ux58bmqGooQ/SwRkBalmocI/AAAAAAAAAFM/sxWPqBpD9NE/s400/owasp_top10_chgs2.png" alt="" id="BLOGGER_PHOTO_ID_5405555428231127490" border="0" /&gt;&lt;/a&gt;The release candidate of the new Top Ten is now available for download as a &lt;a href="http://www.owasp.org/index.php/File:OWASP_T10_-_2010_rc1.pdf"&gt;PDF document&lt;/a&gt;.  OWASP is requesting feedback on anything and everything until December 31, 2009.  I've not yet read the document in detail.  At first glance, I wonder about the naming conventions.  For example,  is "Injection" descriptive enough?   Is "misconfiguration" a real word?  Why is "Insecure Communications" changing  to the more cryptic "Insufficient Transport Layer Security"?  I guess now is the time to ask!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2281490675396238353-1134930670710524176?l=appsecnotes.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AppSecNotes/~4/TMHy89W0CqI" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AppSecNotes/~3/TMHy89W0CqI/owasp-top-ten-changing-for-2010.html</link><author>noreply@blogger.com (Dave Ferguson)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_ux58bmqGooQ/SwRkBalmocI/AAAAAAAAAFM/sxWPqBpD9NE/s72-c/owasp_top10_chgs2.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://appsecnotes.blogspot.com/2009/11/owasp-top-ten-changing-for-2010.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2281490675396238353.post-8402150818026992289</guid><pubDate>Thu, 05 Nov 2009 21:16:00 +0000</pubDate><atom:updated>2009-11-14T00:13:06.970-06:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Tools</category><category domain="http://www.blogger.com/atom/ns#">XSS</category><title>XSS via Cookie - How Severe?</title><description>Take a web application that sets a cookie.  Now let's say the application takes the cookie value included in subsequent requests and outputs it into the HTML of the responses.  Also assume this occurs with no authentication required and with no &lt;a href="http://www.owasp.org/index.php/XSS_%28Cross_Site_Scripting%29_Prevention_Cheat_Sheet#Escaping_.28aka_Output_Encoding.29"&gt;output encoding&lt;/a&gt; being done. Yes, this application is susceptible to reflected cross-site scripting.&lt;br /&gt;&lt;br /&gt;I recently tested such an application.  Interestingly, both &lt;a href="https://h10078.www1.hp.com/cda/hpms/display/main/hpms_content.jsp?zn=bto&amp;amp;cp=1-11-201-200%5E9570_4000_100__"&gt;HP WebInspect&lt;/a&gt; and &lt;a href="http://portswigger.net/scanner/"&gt;Burp's active scanner&lt;/a&gt; reported the XSS vulnerability, but they were at opposite ends of the spectrum in terms of rating its severity.  WebInspect rated it "critical" (the most severe rating), while  Burp rated it as "information", which implies you don't even need to concern yourself about it.&lt;br /&gt;&lt;br /&gt;So why the big disparity in these tools?  Is it critically severe, or is it really no big deal?  In my view, the answer is somewhere in between. This type of vulnerability is clearly very difficult to exploit.  An attacker would somehow have to cause a victim's browser to send a script-injected cookie as part of a request to the vulnerable site.  But regardless of the difficulty level, the application should properly encode the cookie value when it is written into the HTML page.  Please let me know your opinion on how serious you think this type of vulnerability is.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2281490675396238353-8402150818026992289?l=appsecnotes.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AppSecNotes/~4/m6PTgGymygw" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AppSecNotes/~3/m6PTgGymygw/xss-via-cookie-how-severe.html</link><author>noreply@blogger.com (Dave Ferguson)</author><thr:total>4</thr:total><feedburner:origLink>http://appsecnotes.blogspot.com/2009/11/xss-via-cookie-how-severe.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2281490675396238353.post-3624233286848400385</guid><pubDate>Sat, 17 Oct 2009 04:36:00 +0000</pubDate><atom:updated>2009-10-16T23:36:00.416-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Industry</category><title>Internet Safety for Parents</title><description>A friend asked me about Internet safety including how parents can protect children from the nasty stuff that's out there.  I replied by describing what I do at home.  It's probably not the perfect system, but it seems to work for me.&lt;br /&gt;&lt;br /&gt;If you know nothing about Internet safety, start by visiting the &lt;a href="http://www1.k9webprotection.com/resources/online-safety.php"&gt;resources listed here&lt;/a&gt;.  Educate yourself about Internet dangers and the kinds of protection available.&lt;br /&gt;&lt;br /&gt;In terms of filtering, I recommend using the Windows Vista built-in parental controls.  You can select age-appropriate access level, define time restrictions, view logs of sites visited, etc.  Each user must have their own login on Vista (no sharing accounts!).  If you're not using Vista, please think seriously about upgrading.  The parental controls feature alone is worth the money. However, at this point in time you should probably upgrade to &lt;a href="http://www.pcworld.com/article/173828/microsoft_gets_set_to_spin_windows_7.html"&gt;Windows 7 since its release date is near&lt;/a&gt;.  I assume it has the same or even better parental controls.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Defense_in_Depth_%28computing%29"&gt;Defense in depth&lt;/a&gt; applies in protecting children too.  So for better protection, I also recommend using BlueCoat's &lt;a href="http://www1.k9webprotection.com/getk9/index.php"&gt;K9 Web Protection&lt;/a&gt; (available for free).  It is not as flexible (all users have the same filter level), but it catches some stuff that Vista doesn't.  If you are currently stuck on Windows XP, use K9 at least.  Just remember it is not perfect.&lt;br /&gt;&lt;br /&gt;Finally, if you don't want a hacker opening a reverse shell and taking over your computer, make sure you check for software updates at least weekly!  Or, have it done automatically if possible.  These updates should include not just Windows and Anti-Virus software, but also Internet Explorer, Adobe Reader, Flash Player, Firefox, Thunderbird, Java, iTunes, etc.  &lt;p class="MsoNormal"&gt;&lt;span style=";font-family:&amp;quot;;font-size:10;"  &gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2281490675396238353-3624233286848400385?l=appsecnotes.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AppSecNotes/~4/f8SjumsAATk" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AppSecNotes/~3/f8SjumsAATk/internet-safety-for-parents.html</link><author>noreply@blogger.com (Dave Ferguson)</author><thr:total>1</thr:total><feedburner:origLink>http://appsecnotes.blogspot.com/2009/10/internet-safety-for-parents.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2281490675396238353.post-4964837421166201409</guid><pubDate>Sat, 10 Oct 2009 01:27:00 +0000</pubDate><atom:updated>2009-10-09T20:27:00.173-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Session Management</category><title>ColdFusion Session Fixation</title><description>I usually see &lt;a href="http://en.wikipedia.org/wiki/Session_fixation"&gt;session fixation&lt;/a&gt; vulnerabilities with Java web applications.  Just recently I found a ColdFusion application vulnerable to session fixation.   This nasty security hole greatly increases the risk that legitimate sessions will be hijacked.  Both HP WebInspect and Burp Pro's active scanner failed to find this vulnerability. Testing for session fixation is quite easy to do, so I ran a quick test for it manually, and I'm very glad I did.&lt;br /&gt;&lt;br /&gt;When testing for session fixation, I like to use two different browsers: IE and Firefox.  If the login page for an application is &lt;span style="color: rgb(102, 51, 0);"&gt;https://someapp.com/login&lt;/span&gt;, my test for session fixation consists of the following steps:&lt;br /&gt;&lt;ul&gt;1. Launch Firefox and navigate directly to the login page.&lt;br /&gt;&lt;br /&gt;2. Inspect the cookie(s) assigned by the application.  For a Java web app, a JSESSIONID cookie is normally set. In the case of ColdFusion, CFID and CFTOKEN cookies are typically set.&lt;br /&gt;&lt;br /&gt;3. Copy the session ID from the cookie.&lt;br /&gt;&lt;br /&gt;4. Construct a special URL that contains the session ID.&lt;br /&gt;For Java, it looks like this:&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;https://someapp.com/login.jsp;jsessionid=[sessid]&lt;/span&gt;&lt;br /&gt;For CF, it looks like this:&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;https://someapp.com/login.cfm?cfid=[cfid]&amp;amp;cftoken=[cftoken]&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;5. Open IE and configure it to run through a proxy (Burp, Paros, Fiddler2, etc.).&lt;br /&gt;&lt;br /&gt;6. Paste the special URL into the IE address bar and hit Enter (this step simulates a victim clicking on a link in an email or Internet post).&lt;br /&gt;&lt;br /&gt;7. Observe the HTTP response from the server.  Is there a "Set-Cookie" header?  If so, what is the session ID being set?  You have a problem if it's the same value that appears in the URL.  On the other hand, you're probably okay if the value is different.&lt;br /&gt;&lt;/ul&gt;The ColdFusion site I tested was handling the situation even more poorly than usual.  It was not necessary to visit the site initially to obtain legitimate session IDs from the server, so steps 1-3 above weren't required.  An attacker could make up *any* 6 digit value for "cfid" and *any* 8 digit value for "cftoken", embed the made-up values in the malicious URL, and the application happily accepted them.   The server responded by assigning CFID and CFTOKEN cookies based on the made-up values as illustrated below.&lt;br /&gt;&lt;br /&gt;The URL of the request was:&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;https://someapp.com/login.cfm?cfid=999555&amp;amp;cftoken=29292929&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The HTTP response contained the following headers:&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;Set-Cookie: CFID=999555; path=/; Secure&lt;br /&gt;Set-Cookie: CFTOKEN=29292929; path=/; Secure&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2281490675396238353-4964837421166201409?l=appsecnotes.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AppSecNotes/~4/np_jGRqO6K0" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AppSecNotes/~3/np_jGRqO6K0/coldfusion-session-fixation.html</link><author>noreply@blogger.com (Dave Ferguson)</author><thr:total>2</thr:total><feedburner:origLink>http://appsecnotes.blogspot.com/2009/10/coldfusion-session-fixation.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2281490675396238353.post-3678827731318019967</guid><pubDate>Sat, 03 Oct 2009 06:31:00 +0000</pubDate><atom:updated>2011-07-01T21:52:50.754-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Industry</category><category domain="http://www.blogger.com/atom/ns#">Forgot Password</category><title>Who Has the Answers to Your Security Questions?</title><description>I'm back after a summer that was crazy busy for me.  Recently, I had two eye-opening occurrences where other people viewed the answers to my personal security questions - you know, those questions that web sites ask in case you forget your password.  These incidents weren't security breaches, just normal business processes that appear to be more prevalent than I thought.&lt;br /&gt;&lt;br /&gt;In the first incident, I got a new cell phone for my daughter at a retail store of one of the major providers. I gave the clerk my cell number so he could look up my account and he then asked for my "PIN".  I didn't know it. I knew my password for their site, but that's not what he wanted (I wouldn't have told him anyway).   Since I didn't know my PIN, the clerk followed up by asking me "What's the model of your first car?".  Whoa.  I proceeded to answer the question.  He looked at his monitor and said "okay, good".&lt;br /&gt;&lt;br /&gt;The other incident involved Vanguard again.  I got locked out of their site (not just &lt;a href="http://appsecnotes.blogspot.com/2009/06/vanguardcom-doesnt-recognize-me.html"&gt;unrecognized like last time&lt;/a&gt;). The darn thing wouldn't even allow me to answer my security questions.  Forced to call Vanguard customer service, I explained to the CSR that I was completely locked out.  Wouldn't you know the CSR simply asked me to answer two of my security questions?  I provided the correct answers, and he immediately unlocked my account allowing me to log in again.&lt;br /&gt;&lt;br /&gt;Moral to the story: These answers are not simply being used programmatically or being treated as confidential data.  Realize that the answers to your personal security questions could be viewed by other people in many cases.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2281490675396238353-3678827731318019967?l=appsecnotes.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AppSecNotes/~4/P2SIp1py_sU" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AppSecNotes/~3/P2SIp1py_sU/who-has-answers-to-your-security.html</link><author>noreply@blogger.com (Dave Ferguson)</author><thr:total>0</thr:total><feedburner:origLink>http://appsecnotes.blogspot.com/2009/10/who-has-answers-to-your-security.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2281490675396238353.post-7288956190079649624</guid><pubDate>Wed, 24 Jun 2009 23:44:00 +0000</pubDate><atom:updated>2009-06-25T08:22:41.505-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Industry</category><title>Vanguard.com Doesn't "Recognize" Me</title><description>I upgraded the hard drive on my home computer.  The first time I tried to log into my &lt;a href="https://personal.vanguard.com/us/home"&gt;Vanguard account online&lt;/a&gt;, it asked me to answer a security question.  No problem I thought to myself.  The site just doesn't recognize me since I have a new drive.  It wants extra information to be sure I'm me.  This is part of &lt;a href="http://en.wikipedia.org/wiki/SiteKey"&gt;PassMark "sitekey"&lt;/a&gt; functionality.  I typed in the answer to the question and was promptly told "sorry, invalid answer".  Weird.  I tried again. same result.  I was 95% sure I was entering the correct answer, but each time I tried, it didn't work.  Eventually I got an email telling me I disabled my ability to log in from an unrecognized computer due to repeated wrong answers.  Nice.  The web site didn't inform me of this - only the email.  The email also stated I could now only log in if I used a recognized computer.  To log in from an unrecognized computer, I would have to reset my security questions or call Vanguard customer service.  Great.&lt;br /&gt;&lt;br /&gt;Luckily, I had logged into Vanguard from my work computer, meaning it was "recognized" and I wasn't asked a security question.  Using my work computer, I logged in and reset my security questions and answers as required.  Now back to my home computer.  I was quite confident facing a security question this time. But again, failure!  Why does it not accept my answer?  I was 100% sure it was correct this time.  I just reset them for cryin' out loud.&lt;br /&gt;&lt;br /&gt;At this point I concluded that it was a bug in Vanguard's site.  Do I call their customer support?  Ugh.  Instead I took the approach of trying to get the site to "recognize" my home computer.  Long story short, I copied a single file from my work computer to my home computer and solved the problem.  I knew the PassMark/sitekey solution uses a &lt;a href="http://en.wikipedia.org/wiki/Local_Shared_Object"&gt;Flash local shared object&lt;/a&gt; to determine whether a computer is recognized.  It does not use a persistent cookie as you might first guess.  Anyway, I found the shared object file "PassMark.sol" in the following directory on my work computer:&lt;br /&gt;&lt;br /&gt;C:\Documents and Settings\[user]\Application Data\Macromedia\Flash Player\#SharedObjects\xxxxxxxx\vanguard.com\passmark\flash\pmfso.swf&lt;br /&gt;&lt;br /&gt;where "xxxxxxxx" changes for different users.  I copied PassMark.sol over to the corresponding directory on my home computer and it worked like a charm!  Vanguard's site suddenly recognized my home computer and I got logged in.&lt;br /&gt;&lt;br /&gt;This episode was very frustrating and got me wondering how normal users feel.  After all, I was only able to solve the problem with:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Luck  - I had another computer that was recognized&lt;/li&gt;&lt;li&gt;Esoteric knowledge - Vanguard's site uses Flash shared objects to recognize a computer&lt;/li&gt;&lt;/ul&gt;The vast majority of users are not web application security experts.  They must be going crazy, and on the phone with support a lot.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2281490675396238353-7288956190079649624?l=appsecnotes.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AppSecNotes/~4/XXFE5jyp2pg" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AppSecNotes/~3/XXFE5jyp2pg/vanguardcom-doesnt-recognize-me.html</link><author>noreply@blogger.com (Dave Ferguson)</author><thr:total>2</thr:total><feedburner:origLink>http://appsecnotes.blogspot.com/2009/06/vanguardcom-doesnt-recognize-me.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2281490675396238353.post-875821160399832050</guid><pubDate>Tue, 09 Jun 2009 02:42:00 +0000</pubDate><atom:updated>2009-06-08T22:42:19.628-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Industry</category><title>Patent Abuse?</title><description>This is not strictly an application security post, but I just read &lt;a href="http://dallas.bizjournals.com/dallas/stories/2009/06/08/story2.html"&gt;an amazing article&lt;/a&gt; about a security/tech company here in Dallas.  I had never heard of &lt;a href="http://www.deepnines.com/"&gt;DeepNines, Inc.&lt;/a&gt; even though I live in DFW and work in the information security field.   Based on the article, my first impression of DeepNines is not good.  Apparently they won an $18 million settlement against McAfee because McAfee violated their patent.  Their patent is "for detecting attacks on a site in a communications network and for taking actions to reduce and/or redirect such attacks".  Not satisfied with their windfall, they are suing again, this time Secure Computing, which was just acquired by... McAfee.  Now McAfee has to deal with them all over again!&lt;br /&gt;&lt;br /&gt;This looks like an egregious case of &lt;a href="http://en.wikipedia.org/wiki/Patent_troll"&gt;patent trolling&lt;/a&gt; to me.  How could a patent be granted for such a thing? Patents are supposed to be  "nonobvious to a person having ordinary skill in the area of technology          related to the invention" (&lt;a href="http://www.uspto.gov/web/offices/pac/doc/general/index.html#novelty"&gt;ref&lt;/a&gt;).  It's highly questionable that's true here.  It's like patenting a steering wheel as "the process of taking an action to cause the rotation about a vertical axis the front-most wheels of a vehicle causing said vehicle to turn in a rightward or leftward direction."&lt;br /&gt;&lt;br /&gt;One of my previous employers is &lt;a href="http://www.touchnet.com/newsroom/letter_to_customers.htm"&gt;dealing with something very similar&lt;/a&gt;.  It's too bad there are companies that don't like to compete on the merits of their technology or customer service.  They find it easier to acquire questionable patents and then sue the pants off anyone they see as a threat.  For some companies, patent trolling actually seems to be the true business model.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2281490675396238353-875821160399832050?l=appsecnotes.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AppSecNotes/~4/NYaFUtGtWbY" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AppSecNotes/~3/NYaFUtGtWbY/patent-abuse.html</link><author>noreply@blogger.com (Dave Ferguson)</author><thr:total>0</thr:total><feedburner:origLink>http://appsecnotes.blogspot.com/2009/06/patent-abuse.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2281490675396238353.post-9211751985937389874</guid><pubDate>Thu, 28 May 2009 01:47:00 +0000</pubDate><atom:updated>2009-05-27T22:24:18.211-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Session Management</category><title>Simultaneous Sessions for a Single User</title><description>It's a common request or recommendation that a web application not allow a user to have more than one session active at a time.  In other words, after a user logs into an application, he should not be permitted to open a different type of browser (or use another computer) to log in again until his first session has ended.  I've recommended this myself, but it's always been kind of muddy as to why this should be done. It is not trivial to implement this feature in the code.  Recently, one of our clients wanted to better understand the reasons behind this recommendation.  I was given the task of explaining.&lt;br /&gt;&lt;br /&gt;The bottom line is that I could not find one strong, clear-cut reason for disallowing simultaneous sessions for a single user. There are a number of scenarios where it might help.  Listed below are the reasons I came up with for implementing this feature.  Please let me know if you have other ideas on this subject.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;An application has a licensing scheme that allows only a limited number of concurrent users or requires users to pay for access or premium content.  A technical control to prevent simultaneous sessions for a single user ID would limit the financial harm caused by users sharing login credentials.&lt;/li&gt;&lt;li&gt;It is out of the ordinary for a user to be logged in from more than one location (or more than one type of browser) for a given point in time. Anything out of the ordinary should be assumed to be a potential security risk.&lt;/li&gt;&lt;li&gt;&lt;o:p&gt;&lt;/o:p&gt;An attacker somehow steals a user's credentials (perhaps by sniffing unencrypted HTTP traffic) while the user was authenticating to the application.  The attacker immediately tries to log in with the stolen credentials. The application sees that the user is already logged in and returns an error to the attacker, thus temporarily protecting the account.&lt;/li&gt;&lt;li&gt;&lt;o:p&gt;&lt;/o:p&gt;An attacker shoulder surfs to obtain a valid username (but not the password).  He then immediately proceeds to run a password guessing or dictionary attack hoping to determine the password.  If his attack happens to be successful during the time the legitimate user is logged in, it would prevent the attacker from gaining access.&lt;/li&gt;&lt;li&gt;&lt;o:p&gt;&lt;/o:p&gt;An attacker and a victim log in such that their sessions overlap.  The application displays an error message that alerts the victim that someone else is using his account.   The victim may contact the site owner, spurring an investigation, which might uncover a compromised account.&lt;/li&gt;&lt;li&gt;&lt;o:p&gt;&lt;/o:p&gt;It could help ensure data integrity and non-repudiation.  A user may have multiple authenticated sessions at the same time, and one of the sessions might be used to make a critical change.  If a user claims he never made such a change, it could be a problem for the logs to show that two authenticated sessions existed and the user claims he was logged in only once.&lt;/li&gt;&lt;li&gt;&lt;o:p&gt;&lt;/o:p&gt;It could help defend against a malicious user who wishes to overload the server memory by creating an excessive number of authenticated sessions.  Authenticated sessions typically use much more memory on the server than unauthenticated sessions.  With valid credentials and no limit to simultaneous sessions, a user could potentially create a denial-of-service condition.&lt;/li&gt;&lt;/ul&gt;After my research, I came to the conclusion that disallowing simultaneous sessions often does not increase an application's security posture enough to justify the required development and implementation cost.  Obviously there are some special situations, like the licensing issue, where it could make sense.&lt;br /&gt;&lt;br /&gt;This feature may actually introduce new problems.  Let's say a user logs into an application and his machine crashes or the power goes out.  A few minutes later, when trying to log in again, the user is denied access and told he's already logged in.  Of course, it's true from the server's perspective (his session is still active), but now there's an angry user shouting profanities at his computer.  Unless the user knows his previous session ID (fat chance), there's nothing for him to do but wait until the session expires due to inactivity or call your customer service department and complain.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2281490675396238353-9211751985937389874?l=appsecnotes.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AppSecNotes/~4/ycjmMF_-5Oc" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AppSecNotes/~3/ycjmMF_-5Oc/simultaneous-sessions-for-single-user.html</link><author>noreply@blogger.com (Dave Ferguson)</author><thr:total>12</thr:total><feedburner:origLink>http://appsecnotes.blogspot.com/2009/05/simultaneous-sessions-for-single-user.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2281490675396238353.post-6735172182460447160</guid><pubDate>Mon, 18 May 2009 22:54:00 +0000</pubDate><atom:updated>2009-05-18T23:27:22.169-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Architecture/Design</category><title>The Importance of Case-Sensitive Passwords</title><description>It is rare that I encounter a web application that doesn't support case-sensitive user passwords.  But it still happens.  In my experience this often occurs not because the application developers weren't cognizant of security, but because the authentication is actually processed by an old, backend system that doesn't support case-sensitive passwords.  Let's review why implementation of case sensitive passwords is so important.&lt;br /&gt;&lt;div style="text-align: justify;"&gt;&lt;span style="text-decoration: underline;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;At first you might think that having case-sensitive passwords would double the number of possible passwords.  Of course, that is not how it works.  Let's say a user decides he wants a password of "orange7".   Without case sensitivity, the number of possible passwords for this user is exactly one.  But with a case-sensitive password, the user can choose from &lt;span style="font-weight: bold; font-style: italic;"&gt;sixty-four&lt;/span&gt; possible passwords:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;orange7 Orange7 oRange7 orAnge7 oraNge7 oranGe7&lt;br /&gt;orangE7 ORange7 OrAnge7 OraNge7 OranGe7 OrangE7&lt;br /&gt;oRAnge7 oRaNge7 oRanGe7 oRangE7 orANge7 orAnGe7&lt;br /&gt;orAngE7 oraNGe7 oraNgE7 oranGE7 ORAnge7 OrANge7&lt;br /&gt;OraNGe7 OranGE7 OrAnGe7 OrAngE7 OraNgE7 ORaNge7&lt;br /&gt;ORanGe7 ORangE7 oRANge7 oRaNGe7 oRanGE7 oRAnGe7&lt;br /&gt;oRAngE7 orANGe7 orAnGE7 orANgE7 oraNGE7 oRaNgE7&lt;br /&gt;orANGE7 oRaNGE7 oRAnGE7 oRANgE7 oRANGe7 OraNGE7&lt;br /&gt;OrAnGE7 OrANgE7 OrANGe7 ORanGE7 ORaNgE7 ORaNGe7&lt;br /&gt;ORAngE7 ORAnGe7 ORANge7 oRANGE7 OrANGE7 ORaNGE7&lt;br /&gt;ORAnGE7 ORANgE7 ORANGe7 ORANGE7&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;So, having case-sensitive passwords vastly increases the universe of possible passwords and sets the bar significantly higher for hackers running brute force or dictionary attacks on a web application.   For example, 64 passwords must be checked versus only one in the scenario presented here.&lt;br /&gt;&lt;br /&gt;As an end-user, be sure to take advantage of case sensitivity to strengthen the security of your account.  Use a mixture of upper and lower case letters.  It may prevent a lazy or time-crunched attacker -- who checks lower case passwords only -- from compromising your account.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2281490675396238353-6735172182460447160?l=appsecnotes.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AppSecNotes/~4/1eAZAe0aQeA" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AppSecNotes/~3/1eAZAe0aQeA/importance-of-case-sensitive-passwords.html</link><author>noreply@blogger.com (Dave Ferguson)</author><thr:total>0</thr:total><feedburner:origLink>http://appsecnotes.blogspot.com/2009/05/importance-of-case-sensitive-passwords.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2281490675396238353.post-4764727469591048232</guid><pubDate>Thu, 14 May 2009 01:05:00 +0000</pubDate><atom:updated>2009-05-13T20:05:00.116-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Tools</category><title>IE Developer Toolbar Follow-Up</title><description>In an &lt;a href="http://appsecnotes.blogspot.com/2009/01/ie-developer-toolbar-incompatible-with.html"&gt;earlier post&lt;/a&gt;, I had commented on the fact that the IE Developer Toolbar has a problem in that it doesn't report cookies that are marked with the "HttpOnly" attribute.  Well, as they said in the movie Independence Day, that's not entirely accurate (&lt;a href="http://new.wavlist.com/movies/059/id-area51.wav"&gt;clip&lt;/a&gt;).  There is an exception.  The exception is when the cookie is a persistent cookie.  The tool apparently doesn't utilize JavaScript in that case, and correctly reports the existence of the cookie.  It's not actually a situation that would occur very often.  Applications normally only need to mark *sensitive* cookies with HttpOnly, and sensitive cookies should not be persistent in the first place.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2281490675396238353-4764727469591048232?l=appsecnotes.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AppSecNotes/~4/6qEH9BiVUTw" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AppSecNotes/~3/6qEH9BiVUTw/ie-developer-toolbar-follow-up.html</link><author>noreply@blogger.com (Dave Ferguson)</author><thr:total>0</thr:total><feedburner:origLink>http://appsecnotes.blogspot.com/2009/05/ie-developer-toolbar-follow-up.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2281490675396238353.post-6418569552771053175</guid><pubDate>Sat, 25 Apr 2009 18:05:00 +0000</pubDate><atom:updated>2009-04-26T13:14:50.937-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">XSS</category><title>More on Blacklisting and XSS</title><description>Following up on my last post, another scenario where blacklisting of angle brackets doesn't work to stop XSS is where untrusted data is output into an existing section of script. Consider a JSP application that takes a URL parameter and outputs it within opening and closing &amp;lt;script&amp;gt; tags.  If encoding is not being done, which it often isn't, then an XSS attack would be possible.  An attacker would simply close the previous executable line of script with a semicolon and immediately follow that with his malicious script.&lt;br /&gt;&lt;br /&gt;An example of how this might occur is shown below.  A JSP defines a JavaScript function called "gotoPreferences()", which causes the browser to re-navigate to a URL ("prefURL").  Note that prefURL is constructed dynamically by incorporating untrusted data -- the "category" parameter.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;&amp;lt;script type="JavaScript"&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;function gotoPreferences()&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;var prefURL="https://www.server.com/prefs.jsp?category=" + &amp;lt;%= request.getParameter("category") %&amp;gt; + ";"&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;location.href=prefURL;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;To exploit XSS, an attacker might set the value of "category" to: &lt;span style=";font-family:courier new;font-size:85%;"  &gt;&lt;br /&gt;&lt;br /&gt;"";location.href="http://www.evilsite.com"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The resulting line in the HTML would then be:&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div style="text-align: left;"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;  var prefURL="https://www.server.com/prefs.jsp?category=" + "";location.href="http://www.evilsite.com";&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;When the function was called, the victim would be navigated to the attacker's site instead of the expected URL.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2281490675396238353-6418569552771053175?l=appsecnotes.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AppSecNotes/~4/e1d39hs40eU" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AppSecNotes/~3/e1d39hs40eU/more-on-blacklisting-and-xss.html</link><author>noreply@blogger.com (Dave Ferguson)</author><thr:total>0</thr:total><feedburner:origLink>http://appsecnotes.blogspot.com/2009/04/more-on-blacklisting-and-xss.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-2281490675396238353.post-7873083368992973502</guid><pubDate>Fri, 24 Apr 2009 04:26:00 +0000</pubDate><atom:updated>2009-04-24T10:04:42.660-05:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">XSS</category><title>Blacklisting and XSS Failures</title><description>Looking at a financial application, I was somewhat surprised to see blacklisting of angle brackets used as the main countermeasure against cross-site scripting.  Stripping angle brackets or throwing an error every time you see one in a request is not sufficient protection against XSS. There were a couple of ways to exploit XSS in this application despite the rigorous rejection of angle brackets.&lt;br /&gt;&lt;br /&gt;One attack vector was due to a page that accepted a parameter containing a relative URL to another page in the application.  It ended up being a tailor-made way for someone to avoid the blacklisting altogether.  When a request was received, this special page caused a forward (not a redirect) to the specified URL. The code that rejected angle brackets was hit on the &lt;span style="font-style: italic;"&gt;request from the client only&lt;/span&gt;, and not when the forwarding was done.  Therefore, "&lt;" and "&gt;" could be slipped in by double URL-encoding them in the initial request as follows: &lt;span style="font-family:courier new;"&gt;%253C&lt;/span&gt; and &lt;span style="font-family:courier new;"&gt;%253E&lt;/span&gt; (&lt;span style="font-family:courier new;"&gt;%25&lt;/span&gt; is a URL-encoded percent sign).&lt;br /&gt;&lt;br /&gt;The other XSS attack vector was via JavaScript event handlers.  This technique is available when user-supplied data is output to the attribute list of a page element.  This often happens for an &amp;lt;input&amp;gt; tag, where the HTML form has multiple text inputs.  The user enters the data, but one or two values may be invalid, so the application returns the same page and prepopulates the values that were entered.  An attacker can employ XSS by closing off the previous attribute with a double-quote (assuming double-quotes were used) and injecting an event handler such as onMouseOver, onFocus, or onClick.&lt;br /&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;An example injection is: &lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;x%22%20onFocus%3d%22alert('xss')%22%20%22&lt;/span&gt;&lt;/span&gt;.  The resulting HTML might look like this:&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;&amp;lt;input type="text" name="val5" value="&lt;span style="color: rgb(255, 0, 0);"&gt;x" onFocus="alert('xss')" ""&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Notice there were no angle brackets used in this attack, so blacklisting those characters did not provide any protection.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/2281490675396238353-7873083368992973502?l=appsecnotes.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/AppSecNotes/~4/41VfjA480jM" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/AppSecNotes/~3/41VfjA480jM/blacklisting-and-xss-failures.html</link><author>noreply@blogger.com (Dave Ferguson)</author><thr:total>0</thr:total><feedburner:origLink>http://appsecnotes.blogspot.com/2009/04/blacklisting-and-xss-failures.html</feedburner:origLink></item></channel></rss>

