The ChatSkinGUID parameter appears to be vulnerable to SQL injection attacks. A single quote was submitted in the ChatSkinGUID parameter, and a general 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.
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.
Issue remediation
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:
One common defense is to double up any single quotation marks appearing within user input before incorporating that input into a SQL query. This defense is designed to prevent malformed data from terminating the string in which it is inserted. However, if the data being incorporated into queries is numeric, then the defense may fail, because numeric data may not be encapsulated within quotes, in which case only a space is required to break out of the data context and interfere with the query. Further, in second-order SQL injection attacks, data that has been safely escaped when initially inserted into the database is subsequently read from the database and then passed back to it again. Quotation marks that have been doubled up initially will return to their original form when the data is reused, allowing the defense to be bypassed.
Another often cited defense is to use stored procedures for database access. While stored procedures can provide security benefits, they are not guaranteed to prevent SQL injection attacks. The same kinds of vulnerabilities that arise within standard dynamic SQL queries can arise if any SQL is dynamically constructed within stored procedures. Further, even if the procedure is sound, SQL injection can arise if the procedure is invoked in an unsafe manner using user-controllable data.
Request 1
GET /CS.js?ChatSkinGUID=5635b1d2-e540-4e57-a7f0-d821c995831a' HTTP/1.1 Host: www.chatskin.com Connection: keep-alive Referer: https://www.slapchop.com/?9e48d'-alert(document.cookie)-'4ae5108b46c=1 Accept: */* User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.224 Safari/534.10 Accept-Encoding: gzip,deflate Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3 Cookie: ASP.NET_SessionId=cabnypzqr1etcw55p0b3bd55
Response 1
HTTP/1.1 500 Internal Server Error Date: Sun, 02 Jan 2011 13:43:32 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET Content-Length: 574 Content-Type: text/html Set-Cookie: ASPSESSIONIDSCSDATDB=FPKJFCODNBKAODFNLPAPMNFP; path=/ Cache-control: private
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>There has been an error</title> <meta http-equiv="Content-Type" Content="text/ht ...[SNIP]...
Request 2
GET /CS.js?ChatSkinGUID=5635b1d2-e540-4e57-a7f0-d821c995831a'' HTTP/1.1 Host: www.chatskin.com Connection: keep-alive Referer: https://www.slapchop.com/?9e48d'-alert(document.cookie)-'4ae5108b46c=1 Accept: */* User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.224 Safari/534.10 Accept-Encoding: gzip,deflate Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3 Cookie: ASP.NET_SessionId=cabnypzqr1etcw55p0b3bd55
Response 2
HTTP/1.1 200 OK Date: Sun, 02 Jan 2011 13:43:33 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET Content-Length: 17441 Content-Type: text/html Set-Cookie: ASPSESSIONIDSCSDATDB=GPKJFCODBNMFIOBKFKJMMEIG; path=/ Cache-control: private
var URL = './Primary/PrimaryExit.aspx' var AlertMessage = 'You qualify for a Special Offer!!! Press Cancel on the Next Screen to View Your Offer.'; var ConfirmMessage = 'Press CANCEL'; var Popu ...[SNIP]...
2. SSL cookie without secure flag setpreviousnext There are 2 instances of this issue:
If the secure flag is set on a cookie, then browsers will not submit the cookie in any requests that use an unencrypted HTTP connection, thereby preventing the cookie from being trivially intercepted by an attacker monitoring network traffic. If the secure flag is not set, then the cookie will be transmitted in clear-text if the user visits any HTTP URLs within the cookie's scope. An attacker may be able to induce this event by feeding a user suitable links, either directly or via another web site. Even if the domain which issued the cookie does not host any content that is accessed over HTTP, an attacker may be able to use links of the form http://example.com:443/ to perform the same attack.
Issue remediation
The secure flag should be set on all cookies that are used for transmitting sensitive data when accessing content over HTTPS. If cookies are used to transmit session tokens, then areas of the application that are accessed over HTTPS should employ their own session handling mechanism, and the session tokens used should never be transmitted over unencrypted communications.
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.
Request
GET / HTTP/1.1 Host: www.chatskin.com Connection: keep-alive Referer: http://www.permissioninteractive.com/ Accept: application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.224 Safari/534.10 Accept-Encoding: gzip,deflate 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 Date: Sun, 02 Jan 2011 13:18:05 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET X-AspNet-Version: 2.0.50727 Set-Cookie: ASP.NET_SessionId=cabnypzqr1etcw55p0b3bd55; path=/; HttpOnly Cache-Control: private Content-Type: text/html; charset=utf-8 Content-Length: 28515
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
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.
Request
GET /CS.js?ChatSkinGUID=5635b1d2-e540-4e57-a7f0-d821c995831a HTTP/1.1 Host: www.chatskin.com Connection: keep-alive Referer: https://www.slapchop.com/?9e48d'-alert(document.cookie)-'4ae5108b46c=1 Accept: */* User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.224 Safari/534.10 Accept-Encoding: gzip,deflate Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3 Cookie: ASP.NET_SessionId=cabnypzqr1etcw55p0b3bd55
Response
HTTP/1.1 200 OK Date: Sun, 02 Jan 2011 13:27:05 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET Content-Length: 17441 Content-Type: text/html Set-Cookie: ASPSESSIONIDSCSDATDB=PAKJFCODLCEOMKKGIFCFLBNM; path=/ Cache-control: private
var URL = './Primary/PrimaryExit.aspx' var AlertMessage = 'You qualify for a Special Offer!!! Press Cancel on the Next Screen to View Your Offer.'; var ConfirmMessage = 'Press CANCEL'; var Popu ...[SNIP]...
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 /CS.js?ChatSkinGUID=5635b1d2-e540-4e57-a7f0-d821c995831a HTTP/1.1 Host: www.chatskin.com Connection: keep-alive Referer: https://www.slapchop.com/?9e48d'-alert(document.cookie)-'4ae5108b46c=1 Accept: */* User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.224 Safari/534.10 Accept-Encoding: gzip,deflate Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3 Cookie: ASP.NET_SessionId=cabnypzqr1etcw55p0b3bd55
Response
HTTP/1.1 200 OK Date: Sun, 02 Jan 2011 13:27:05 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET Content-Length: 17441 Content-Type: text/html Set-Cookie: ASPSESSIONIDSCSDATDB=PAKJFCODLCEOMKKGIFCFLBNM; path=/ Cache-control: private
var URL = './Primary/PrimaryExit.aspx' var AlertMessage = 'You qualify for a Special Offer!!! Press Cancel on the Next Screen to View Your Offer.'; var ConfirmMessage = 'Press CANCEL'; var Popu ...[SNIP]...
4. Cross-domain script includepreviousnext There are 2 instances of this issue:
When an application includes a script from an external domain, this script is executed by the browser within the security context of the invoking application. The script can therefore do anything that the application's own scripts can do, such as accessing application data and performing actions within the context of the current user.
If you include a script from an external domain, then you are trusting that domain with the data and functionality of your application, and you are trusting the domain's own security to prevent an attacker from modifying the script to perform malicious actions within your application.
Issue remediation
Scripts should not be included from untrusted domains. If you have a requirement which a third-party script appears to fulfil, then you should ideally copy the contents of that script onto your own domain and include it from there. If that is not possible (e.g. for licensing reasons) then you should consider reimplementing the script's functionality within your own code.
Unless directed otherwise, browsers may store a local cached copy of content received from web servers. Some browsers, including Internet Explorer, cache content accessed via HTTPS. If sensitive information in application responses is stored in the local cache, then this may be retrieved by other users who have access to the same computer at a future time.
Issue remediation
The application should return caching directives instructing browsers not to store local copies of any sensitive data. Often, this can be achieved by configuring the web server to prevent caching for relevant paths within the web root. Alternatively, most web development platforms allow you to control the server's caching directives from within individual scripts. Ideally, the web server should return the following HTTP headers in all responses containing sensitive content:
GET /CS.js?ChatSkinGUID=5635b1d2-e540-4e57-a7f0-d821c995831a HTTP/1.1 Host: www.chatskin.com Connection: keep-alive Referer: https://www.slapchop.com/?9e48d'-alert(document.cookie)-'4ae5108b46c=1 Accept: */* User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.224 Safari/534.10 Accept-Encoding: gzip,deflate Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3 Cookie: ASP.NET_SessionId=cabnypzqr1etcw55p0b3bd55
Response
HTTP/1.1 200 OK Date: Sun, 02 Jan 2011 13:27:05 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET Content-Length: 17441 Content-Type: text/html Set-Cookie: ASPSESSIONIDSCSDATDB=PAKJFCODLCEOMKKGIFCFLBNM; path=/ Cache-control: private
var URL = './Primary/PrimaryExit.aspx' var AlertMessage = 'You qualify for a Special Offer!!! Press Cancel on the Next Screen to View Your Offer.'; var ConfirmMessage = 'Press CANCEL'; var Popu ...[SNIP]...
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 /CS.js?ChatSkinGUID=5635b1d2-e540-4e57-a7f0-d821c995831a HTTP/1.1 Host: www.chatskin.com Connection: keep-alive Referer: https://www.slapchop.com/?9e48d'-alert(document.cookie)-'4ae5108b46c=1 Accept: */* User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.224 Safari/534.10 Accept-Encoding: gzip,deflate Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3 Cookie: ASP.NET_SessionId=cabnypzqr1etcw55p0b3bd55
Response
HTTP/1.1 200 OK Date: Sun, 02 Jan 2011 13:27:05 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET Content-Length: 17441 Content-Type: text/html Set-Cookie: ASPSESSIONIDSCSDATDB=PAKJFCODLCEOMKKGIFCFLBNM; path=/ Cache-control: private
var URL = './Primary/PrimaryExit.aspx' var AlertMessage = 'You qualify for a Special Offer!!! Press Cancel on the Next Screen to View Your Offer.'; var ConfirmMessage = 'Press CANCEL'; var Popu ...[SNIP]...
7. Content type incorrectly statedprevious There are 2 instances of this issue:
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.
The response contains the following Content-type statement:
Content-Type: text/html
The response states that it contains HTML. However, it actually appears to contain script.
Request
GET /CS.js?ChatSkinGUID=5635b1d2-e540-4e57-a7f0-d821c995831a HTTP/1.1 Host: www.chatskin.com Connection: keep-alive Referer: https://www.slapchop.com/?9e48d'-alert(document.cookie)-'4ae5108b46c=1 Accept: */* User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.224 Safari/534.10 Accept-Encoding: gzip,deflate Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3 Cookie: ASP.NET_SessionId=cabnypzqr1etcw55p0b3bd55
Response
HTTP/1.1 200 OK Date: Sun, 02 Jan 2011 13:27:05 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET Content-Length: 17441 Content-Type: text/html Set-Cookie: ASPSESSIONIDSCSDATDB=PAKJFCODLCEOMKKGIFCFLBNM; path=/ Cache-control: private
var URL = './Primary/PrimaryExit.aspx' var AlertMessage = 'You qualify for a Special Offer!!! Press Cancel on the Next Screen to View Your Offer.'; var ConfirmMessage = 'Press CANCEL'; var Popu ...[SNIP]...