tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject [OT] Protecting against HTTP response splitting
Date Wed, 30 Mar 2011 20:12:08 GMT
Hash: SHA1


I was playing around with findbugs today and saw a security warning I've
never seen before: "HTTP parameter directly written to HTTP header
output in []".

I read a bit more into it and the warning was correct, I was doing
something akin to the following:


Aside from not running the redirect through response.encodeRedirectURL,
there's another potential problem, there: the user can specify a return
URL that breaks the HTTP response and can do some evil things. I
verified that I can break my own response in this way by adding "%0d%0a"
and then more stuff to my "returnURL" parameter and I magically escaped
the "Location" header of the response.

The suggested mitigation is to URL-encode the value before putting it
into the header.

I was wondering if anyone was doing anything like this and has a
suggestion for allowing the UI to control it's own "return to" URLs in a
safe way. We'd like to use returnURL values that allow for query
parameters to be passed-back to the target URL so we can't just blindly
URL-encode the URL otherwise those parameters will become part of the
URL and not the query string.

I suppose I could also just look for and replace whitespace, which is
not legal in a URL anyway.

Any other thoughts of suggestions?

- -chris
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla -


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message