-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Description
David Mas (Migrated from SEC-1790) said:
AbstractAuthenticationTargetUrlRequestHandler#determineTargetUrl(HttpServletRequest, HttpServletResponse) calls URLDecoder.decode, and the result is directly feed to DefaultRedirectStrategy by default, which does not filter line feeds, injecting a custom header after "Location"
Request:
GET
/mywebapp/logout/spring-security-redirect=%0d%0a%20SomeCustomInjectedHeader%3ainjected_
by_wvs HTTP/1.1
Response:
HTTP/1.1 302 Moved Temporarily
Date: Tue, 19 Jul 2011 15:28:57 GMT
Location: xxxxxxxxxxxxxxx
SomeCustomInjectedHeader: injected_by_wvs
Content-Length: 0
Connection: close
Content-Type: text/plain; charset=UTF-8
You need to restrict CR(0x13) and LF(0x10) from the user input or properly encode the output in order to prevent the injectino of custom HTTP headers.