The REST URL parameter 1 appears to be vulnerable to SQL injection attacks. The payloads 20203336'%20or%201%3d1--%20 and 20203336'%20or%201%3d2--%20 were each submitted in the REST URL parameter 1. These two requests resulted in different responses, indicating that the input is being incorporated into a SQL query in an unsafe way.
Note that automated difference-based tests for SQL injection flaws can often be unreliable and are prone to false positive results. You should manually review the reported requests and responses to confirm whether a vulnerability is actually present.
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.
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.
GET /triple-play20203336'%20or%201%3d1--%20 HTTP/1.1 Host: 18.104.22.168 Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close
HTTP/1.1 403 Forbidden Date: Thu, 09 Dec 2010 20:59:24 GMT Server: Apache/2.2.3 (CentOS) Content-Length: 310 Connection: close Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>403 Forbidden</title> </head><body> <h1>Forbidden</h1> <p>You don't have permission to access /triple-play20203336' or 1=1-- on this server.</p> <hr> <address>Apache/2.2.3 (CentOS) Server at 22.214.171.124 Port 80</address> </body></html>
GET /triple-play20203336'%20or%201%3d2--%20 HTTP/1.1 Host: 126.96.36.199 Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close
HTTP/1.1 404 Not Found Date: Thu, 09 Dec 2010 20:59:24 GMT Server: Apache/2.2.3 (CentOS) X-Powered-By: PHP/5.1.6 Set-Cookie: SESS20f82c4c44c491cc076ff06b1879c072=vkiuhrpa2o48vpjj8k2jp2g200; expires=Sun, 02 Jan 2011 00:32:44 GMT; path=/ Expires: Sun, 19 Nov 1978 05:00:00 GMT Last-Modified: Thu, 09 Dec 2010 20:59:24 GMT Cache-Control: store, no-cache, must-revalidate Cache-Control: post-check=0, pre-check=0 Content-Length: 7546 Connection: close Content-Type: text/html; charset=utf-8
The following cookie was issued by the application and does not have the HttpOnly flag set:
SESS20f82c4c44c491cc076ff06b1879c072=7f91ht0u26t7pqs855pvso8sn0; expires=Sun, 02 Jan 2011 00:32:15 GMT; path=/
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.
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.
GET /triple-play HTTP/1.1 Host: 188.8.131.52 Accept: */* Accept-Language: en User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0) Connection: close
HTTP/1.1 200 OK Date: Thu, 09 Dec 2010 20:58:55 GMT Server: Apache/2.2.3 (CentOS) X-Powered-By: PHP/5.1.6 Set-Cookie: SESS20f82c4c44c491cc076ff06b1879c072=7f91ht0u26t7pqs855pvso8sn0; expires=Sun, 02 Jan 2011 00:32:15 GMT; path=/ Expires: Sun, 19 Nov 1978 05:00:00 GMT Last-Modified: Thu, 09 Dec 2010 20:58:55 GMT Cache-Control: store, no-cache, must-revalidate Cache-Control: post-check=0, pre-check=0 Connection: close Content-Type: text/html; charset=utf-8 Content-Length: 13685
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en" dir="ltr"> <head ...[SNIP]...
The TRACE method is designed for diagnostic purposes. If enabled, the web server will respond to requests which use the TRACE method by echoing in its response the exact request which was received.
Although this behaviour is apparently harmless in itself, it can sometimes be leveraged to support attacks against other application users. If an attacker can find a way of causing a user to make a TRACE request, and can retrieve the response to that request, then the attacker will be able to capture any sensitive data which is included in the request by the user's browser, for example session cookies or credentials for platform-level authentication. This may exacerbate the impact of other vulnerabilities, such as cross-site scripting.
The TRACE method should be disabled on the web server.
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.
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.
GET /robots.txt HTTP/1.0 Host: 184.108.40.206
HTTP/1.1 200 OK Date: Thu, 09 Dec 2010 20:58:56 GMT Server: Apache/2.2.3 (CentOS) Last-Modified: Wed, 10 Dec 2008 20:12:20 GMT ETag: "2003c7-636-e092f100" Accept-Ranges: bytes Content-Length: 1590 Cache-Control: max-age=1209600 Expires: Thu, 23 Dec 2010 20:58:56 GMT Connection: close Content-Type: text/plain; charset=UTF-8
# $Id: robots.txt,v 220.127.116.11 2008/12/10 20:12:19 goba Exp $ # # robots.txt # # This file is to prevent the crawling and indexing of certain parts # of your site by web crawlers and spiders run by sites ...[SNIP]...
Report generated by XSS.CX at Thu Dec 09 19:44:53 CST 2010.