Ethical Hacking Learn to find vulnerabilities before the bad guys do! Gain real world hands on hacking experience in our state of the art hacking lab. Course designed and taught by expert instructors with years of penetration testing experience. 12 student maximum in every class. Certification attempt included in every package. | Computer Forensics Training at InfoSec Institute Gain the in-demand skills of a certified computer examiner, learn to recover trace data left behind by fraud, theft, and cybercrime perpetrators. Discover the source of computer crime and abuse at your organization so that it never happens again. All of our class sizes are guaranteed to be 12 students or less to facilitate one-on-one interaction with one of our expert instructors. |

| Subject: | Re: [WEB SECURITY] Execution before Authentication Vulnerabilities |
|---|---|
| Date: | Sat, 20 May 2006 11:34:09 -0400 |
Unfortunately, I too have seen this before in web assessments. I highlighted an SQL Injection example of this problem in my book "Preventing Web Attacks with Apache." This is from the "Mitigating the WASC Threat Classification with Apache" chapter - http://www.awprofessional.com/articles/article.asp?p=442984&seqNum=7 and shows the same problem where the web appliction is executing the HTTP request before validating the user's session data.
Real-Life SQL Error Message Disclosure
I was contracted in May of 2005 to do a web assessment for a power company's customer portal web site. In order to track the user's identity, the application used two cookie values:
Customer_number—the user's account number with the company. Identification_hash—a hashed value of an authenticated user.
During the assessment, I found numerous security vulnerabilities with how their back-end database and PHP web pages validated the user credentials in the cookie values and presented data back to the client. For instance, when submitting a request to view my current bill statement, I removed the cookie values from my request and the application responded with this SQL error message:
====================================================== HTTP/1.1 302 Found Date: Sat, 21 May 2005 12:58:40 GMT Server: Apache/1.3.33 (Unix) mod_ssl/2.8.22 OpenSSL/0.9.7g Location: /login.php?refering_php=/bill/currentbill.php Connection: close Content-Type: text/html <HTML> <!--displaybill.php--> <BR> Error in selecting SELECT max(billdate) FROM billing where custnumber = <BR> <BR> error: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 <BR> <!--formbill_1.php-->
There are two important things to notice here:
The HTTP Response Code was a 302 Found and included a Location header that is supposed to tell the browser to go to the specified page. In looking at the Location header, it appears that the application is instructing the browser to take the user back to the login page while showing where the client came from. The problem is that the web application has already processed the request and is providing the data in the payload of the request. It is just asking that the browser not show this information. This is an extremely poor method for protecting against information disclosure attacks as it relies on the security of the client's browser to send the client to the correct location and to not show them the payload of the request. As you can see in the response output, all I had to do to view this data was to run a sniffer and intercept this data.
The HTML at the bottom of the response shows the MySQL error messages. This data may help an attacker to better plan an attack as it discloses the database table format in the "SELECT max(billdate) FROM billing where custnumber =" line.
These types of verbose error messages should not be sent to clients.
-- Ryan C. Barnett Web Application Security Consortium (WASC) Member CIS Apache Benchmark Project Lead SANS Instructor: Securing Apache GCIA, GCFA, GCIH, GSNA, GCUX, GSEC Author: Preventing Web Attacks with Apache
------------------------------------------------------------------------- Sponsored by: Watchfire
https://www.watchfire.com/securearea/appscansix.aspx?id=701300000007t9c --------------------------------------------------------------------------
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: MYSQL and PHP, Σπυρίδων Νίνος |
|---|---|
| Next by Date: | Re: Non SSL Bank Login Forms, Jason Muskat |
| Previous by Thread: | Non SSL Bank Login Forms, wilson . amajohn |
| Next by Thread: | Write-up by Amit Klein: "IE + some popular forward proxy servers = XSS, defacement (browser cache poisoning)", Amit Klein (AKsecurity) |
| Indexes: | [Date] [Thread] [Top] [All Lists] |