SQL Injection, Single Quote, Database Error, CWE-89, CAPEC-66, cdn.goodway.com

CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')

Report generated by XSS.CX Research Blog at Sat Mar 05 20:28:28 CST 2011.


The DORK Report

Loading

1. SQL injection

2. Flash cross-domain policy

3. Cookie without HttpOnly flag set

4. HTML does not specify charset

5. Content type incorrectly stated



1. SQL injection  next

Summary

Severity:   High
Confidence:   Firm
Host:   http://cdn.goodwaygroup.com
Path:   /DDLImpression.asp

Issue detail

The IPAddress parameter appears to be vulnerable to SQL injection attacks. The payload ' was submitted in the IPAddress parameter, and a database error message was returned. You should review the contents of the error message, and the application's handling of other input, to confirm whether a vulnerability is present.

The database appears to be Microsoft SQL Server.

Remediation detail

The application should handle errors gracefully and prevent SQL error messages from being returned in responses.

Issue background

SQL injection vulnerabilities arise when user-controllable data is incorporated into database SQL queries in an unsafe manner. An attacker can supply crafted input to break out of the data context in which their input appears and interfere with the structure of the surrounding query.

Various attacks can be delivered via SQL injection, including reading or modifying critical application data, interfering with application logic, escalating privileges within the database and executing operating system commands.

Remediation background

The most effective way to prevent SQL injection attacks is to use parameterised queries (also known as prepared statements) for all database access. This method uses two steps to incorporate potentially tainted data into SQL queries: first, the application specifies the structure of the query, leaving placeholders for each item of user input; second, the application specifies the contents of each placeholder. Because the structure of the query has already defined in the first step, it is not possible for malformed data in the second step to interfere with the query structure. You should review the documentation for your database and application platform to determine the appropriate APIs which you can use to perform parameterised queries. It is strongly recommended that you parameterise every variable data item that is incorporated into database queries, even if it is not obviously tainted, to prevent oversights occurring and avoid vulnerabilities being introduced by changes elsewhere within the code base of the application.

You should be aware that some commonly employed and recommended mitigations for SQL injection vulnerabilities are not always effective:

Request

GET /DDLImpression.asp?IPAddress=173%2E193%2E214%2E243'&flight=%2D&versionId=2&DARTCampaignId=5167576&userZip=10001&onLoad=%5Btype%20Function%5D HTTP/1.1
Host: cdn.goodwaygroup.com
Proxy-Connection: keep-alive
Referer: http://s0.2mdn.net/2356643/PID_1545715_300_loader_banner.swf
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 500 Internal Server Error
Cache-control: Public
Content-Type: text/html
Date: Sun, 06 Mar 2011 02:05:19 GMT
Expires: Sun, 06 Mar 2011 05:05:19 GMT
Server: Microsoft-IIS/6.0
Set-Cookie: ASPSESSIONIDSSBADBQR=PCCBCEOADOLPPOFEFDDIKPAJ; path=/
X-Powered-By: ASP.NET
Content-Length: 343

<font face="Arial" size=2>
<p>Microsoft OLE DB Provider for SQL Server</font> <font face="Arial" size=2>error '80040e07'</font>
<p>
<font face="Arial" size=2>Conversion failed when converting the nva
...[SNIP]...

2. Flash cross-domain policy  previous  next

Summary

Severity:   Low
Confidence:   Certain
Host:   http://cdn.goodwaygroup.com
Path:   /crossdomain.xml

Issue detail

The application publishes a Flash cross-domain policy which uses a wildcard to specify allowed domains, allows access from specific other domains, and allows access from specific subdomains.

Using a wildcard to specify allowed domains means that any domain matching the wildcard expression can perform two-way interaction with this application. You should only use this policy if you fully trust every possible web site that may reside on a domain which matches the wildcard expression.

Allowing access from specific domains means that web sites on those domains can perform two-way interaction with this application. You should only use this policy if you fully trust the specific domains allowed by the policy.

Issue background

