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.




Network Security Web-App-Sec
[Top] [All Lists]

Re: Potential XSS errors when using information from HTTP requests

Subject: Re: Potential XSS errors when using information from HTTP requests
Date: Mon, 18 Oct 2004 08:16:00 +0200
Hi

On 16 Oct 2004 at 14:27, V.Benjamin Livshits wrote:

I've been seeing a lot of redirects like the ones below in J2EE
programs.     

1.    response.sendRedirect(request.getParameter("REFERRER"));


If you really mean that there is a parameter named REFERRER (and not 
the HTTP request header, which is, BTW, spelled "Referer" [sic!]), 
then this is a classic example for the security vulnerability called 
"HTTP Response Splitting" (see the paper "Divide and Conquer - HTTP 
Response Splitting, Web Cache Poisoning Attacks, and Related Topics" 
by yours truly at:
http://www.sanctuminc.com/pdf/WhitePaper_HTTPResponse.pdf).
One of the consequences of this vulnerability is indeed the ability 
to run an XSS attack against IE in a redirection scenario, which is 
exactly what you have here (it's all in the paper). 
Note that without using HTTP Response Splitting, you stand a 
challenge in doing XSS for IE in a redirection scenario, because IE 
does not parse the 3xx response body - it follows the Location header 
and ignores the body.

2.    response.sendRedirect(request.getRequestURI());
      
3.    response.sendRedirect(request.getServletPath() + toPath);

Again, if toPath uses user input (such as 
toPath=getParameter("toPath")), then this may be vulnerable to HTTP 
Response Splitting (see above).

Since the URL the user is being redirected to comes from the HTTP
header, I was wondering if forging parts of the header may lead to a
cross-site scripting exploit of some sort. Clearly, it would be
dangerous to use this data as part of SQL statements. However, I have
trouble imagining XSS exploit scenarios.

Thanks,

-Ben




<Prev in Thread] Current Thread [Next in Thread>