HTTP response splitting can occur due to the failure of applications to properly sanitize Carriage Return/Line Feed (CRLF) sequences in HTTP headers. HTTP response splitting allows an attacker to send a single HTTP request that causes the affected web server to form an output response stream that is interpreted by the client as two separate HTTP responses. The attacker has little control over the first HTTP response, but may fully control the second HTTP response. The server fails to properly validate the initial request, creating the malformed response as a result. Hence, applications that are affected by this type of vulnerability do not properly validate these malformed HTTP
responses. This attack method allows for numerous other exploits against web applications.
Exploitation requires the attacker to identify user-controllable input that causes arbitrary HTTP header injections. The attacker must also have the ability to submit malicious input that contains data to terminate the original HTTP response and initiate a second attacker-controlled response. This causes the targeted application to send two responses to the web client: one that contains the attacker-supplied response and one that is a nonmalicious response.
HTTP response splitting attacks could allow attackers to perform cross-site scripting attacks. A cross-site scripting attack could allow an attacker to include and render HTML or execute arbitrary script code in a user's browser in the security context of a vulnerable web application. The attacker could obtain sensitive information associated with the browser session, such as authentication cookies or recently submitted data.
Attacks could also include cross-user defacement, which is a temporary defacement that causes a website to appear defaced to the targeted user. Attackers could hijack web pages to obtain sensitive information, which is a common phishing technique. Attackers could also poison web caches, including individual browser caches or multiuser caching proxy systems, which may aid in spoofing or phishing attacks against multiple users.
To mitigate HTTP response splitting attacks, administrators should implement positive input sanitization in which only those characters that are specifically expected and permitted are allowed. In situations in which positive filtering is not possible, negative input sanitization techniques should filter CRLF sequences except where they are expected.