The Flash cross-domain policy controls whether Flash client components running on other domains can perform two-way interaction with the domain which publishes the policy. If another domain is allowed by the policy, then that domain can potentially attack users of the application. If a user is logged in to the application, and visits a domain allowed by the policy, then any malicious content running on that domain can potentially gain full access to the application within the security context of the logged in user.

Even if an allowed domain is not overtly malicious in itself, security vulnerabilities within that domain could potentially be leveraged by a third-party attacker to exploit the trust relationship and attack the application which allows access.

Issue remediation

You should review the domains which are allowed by the Flash cross-domain policy and determine whether it is appropriate for the application to fully trust both the intentions and security posture of those domains.

Request

GET /crossdomain.xml HTTP/1.1
Host: cdn.goodwaygroup.com
Proxy-Connection: keep-alive
Referer: http://s0.2mdn.net/2356643/PID_1545715_300_loader_banner.swf
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
Accept-Ranges: bytes
Content-Type: text/xml
Date: Sun, 06 Mar 2011 02:03:39 GMT
ETag: "3b1abd724087cb1:ee0"
Last-Modified: Thu, 18 Nov 2010 16:48:38 GMT
Server: ECS (dca/532A)
X-Cache: HIT
X-Powered-By: ASP.NET
Content-Length: 1219

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="motifcdn.doubleclick.net"/>
<allow-access-from domain="m.doubleclick.net"/>
<allow-access-from domain="m2.doubleclick.net"/>
<allow-access-from domain="m3.doubleclick.net"/>
<allow-access-from domain="m.2mdn.net"/>
<allow-access-from domain="m1.2mdn.net"/>
<allow-access-from domain="m2.2mdn.net"/>
<allow-access-from domain="*.2mdn.net"/>
<allow-access-from domain="betadfa.doubleclick.net"/>
<allow-access-from domain="dfa.doubleclick.net"/>
<allow-access-from domain="betadfp.doubleclick.net"/>
<allow-access-from domain="dfp.doubleclick.net"/>
<allow-access-from domain="motifcdn2.doubleclick.net"/>
<allow-access-from domain="ad.doubleclick.net"/>
<allow-access-from domain="*.doubleclick.net"/>
<allow-access-from domain="*.doubleclick.com"/>
<allow-access-from domain="2mdn.aolcdn.com"/>
<allow-access-from domain="*.aolcdn.com"/>
<allow-access-from domain="testbed.goodwaygroup.com"/>
<allow-access-from domain="*.goodwaygroup.com"/>
...[SNIP]...

3. Cookie without HttpOnly flag set  previous  next

Summary

Severity:   Low
Confidence:   Firm
Host:   http://cdn.goodwaygroup.com
Path:   /DDLImpression.asp

Issue detail

The following cookie was issued by the application and does not have the HttpOnly flag set:The cookie appears to contain a session token, which may increase 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 /DDLImpression.asp?IPAddress=173%2E193%2E214%2E243&flight=%2D&versionId=2&DARTCampaignId=5167576&userZip=10001&onLoad=%5Btype%20Function%5D HTTP/1.1
Host: cdn.goodwaygroup.com
Proxy-Connection: keep-alive
Referer: http://s0.2mdn.net/2356643/PID_1545715_300_loader_banner.swf
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
Cache-control: Public
Content-Type: text/html
Date: Sun, 06 Mar 2011 02:04:48 GMT
Expires: Sun, 06 Mar 2011 05:04:48 GMT
Server: Microsoft-IIS/6.0
Set-Cookie: ASPSESSIONIDSSBADBQR=FMFACEOACINMJBKBDBINACMP; path=/
X-Powered-By: ASP.NET
Content-Length: 2941

