CWE-113, HTTP Header Injection, Response Splitting, udmserve.net

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

Report generated by XSS.CX at Tue Mar 08 07:52:21 CST 2011.


The DORK Report

Loading

1. HTTP header injection

2. XML injection

2.1. http://udmserve.net/udm/img.fetch [REST URL parameter 1]

2.2. http://udmserve.net/udm/img.fetch [REST URL parameter 2]

3. Cookie without HttpOnly flag set

3.1. http://udmserve.net/udm/img.fetch

3.2. http://udmserve.net/udm/img.fetch

4. Robots.txt file



1. HTTP header injection  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://udmserve.net
Path:   /udm/img.fetch

Issue detail

The value of the dt cookie is copied into the Set-Cookie response header. The payload b5076%0d%0a866a77c7dd9 was submitted in the dt cookie. 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 /udm/img.fetch?sid=3454;tid=2;ev=1;dt=2; HTTP/1.1
Host: udmserve.net
Proxy-Connection: keep-alive
Referer: http://www.merriam-webster.com/creative.php?pageid=General&placement=MW_GEN_300_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: udm1=6369:1:63424487863:1:3454:31:1707:63424487863:1:1|; dt=b5076%0d%0a866a77c7dd9; NSC_mc-nfejb=81e1a7ed3660

Response

HTTP/1.1 200 OK
P3P: CP='NOI DSP CURa ADMa DEVa PSAa PSDa OUR IND UNI COM NAV INT'
P3P: policyref="/w3c/p3p.xml", CP="NOI DSP CURa ADMa DEVa PSAa PSDa OUR IND UNI COM NAV INT"
Set-Cookie: udm2=8320:1:63424489625:1:3454:795:2228:63424489625:1:2|; domain=udmserve.net; path=/; expires=Tue, 06-Mar-2012 01:47:05 GMT
Set-Cookie: dt=b5076
866a77c7dd9
; domain=udmserve.net; path=/; expires=Tue, 06-Mar-2012 01: 47:05 GMT
Expires: Sun, 06 Mar 2011 01:47:05 GMT
Date: Mon, 07 Mar 2011 01:47:05 GMT
Content-Type: application/x-javascript
Server: lighttpd/1.4.28
Set-Cookie: NSC_mc-nfejb=81e1a7ed3660;expires=Mon, 07-Mar-11 01:52:05 GMT;path=/
Content-Length: 1390

{document.writeln("<script type=\"text/javascript\">");
document.writeln("var udmsid = 3454;");
document.writeln("<\/script>");
document.writeln("");
document.writeln("<script type=\"text/javascript\"
...[SNIP]...

2. XML injection  previous  next
There are 2 instances of this issue:

Issue background

XML or SOAP injection vulnerabilities arise when user input is inserted into a server-side XML document or SOAP message in an unsafe way. It may be possible to use XML metacharacters to modify the structure of the resulting XML. Depending on the function in which the XML is used, it may be possible to interfere with the application's logic, to perform unauthorised actions or access sensitive data.

This kind of vulnerability can be difficult to detect and exploit remotely; you should review the application's response, and the purpose which the relevant input performs within the application's functionality, to determine whether it is indeed vulnerable.

Issue remediation

The application should validate or sanitise user input before incorporating it into an XML document or SOAP message. It may be possible to block any input containing XML metacharacters such as < and >. Alternatively, these characters can be replaced with the corresponding entities: &lt; and &gt;.


2.1. http://udmserve.net/udm/img.fetch [REST URL parameter 1]  next

Summary

Severity:   Medium
Confidence:   Tentative
Host:   http://udmserve.net
Path:   /udm/img.fetch

Issue detail

The REST URL parameter 1 appears to be vulnerable to XML injection. The payload ]]>> was appended to the value of the REST URL parameter 1. The application's response indicated that this input may have caused an error within a server-side XML or SOAP parser, suggesting that the input has been inserted into an XML document or SOAP message without proper sanitisation.

Request

GET /udm]]>>/img.fetch?sid=3454;tid=1;ev=1;dt=2; HTTP/1.1
Host: udmserve.net
Proxy-Connection: keep-alive
Referer: http://www.merriam-webster.com/creative.php?pageid=General&placement=MW_GEN_728_TOP&groupid=1123043650&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

Response

HTTP/1.1 404 Not Found
P3P: CP='NOI DSP CURa ADMa DEVa PSAa PSDa OUR IND UNI COM NAV INT'
Content-Type: text/html
Content-Length: 345
Date: Mon, 07 Mar 2011 01:36:08 GMT
Server: lighttpd/1.4.28
Set-Cookie: NSC_mc-nfejb=81e1a7db3660;expires=Mon, 07-Mar-11 01:41:08 GMT;path=/

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w
...[SNIP]...

2.2. http://udmserve.net/udm/img.fetch [REST URL parameter 2]  previous  next

Summary

Severity:   Medium
Confidence:   Tentative
Host:   http://udmserve.net
Path:   /udm/img.fetch

Issue detail

The REST URL parameter 2 appears to be vulnerable to XML injection. The payload ]]>> was appended to the value of the REST URL parameter 2. The application's response indicated that this input may have caused an error within a server-side XML or SOAP parser, suggesting that the input has been inserted into an XML document or SOAP message without proper sanitisation.

Request

GET /udm/img.fetch]]>>?sid=3454;tid=1;ev=1;dt=2; HTTP/1.1
Host: udmserve.net
Proxy-Connection: keep-alive
Referer: http://www.merriam-webster.com/creative.php?pageid=General&placement=MW_GEN_728_TOP&groupid=1123043650&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

Response

HTTP/1.1 404 Not Found
P3P: CP='NOI DSP CURa ADMa DEVa PSAa PSDa OUR IND UNI COM NAV INT'
Content-Type: text/html
Content-Length: 345
Date: Mon, 07 Mar 2011 01:36:13 GMT
Server: lighttpd/1.4.28
Set-Cookie: NSC_mc-nfejb=81e1a7ef3660;expires=Mon, 07-Mar-11 01:41:13 GMT;path=/

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w
...[SNIP]...

3. Cookie without HttpOnly flag set  previous  next
There are 2 instances of this issue:

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.



3.1. http://udmserve.net/udm/img.fetch  previous  next

Summary

Severity:   Information
Confidence:   Certain
Host:   http://udmserve.net
Path:   /udm/img.fetch

Issue detail

The following cookies were issued by the application and do not have the HttpOnly flag set:The cookies do not appear to contain session tokens, which may reduce the risk associated with this issue. You should review the contents of the cookies to determine their function.

Request

GET /udm/img.fetch?sid=3454;tid=2;ev=1;dt=2; HTTP/1.1
Host: udmserve.net
Proxy-Connection: keep-alive
Referer: http://www.merriam-webster.com/creative.php?pageid=General&placement=MW_GEN_300_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: udm1=6369:1:63424487863:1:3454:31:1707:63424487863:1:1|; dt=4ad7a249-13ba-40a0-9ec9-8edc4278659d; NSC_mc-nfejb=81e1a7ed3660

Response

HTTP/1.1 200 OK
P3P: CP='NOI DSP CURa ADMa DEVa PSAa PSDa OUR IND UNI COM NAV INT'
P3P: policyref="/w3c/p3p.xml", CP="NOI DSP CURa ADMa DEVa PSAa PSDa OUR IND UNI COM NAV INT"
Set-Cookie: udm2=8320:1:63424489614:1:3454:795:2228:63424489614:1:2|; domain=udmserve.net; path=/; expires=Tue, 06-Mar-2012 01:46:54 GMT
Set-Cookie: dt=4ad7a249-13ba-40a0-9ec9-8edc4278659d; domain=udmserve.net; path=/; expires=Tue, 06-Mar-2012 01:46:54 GMT
Expires: Sun, 06 Mar 2011 01:46:54 GMT
Date: Mon, 07 Mar 2011 01:46:54 GMT
Content-Type: application/x-javascript
Server: lighttpd/1.4.28
Set-Cookie: NSC_mc-nfejb=81e1a7ed3660;expires=Mon, 07-Mar-11 01:51:54 GMT;path=/
Content-Length: 1390

{document.writeln("<script type=\"text/javascript\">");
document.writeln("var udmsid = 3454;");
document.writeln("<\/script>");
document.writeln("");
document.writeln("<script type=\"text/javascript\"
...[SNIP]...

3.2. http://udmserve.net/udm/img.fetch  previous

Summary

Severity:   Information
Confidence:   Certain
Host:   http://udmserve.net
Path:   /udm/img.fetch

Issue detail

The following cookies were issued by the application and do not have the HttpOnly flag set:The cookies do not appear to contain session tokens, which may reduce the risk associated with this issue. You should review the contents of the cookies to determine their function.

Request

GET /udm/img.fetch?sid=3454;tid=1;ev=1;dt=2; HTTP/1.1
Host: udmserve.net
Proxy-Connection: keep-alive
Referer: http://www.merriam-webster.com/creative.php?pageid=General&placement=MW_GEN_728_TOP&groupid=1123043650&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

Response

HTTP/1.1 200 OK
P3P: CP='NOI DSP CURa ADMa DEVa PSAa PSDa OUR IND UNI COM NAV INT'
P3P: policyref="/w3c/p3p.xml", CP="NOI DSP CURa ADMa DEVa PSAa PSDa OUR IND UNI COM NAV INT"
Set-Cookie: udm1=9513:1:63424488947:1:3454:31:2591:63424488947:1:1|; domain=udmserve.net; path=/; expires=Tue, 06-Mar-2012 01:35:47 GMT
Set-Cookie: dt=8abd48e2-71f1-48b2-a8f6-3a564c123052; domain=udmserve.net; path=/; expires=Tue, 06-Mar-2012 01:35:47 GMT
Expires: Sun, 06 Mar 2011 01:35:47 GMT
Date: Mon, 07 Mar 2011 01:35:47 GMT
Content-Type: application/x-javascript
Server: lighttpd/1.4.28
Set-Cookie: NSC_mc-nfejb=81e1a7ef3660;expires=Mon, 07-Mar-11 01:40:47 GMT;path=/
Content-Length: 1583

{document.writeln("<script language=JavaScript>");
document.writeln("var img_name = \"GalagaFBC728x90_1010.swf.swf\";");
document.writeln("var clk_url = \"http://udmserve.net/udm/clk.cpx?mid=9513;sid=
...[SNIP]...

4. Robots.txt file  previous

Summary

Severity:   Information
Confidence:   Certain
Host:   http://udmserve.net
Path:   /udm/img.fetch

Issue detail

The web server contains a robots.txt file.

Issue background

The file robots.txt is used to give instructions to web robots, such as search engine crawlers, about locations within the web site which robots are allowed, or not allowed, to crawl and index.

The presence of the robots.txt does not in itself present any kind of security vulnerability. However, it is often used to identify restricted or private areas of a site's contents. The information in the file may therefore help an attacker to map out the site's contents, especially if some of the locations identified are not linked from elsewhere in the site. If the application relies on robots.txt to protect access to these areas, and does not enforce proper access control over them, then this presents a serious vulnerability.

Issue remediation

The robots.txt file is not itself a security threat, and its correct use can represent good practice for non-security reasons. You should not assume that all web robots will honour the file's instructions. Rather, assume that attackers will pay close attention to any locations identified in the file. Do not rely on robots.txt to provide any kind of protection over unauthorised access.

Request

GET /robots.txt HTTP/1.0
Host: udmserve.net

Response

HTTP/1.0 200 OK
P3P: CP='NOI DSP CURa ADMa DEVa PSAa PSDa OUR IND UNI COM NAV INT'
Content-Type: text/plain
Accept-Ranges: bytes
ETag: "1357487836"
Last-Modified: Wed, 19 Jan 2011 00:32:49 GMT
Content-Length: 26
Connection: keep-alive
Date: Mon, 07 Mar 2011 01:35:48 GMT
Server: lighttpd/1.4.28
Set-Cookie: NSC_mc-nfejb=81e1a7ef3660;expires=Mon, 07-Mar-11 01:40:48 GMT;path=/

User-Agent: *
Disallow: /

Report generated by XSS.CX at Tue Mar 08 07:52:21 CST 2011.