Potential SQL Injection, Error Message, Unknown Error, safebrowing-cache.google.com

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

Report generated by XSS.CX at Mon Mar 07 18:47:14 CST 2011.


The DORK Report

Loading

1. SQL injection



1. SQL injection

Summary

Severity:   High
Confidence:   Tentative
Host:   http://safebrowsing-cache.google.com
Path:   /safebrowsing/rd/ChFnb29nLXBoaXNoLXNoYXZhchAAGPyKCCCAiwgqBX4FAgAHMgV8BQIAAw

Issue detail

The REST URL parameter 2 appears to be vulnerable to SQL injection attacks. A single quote was submitted in the REST URL parameter 2, 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.

The application attempts to block SQL injection attacks but this can be circumvented by submitting a URL-encoded NULL byte (%00) before the characters that are being blocked.

Remediation detail

NULL byte bypasses typically arise when the application is being defended by a web application firewall (WAF) that is written in native code, where strings are terminated by a NULL byte. You should fix the actual vulnerability within the application code, and if appropriate ask your WAF vendor to provide a fix for the NULL byte bypass.

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 1

GET /safebrowsing/rd%00'/ChFnb29nLXBoaXNoLXNoYXZhchAAGPyKCCCAiwgqBX4FAgAHMgV8BQIAAw HTTP/1.1
Host: safebrowsing-cache.google.com
Proxy-Connection: keep-alive
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
Cookie: NID=44=NLuMp3417m8odI2kgKoK0A9p5Zbo3ZdtXwvdKKMV4OPqg_Zuo2Ezf9BVsMmTxkcNslji8SfApF7PwYFCUy7kDtVKeEW6L3TI2jLyvFf2FDBnI4gzHRO3L31TL_H4N7LF; PREF=ID=b1572e52fc3cd4d5:U=846c862c779dbef7:FF=4:LD=en:CR=2:TM=1297804539:LM=1299471523:GM=1:SG=1:S=JH9_j-3d5-ocfRZg

Response 1

HTTP/1.1 404 Not Found
Content-Type: text/html; charset=UTF-8
X-Content-Type-Options: nosniff
Date: Mon, 07 Mar 2011 04:21:00 GMT
Server: sffe
Content-Length: 11857
X-XSS-Protection: 1; mode=block

<!DOCTYPE html>
<html lang=en>
<meta charset=utf-8>
<title>Error 404 (Not Found)!!1</title>
<style>
*{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html,b,i{color:#222}html{ba
...[SNIP]...

Request 2

GET /safebrowsing/rd%00''/ChFnb29nLXBoaXNoLXNoYXZhchAAGPyKCCCAiwgqBX4FAgAHMgV8BQIAAw HTTP/1.1
Host: safebrowsing-cache.google.com
Proxy-Connection: keep-alive
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
Cookie: NID=44=NLuMp3417m8odI2kgKoK0A9p5Zbo3ZdtXwvdKKMV4OPqg_Zuo2Ezf9BVsMmTxkcNslji8SfApF7PwYFCUy7kDtVKeEW6L3TI2jLyvFf2FDBnI4gzHRO3L31TL_H4N7LF; PREF=ID=b1572e52fc3cd4d5:U=846c862c779dbef7:FF=4:LD=en:CR=2:TM=1297804539:LM=1299471523:GM=1:SG=1:S=JH9_j-3d5-ocfRZg

Response 2

HTTP/1.1 302 Found
Cache-Control: private
Content-Type: text/html; charset=UTF-8
Location: http://sorry.google.com/sorry/?continue=http://safebrowsing-cache.google.com/safebrowsing/rd%2500%27%27/ChFnb29nLXBoaXNoLXNoYXZhchAAGPyKCCCAiwgqBX4FAgAHMgV8BQIAAw
Content-Length: 359
Date: Mon, 07 Mar 2011 04:21:04 GMT
Server: GFE/2.0

<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>302 Moved</TITLE></HEAD><BODY>
<H1>302 Moved</H1>
The document has moved
<A HREF="http://sorry.google.com/sorry/?c
...[SNIP]...

Report generated by XSS.CX at Mon Mar 07 18:47:14 CST 2011.