Message=[[{"DartCampaignID":"5167576", "DartCampaignName":"G111048 Chevy Dallas", "MarketName":"Dallas", "CampaignThreshold":"25", "DealerID":"3369", "DealerName":"Britain Chevrolet", "Phone":""
...[SNIP]...

4. HTML does not specify charset  previous  next

Summary

Severity:   Information
Confidence:   Certain
Host:   http://cdn.goodwaygroup.com
Path:   /DDLImpression.asp

Issue description

If a web response states that it contains HTML content but does not specify a character set, then the browser may analyse the HTML and attempt to determine which character set it appears to be using. Even if the majority of the HTML actually employs a standard character set such as UTF-8, the presence of non-standard characters anywhere in the response may cause the browser to interpret the content using a different character set. This can have unexpected results, and can lead to cross-site scripting vulnerabilities in which non-standard encodings like UTF-7 can be used to bypass the application's defensive filters.

In most cases, the absence of a charset directive does not constitute a security flaw, particularly if the response contains static content. You should review the contents of the response and the context in which it appears to determine whether any vulnerability exists.

Issue remediation

For every response containing HTML content, the application should include within the Content-type header a directive specifying a standard recognised character set, for example charset=ISO-8859-1.

Request

GET /DDLImpression.asp?IPAddress=173%2E193%2E214%2E243&flight=%2D&versionId=2&DARTCampaignId=5167576&userZip=10001&onLoad=%5Btype%20Function%5D HTTP/1.1
Host: cdn.goodwaygroup.com
Proxy-Connection: keep-alive
Referer: http://s0.2mdn.net/2356643/PID_1545715_300_loader_banner.swf
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
Cache-control: Public
Content-Type: text/html
Date: Sun, 06 Mar 2011 02:04:48 GMT
Expires: Sun, 06 Mar 2011 05:04:48 GMT
Server: Microsoft-IIS/6.0
Set-Cookie: ASPSESSIONIDSSBADBQR=FMFACEOACINMJBKBDBINACMP; path=/
X-Powered-By: ASP.NET
Content-Length: 2941

Message=[[{"DartCampaignID":"5167576", "DartCampaignName":"G111048 Chevy Dallas", "MarketName":"Dallas", "CampaignThreshold":"25", "DealerID":"3369", "DealerName":"Britain Chevrolet", "Phone":""
...[SNIP]...

5. Content type incorrectly stated  previous

Summary

Severity:   Information
Confidence:   Firm
Host:   http://cdn.goodwaygroup.com
Path:   /DDLImpression.asp

Issue detail

The response contains the following Content-type statement:The response states that it contains HTML. However, it actually appears to contain CSS.

Issue background

If a web response specifies an incorrect content type, then browsers may process the response in unexpected ways. If the specified content type is a renderable text-based format, then the browser will usually attempt to parse and render the response in that format. If the specified type is an image format, then the browser will usually detect the anomaly and will analyse the actual content and attempt to determine its MIME type. Either case can lead to unexpected results, and if the content contains any user-controllable data may lead to cross-site scripting or other client-side vulnerabilities.

In most cases, the presence of an incorrect content type statement does not constitute a security flaw, particularly if the response contains static content. You should review the contents of the response and the context in which it appears to determine whether any vulnerability exists.

Issue remediation

For every response containing a message body, the application should include a single Content-type header which correctly and unambiguously states the MIME type of the content in the response body.

Request

GET /DDLImpression.asp?IPAddress=173%2E193%2E214%2E243&flight=%2D&versionId=2&DARTCampaignId=5167576&userZip=10001&onLoad=%5Btype%20Function%5D HTTP/1.1
Host: cdn.goodwaygroup.com
Proxy-Connection: keep-alive
Referer: http://s0.2mdn.net/2356643/PID_1545715_300_loader_banner.swf
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
Cache-control: Public
Content-Type: text/html
Date: Sun, 06 Mar 2011 02:04:48 GMT
Expires: Sun, 06 Mar 2011 05:04:48 GMT
Server: Microsoft-IIS/6.0
Set-Cookie: ASPSESSIONIDSSBADBQR=FMFACEOACINMJBKBDBINACMP; path=/
X-Powered-By: ASP.NET
Content-Length: 2941

Message=[[{"DartCampaignID":"5167576", "DartCampaignName":"G111048 Chevy Dallas", "MarketName":"Dallas", "CampaignThreshold":"25", "DealerID":"3369", "DealerName":"Britain Chevrolet", "Phone":""
...[SNIP]...

Report generated by XSS.CX Research Blog at Sat Mar 05 20:28:28 CST 2011.