Skip to content

SEC-1790: URL spring-security-redirect parameters vulnerable to CRLF injection by default. #2014

@spring-projects-issues

Description

@spring-projects-issues

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: webAn issue in web modules (web, webmvc)type: bugA general bugtype: jiraAn issue that was migrated from JIRA

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions