HTTP Header Injection, CWE-113, ssdc.ups.com, DORK

CWE-113: Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Response Splitting')

Report generated by CloudScan Vulnerability Crawler at Mon Feb 14 10:05:33 CST 2011.


The DORK Report

Loading

1. HTTP header injection

2. Cookie without HttpOnly flag set



1. HTTP header injection  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://ssdc.ups.com
Path:   /dcslnrz6vne3g9s37bjvj8khc_2v8x/dcs.gif

Issue detail

The value of REST URL parameter 1 is copied into the Location response header. The payload 69fa6%0d%0abfff5ec0752 was submitted in the REST URL parameter 1. This caused a response containing an injected HTTP header.

Issue background

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.

Request

GET /dcslnrz6vne3g9s37bjvj8khc_2v8x69fa6%0d%0abfff5ec0752/dcs.gif?x=1&dcsdat=1297527437124&dcssip=www.ups.com&dcsuri=/&WT.tz=-6&WT.bh=10&WT.ul=en-US&WT.cd=16&WT.sr=1920x1200&WT.jo=Yes&WT.ti=Shipping,%20Freight,%20Logistics%20and%20Supply%20Chain%20Management%20from%20UPS&WT.js=Yes&WBPM_ver=1.0.12&WBPM_ac=0&pgf_Site=Global%20Home&pCC=US&pLL=en&pSA=Global%20Entry%20Point&pSU=Global%20Entry&pPID=homepage/ent.html&pPS=0&pCS=F&pSS=400,3&pJSV=0111&pCV=0111&pLI=1 HTTP/1.1
Host: ssdc.ups.com
Proxy-Connection: keep-alive
Referer: http://www.ups.com/
Accept: */*
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.98 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: webappcommon.cclamp.usb.acceptsCookie=Yes

Response

HTTP/1.1 302 Found
Date: Sat, 12 Feb 2011 16:16:18 GMT
Server: Apache/2.2.3 (Red Hat)
Location: /dcslnrz6vne3g9s37bjvj8khc_2v8x69fa6
bfff5ec0752
/dcs.gif?dcsredirect=1&x=1&dcsdat=1297527437124&dcssip=www.ups.com&dcsuri=/&WT.tz=-6&WT.bh=10&WT.ul=en-US&WT.cd=16&WT.sr=1920x1200&WT.jo=Yes&WT.ti=Shipping,%20Freight,%20Logistics%20and%20Supply%20Chain%20Management%20from%20UPS&WT.js=Yes&WBPM_ver=1.0.12&WBPM_ac=0&pgf_Site=Global%20Home&pCC=US&pLL=en&pSA=Global%20Entry%20Point&pSU=Global%20Entry&pPID=homepage/ent.html&pPS=0&pCS=F&pSS=400,3&pJSV=0111&pCV=0111&pLI=1
Set-Cookie: UPS_ID=173.193.214.243-1297527378.860464::9B7F629720C31D6159C8C1B26A2D; expires=Tue, 09-Feb-2021 16:16:18 GMT; path=/
Last-Modified: Wed, 07 Jul 2010 18:50:24 GMT
ETag: "1001e-2b-48ad0a477fc00"
Accept-Ranges: bytes
Content-Length: 43
Connection: close
Content-Type: image/gif

GIF89a.............!.......,...........D..;

2. Cookie without HttpOnly flag set  previous

Summary

Severity:   Information
Confidence:   Certain
Host:   http://ssdc.ups.com
Path:   /dcslnrz6vne3g9s37bjvj8khc_2v8x/dcs.gif

Issue detail

The following cookie was issued by the application and does not have the HttpOnly flag set:The cookie does not appear to contain a session token, which may reduce the risk associated with this issue. You should review the contents of the cookie to determine its function.

Issue background

If the HttpOnly attribute is set on a cookie, then the cookie's value cannot be read or set by client-side JavaScript. This measure can prevent certain client-side attacks, such as cross-site scripting, from trivially capturing the cookie's value via an injected script.

Issue remediation

There is usually no good reason not to set the HttpOnly flag on all cookies. Unless you specifically require legitimate client-side scripts within your application to read or set a cookie's value, you should set the HttpOnly flag by including this attribute within the relevant Set-cookie directive.

You should be aware that the restrictions imposed by the HttpOnly flag can potentially be circumvented in some circumstances, and that numerous other serious attacks can be delivered by client-side script injection, aside from simple cookie stealing.

Request

GET /dcslnrz6vne3g9s37bjvj8khc_2v8x/dcs.gif?x=1&dcsdat=1297527437124&dcssip=www.ups.com&dcsuri=/&WT.tz=-6&WT.bh=10&WT.ul=en-US&WT.cd=16&WT.sr=1920x1200&WT.jo=Yes&WT.ti=Shipping,%20Freight,%20Logistics%20and%20Supply%20Chain%20Management%20from%20UPS&WT.js=Yes&WBPM_ver=1.0.12&WBPM_ac=0&pgf_Site=Global%20Home&pCC=US&pLL=en&pSA=Global%20Entry%20Point&pSU=Global%20Entry&pPID=homepage/ent.html&pPS=0&pCS=F&pSS=400,3&pJSV=0111&pCV=0111&pLI=1 HTTP/1.1
Host: ssdc.ups.com
Proxy-Connection: keep-alive
Referer: http://www.ups.com/
Accept: */*
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.13 (KHTML, like Gecko) Chrome/9.0.597.98 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: webappcommon.cclamp.usb.acceptsCookie=Yes

Response

HTTP/1.1 302 Found
Date: Sat, 12 Feb 2011 16:15:57 GMT
Server: Apache/2.2.3 (Red Hat)
Location: /dcslnrz6vne3g9s37bjvj8khc_2v8x/dcs.gif?dcsredirect=1&x=1&dcsdat=1297527437124&dcssip=www.ups.com&dcsuri=/&WT.tz=-6&WT.bh=10&WT.ul=en-US&WT.cd=16&WT.sr=1920x1200&WT.jo=Yes&WT.ti=Shipping,%20Freight,%20Logistics%20and%20Supply%20Chain%20Management%20from%20UPS&WT.js=Yes&WBPM_ver=1.0.12&WBPM_ac=0&pgf_Site=Global%20Home&pCC=US&pLL=en&pSA=Global%20Entry%20Point&pSU=Global%20Entry&pPID=homepage/ent.html&pPS=0&pCS=F&pSS=400,3&pJSV=0111&pCV=0111&pLI=1
Set-Cookie: UPS_ID=173.193.214.243-1297527357.104364::8BBF725C3CA4D6B541BE9882AF8F; expires=Tue, 09-Feb-2021 16:15:57 GMT; path=/
Last-Modified: Wed, 07 Jul 2010 18:50:24 GMT
ETag: "1001e-2b-48ad0a477fc00"
Accept-Ranges: bytes
Content-Length: 43
Connection: close
Content-Type: image/gif

GIF89a.............!.......,...........D..;

Report generated by CloudScan Vulnerability Crawler at Mon Feb 14 10:05:33 CST 2011.