HTTP Header Injection, CWE-113, myproductadvisor.com

CWE-113 Header Injection | Vulnerability Crawler Report

Report generated by CloudScan Vulnerability Crawler at Tue Jan 25 10:56:42 CST 2011.



DORK CWE-79 XSS Report

Loading

1. HTTP header injection

2. Cookie without HttpOnly flag set



1. HTTP header injection  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://www.myproductadvisor.com
Path:   /mpa/autobytel/setCookie.do

Issue detail

The value of REST URL parameter 2 is copied into the Location response header. The payload 7d2d3%0d%0a4fb5754f9c5 was submitted in the REST URL parameter 2. 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 /mpa/7d2d3%0d%0a4fb5754f9c5/setCookie.do HTTP/1.1
Host: www.myproductadvisor.com
Accept: */*
Accept-Language: en
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)
Connection: close

Response

HTTP/1.1 302 Moved Temporarily
Date: Tue, 25 Jan 2011 00:08:56 GMT
Server: Apache/2.2.3 (CentOS)
Set-Cookie: UIVERSION_COOKIE=1; Path=/mpa/
Location: http://www.myproductadvisor.com/mpa/base/7d2d3
4fb5754f9c5
/setCookie.do
Content-Length: 0
P3P: policyref="/content/w3c/p3p.xml", CP="NOI DSP NID CURa ADMa DEVa TAIa PSAa PSDa OUR NOR IND COM NAV STA"
Connection: close
Content-Type: text/plain; charset=UTF-8


2. Cookie without HttpOnly flag set  previous

Summary

Severity:   Low
Confidence:   Firm
Host:   http://www.myproductadvisor.com
Path:   /mpa/autobytel/setCookie.do

Issue detail

The following cookies were issued by the application and do not have the HttpOnly flag set:The highlighted cookie appears to contain a session token, which may increase the risk associated with this issue. You should review the contents of the cookies to determine their 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 /mpa/autobytel/setCookie.do HTTP/1.1
Host: www.myproductadvisor.com
Accept: */*
Accept-Language: en
User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)
Connection: close

Response

HTTP/1.1 302 Moved Temporarily
Date: Tue, 25 Jan 2011 00:08:23 GMT
Server: Apache/2.2.3 (CentOS)
Set-Cookie: UIVERSION_COOKIE=1; Path=/mpa/
Set-Cookie: JSESSIONID=a7ff3102cc2a90029701232ccef5; Path=/mpa
Location: http://www.myproductadvisor.com/mpa/cookiecheck.do?originalurl=aHR0cDovL3d3dy5teXByb2R1Y3RhZHZpc29yLmNvbS9tcGEvYXV0b2J5dGVsL3NldENvb2tpZS5kbw==
Content-Length: 0
P3P: policyref="/content/w3c/p3p.xml", CP="NOI DSP NID CURa ADMa DEVa TAIa PSAa PSDa OUR NOR IND COM NAV STA"
Connection: close
Content-Type: text/html; charset=UTF-8
Set-Cookie: Coyote-2-c0a8010b=c0a801cd:0; path=/


Report generated by CloudScan Vulnerability Crawler at Tue Jan 25 10:56:42 CST 2011.