The %5Fkey1 cookie appears to be vulnerable to SQL injection attacks. The payload ' was submitted in the %5Fkey1 cookie, 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:
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
GET /register.asp HTTP/1.1 Host: www.seriousgameplay.com Connection: keep-alive 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,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3 Cookie: __utmz=41989927.1293356350.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utma=41989927.727380761.1293356350.1293356350.1293644579.2; %5Fkey2=12%2F25%2F2010+10%3A40%3A21+PM; %5Fkey1=870557771'
Response
HTTP/1.1 200 OK Date: Wed, 29 Dec 2010 22:19:22 GMT Server: Microsoft-IIS/6.0 P3P: CP="NOI DSP COR NID" X-Powered-By: ASP.NET Content-Length: 274 Content-Type: text/html Set-Cookie: ASPSESSIONIDCCRBARTC=LEBFLEKBHDDIEMHBKHGECIDB; path=/ Cache-control: private
Database SQL Error.<br>SQL Query: select ID, Vars from Sessions WITH (NOLOCK) where Key1=870557771' and Key2 = '12/25/2010 10:40:21 PM' and Key3='174.121.222.18' and AccountID is null order by Recalle ...[SNIP]... <br>Error Description: Line 1: Incorrect syntax near ' and Key2 = '.
2. SSL cookie without secure flag setpreviousnext There are 3 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 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.
Request
GET /register.asp HTTP/1.1 Host: www.seriousgameplay.com Connection: keep-alive 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,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3 Cookie: __utmz=41989927.1293356350.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utma=41989927.727380761.1293356350.1293356350.1293644579.2; %5Fkey2=12%2F25%2F2010+10%3A40%3A21+PM; %5Fkey1=870557771
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 / HTTP/1.1 Host: www.seriousgameplay.com Connection: keep-alive Referer: https://www.seriousgameplay.com/register.asp 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,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3 Cookie: __utmz=41989927.1293356350.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utma=41989927.727380761.1293356350.1293356350.1293644579.2; ASPSESSIONIDCCRBARTC=DCPELEKBLHKKDFCJMHMJDLLJ; %5Fkey2=12%2F25%2F2010+10%3A40%3A21+PM; %5Fkey1=870557771
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 /sbg.asp HTTP/1.1 Host: www.seriousgameplay.com Connection: keep-alive Referer: https://www.seriousgameplay.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,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3 Cookie: __utmz=41989927.1293356350.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utma=41989927.727380761.1293356350.1293356350.1293644579.2; ASPSESSIONIDCCRBARTC=DCPELEKBLHKKDFCJMHMJDLLJ; %5Fkey1=870557771; %5Fkey2=12%2F25%2F2010+10%3A40%3A21+PM
Reflected cross-site scripting vulnerabilities arise when data is copied from a request and echoed into the application's immediate response in an unsafe way. An attacker can use the vulnerability to construct a request which, if issued by another application user, will cause JavaScript code supplied by the attacker to execute within the user's browser in the context of that user's session with the application.
The attacker-supplied code can perform a wide variety of actions, such as stealing the victim's session token or login credentials, performing arbitrary actions on the victim's behalf, and logging their keystrokes.
Users can be induced to issue the attacker's crafted request in various ways. For example, the attacker can send a victim a link containing a malicious URL in an email or instant message. They can submit the link to popular web sites that allow content authoring, for example in blog comments. And they can create an innocuous looking web site which causes anyone viewing it to make arbitrary cross-domain requests to the vulnerable application (using either the GET or the POST method).
The security impact of cross-site scripting vulnerabilities is dependent upon the nature of the vulnerable application, the kinds of data and functionality which it contains, and the other applications which belong to the same domain and organisation. If the application is used only to display non-sensitive public content, with no authentication or access control functionality, then a cross-site scripting flaw may be considered low risk. However, if the same application resides on a domain which can access cookies for other more security-critical applications, then the vulnerability could be used to attack those other applications, and so may be considered high risk. Similarly, if the organisation which owns the application is a likely target for phishing attacks, then the vulnerability could be leveraged to lend credibility to such attacks, by injecting Trojan functionality into the vulnerable application, and exploiting users' trust in the organisation in order to capture credentials for other applications which it owns. In many kinds of application, such as those providing online banking functionality, cross-site scripting should always be considered high risk.
Issue remediation
In most situations where user-controllable data is copied into application responses, cross-site scripting attacks can be prevented using two layers of defenses:
Input should be validated as strictly as possible on arrival, given the kind of content which it is expected to contain. For example, personal names should consist of alphabetical and a small range of typographical characters, and be relatively short; a year of birth should consist of exactly four numerals; email addresses should match a well-defined regular expression. Input which fails the validation should be rejected, not sanitised.
User input should be HTML-encoded at any point where it is copied into application responses. All HTML metacharacters, including < > " ' and =, should be replaced with the corresponding HTML entities (< > etc).
In cases where the application's functionality allows users to author content using a restricted subset of HTML tags and attributes (for example, blog comments which allow limited formatting and linking), it is necessary to parse the supplied HTML to validate that it does not use any dangerous syntax; this is a non-trivial task.
The value of the Referer HTTP header is copied into the value of an HTML tag attribute which is encapsulated in double quotation marks. The payload 4e9b9"><script>alert(1)</script>3fd6a9b9d69 was submitted in the Referer HTTP header. This input was echoed unmodified in the application's response.
This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response.
Because the user data that is copied into the response is submitted within a request header, the application's behaviour is not trivial to exploit in an attack against another user. In the past, methods have existed of using client-side technologies such as Flash to cause another user to make a request containing an arbitrary HTTP header. If you can use such a technique, you can probably leverage it to exploit the XSS flaw. This limitation partially mitigates the impact of the vulnerability.
Request
GET /register.asp HTTP/1.1 Host: www.seriousgameplay.com Connection: keep-alive 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,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3 Cookie: __utmz=41989927.1293356350.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utma=41989927.727380761.1293356350.1293356350.1293644579.2; %5Fkey2=12%2F25%2F2010+10%3A40%3A21+PM; %5Fkey1=870557771 Referer: http://www.google.com/search?hl=en&q=4e9b9"><script>alert(1)</script>3fd6a9b9d69
The value of the %5Fkey1 cookie is copied into the HTML document as plain text between tags. The payload db336<script>alert(1)</script>9da33a43fb3 was submitted in the %5Fkey1 cookie. This input was echoed unmodified in the application's response.
This proof-of-concept attack demonstrates that it is possible to inject arbitrary JavaScript into the application's response.
Because the user data that is copied into the response is submitted within a cookie, the application's behaviour is not trivial to exploit in an attack against another user. Typically, you will need to find a means of setting an arbitrary cookie value in the victim's browser in order to exploit the vulnerability. This limitation considerably mitigates the impact of the vulnerability.
Request
GET /register.asp HTTP/1.1 Host: www.seriousgameplay.com Connection: keep-alive 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,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3 Cookie: __utmz=41989927.1293356350.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utma=41989927.727380761.1293356350.1293356350.1293644579.2; %5Fkey2=12%2F25%2F2010+10%3A40%3A21+PM; %5Fkey1=870557771db336<script>alert(1)</script>9da33a43fb3
Response
HTTP/1.1 200 OK Date: Wed, 29 Dec 2010 22:19:20 GMT Server: Microsoft-IIS/6.0 P3P: CP="NOI DSP COR NID" X-Powered-By: ASP.NET Content-Length: 307 Content-Type: text/html Set-Cookie: ASPSESSIONIDCCRBARTC=JEBFLEKBHMOBJBMPMFMNGCCI; path=/ Cache-control: private
Database SQL Error.<br>SQL Query: select ID, Vars from Sessions WITH (NOLOCK) where Key1=870557771db336<script>alert(1)</script>9da33a43fb3 and Key2 = '12/25/2010 10:40:21 PM' and Key3='174.121.222.18' and AccountID is null order by Recalled DESC<br> ...[SNIP]...
4. Cookie without HttpOnly flag setpreviousnext There are 3 instances of this issue:
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.
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.
Request
GET /register.asp HTTP/1.1 Host: www.seriousgameplay.com Connection: keep-alive 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,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3 Cookie: __utmz=41989927.1293356350.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utma=41989927.727380761.1293356350.1293356350.1293644579.2; %5Fkey2=12%2F25%2F2010+10%3A40%3A21+PM; %5Fkey1=870557771
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 / HTTP/1.1 Host: www.seriousgameplay.com Connection: keep-alive Referer: https://www.seriousgameplay.com/register.asp 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,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3 Cookie: __utmz=41989927.1293356350.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utma=41989927.727380761.1293356350.1293356350.1293644579.2; ASPSESSIONIDCCRBARTC=DCPELEKBLHKKDFCJMHMJDLLJ; %5Fkey2=12%2F25%2F2010+10%3A40%3A21+PM; %5Fkey1=870557771
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 /sbg.asp HTTP/1.1 Host: www.seriousgameplay.com Connection: keep-alive Referer: https://www.seriousgameplay.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,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3 Cookie: __utmz=41989927.1293356350.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utma=41989927.727380761.1293356350.1293356350.1293644579.2; ASPSESSIONIDCCRBARTC=DCPELEKBLHKKDFCJMHMJDLLJ; %5Fkey1=870557771; %5Fkey2=12%2F25%2F2010+10%3A40%3A21+PM
The form contains the following password fields with autocomplete enabled:
password1
password2
Issue background
Most browsers have a facility to remember user credentials that are entered into HTML forms. This function can be configured by the user and also by applications which employ user credentials. If the function is enabled, then credentials entered by the user are stored on their local computer and retrieved by the browser on future visits to the same application.
The stored credentials can be captured by an attacker who gains access to the computer, either locally or through some remote compromise. Further, methods have existed whereby a malicious web site can retrieve the stored credentials for other applications, by exploiting browser vulnerabilities or through application-level cross-domain attacks.
Issue remediation
To prevent browsers from storing credentials entered into HTML forms, you should include the attribute autocomplete="off" within the FORM tag (to protect all form fields) or within the relevant INPUT tags (to protect specific individual fields).
Request
GET /register.asp HTTP/1.1 Host: www.seriousgameplay.com Connection: keep-alive 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,sdch Accept-Language: en-US,en;q=0.8 Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3 Cookie: __utmz=41989927.1293356350.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utma=41989927.727380761.1293356350.1293356350.1293644579.2; %5Fkey2=12%2F25%2F2010+10%3A40%3A21+PM; %5Fkey1=870557771
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.
The presence of email addresses within application responses does not necessarily constitute a security vulnerability. Email addresses may appear intentionally within contact information, and many applications (such as web mail) include arbitrary third-party email addresses within their core content.
However, email addresses of developers and other individuals (whether appearing on-screen or hidden within page source) may disclose information that is useful to an attacker; for example, they may represent usernames that can be used at the application's login, and they may be used in social engineering attacks against the organisation's personnel. Unnecessary or excessive disclosure of email addresses may also lead to an increase in the volume of spam email received.
Issue remediation
You should review the email addresses being disclosed by the application, and consider removing any that are unnecessary, or replacing personal addresses with anonymous mailbox addresses (such as helpdesk@example.com).
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:
The server presented a valid, trusted SSL certificate. This issue is purely informational.
The server presented the following certificates:
Server certificate
Issued to:
www.seriousgameplay.com
Issued by:
Go Daddy Secure Certification Authority
Valid from:
Tue Jul 07 14:36:58 CDT 2009
Valid to:
Sat May 28 16:44:14 CDT 2011
Certificate chain #1
Issued to:
Go Daddy Secure Certification Authority
Issued by:
Go Daddy Class 2 Certification Authority
Valid from:
Wed Nov 15 19:54:37 CST 2006
Valid to:
Sun Nov 15 19:54:37 CST 2026
Certificate chain #2
Issued to:
Go Daddy Class 2 Certification Authority
Issued by:
http://www.valicert.com/
Valid from:
Tue Jun 29 12:06:20 CDT 2004
Valid to:
Sat Jun 29 12:06:20 CDT 2024
Certificate chain #3
Issued to:
http://www.valicert.com/
Issued by:
http://www.valicert.com/
Valid from:
Fri Jun 25 19:19:54 CDT 1999
Valid to:
Tue Jun 25 19:19:54 CDT 2019
Issue background
SSL helps to protect the confidentiality and integrity of information in transit between the browser and server, and to provide authentication of the server's identity. To serve this purpose, the server must present an SSL certificate which is valid for the server's hostname, is issued by a trusted authority and is valid for the current date. If any one of these requirements is not met, SSL connections to the server will not provide the full protection for which SSL is designed.
It should be noted that various attacks exist against SSL in general, and in the context of HTTPS web connections. It may be possible for a determined and suitably-positioned attacker to compromise SSL connections without user detection even when a valid SSL certificate is used.Report generated by XSS.CX at Thu Dec 30 20:38:49 CST 2010.