HTTP response splitting
The HTTP protocol uses CRLF sequences to end headers, lines and so on. When input vectors are reflected in the HTTP responses, if attackers can inject CRLF sequences, they can craft an arbitrary HTTP response. For example, this could lead to reflected XSS as the attackers would have the ability to inject arbitrary HTML content in the response.
Testers need to find input vectors that could be reflected in HTTP responses.
- GET or POST parameters (like
For example, in the following request line, the GET parameter
pageis not sanitized enough and a CRLF sequence (
%0D%0A) can be injected.
GET /index.php?question=answer%0D%0AInjection:%20Pwned%0D%0A HTTP/1.1
Injectionheader is then reflected in the HTTP response, right after the legitimate
HTTP/1.1 200 OK
A CRLF injection vulnerable input vector can lead to HTTP response splitting that can in turn lead to
- Reflected XSS
- Sensitive Information Disclosure
Headers are separated with the body by two CRLF sequences (
The following payload injects two headers and a
scripttag in the body.