XSS, Reflected Cross Site Scripting, CWE-79, CAPEC-86, apex.oracle.com

Report generated by XSS.CX at Sun Oct 16 21:26:44 CDT 2011.



1. SQL injection

2. Cross-domain Referer leakage



1. SQL injection  next

Summary

Severity:   High
Confidence:   Firm
Host:   http://apex.oracle.com
Path:   /pls/otn/f

Issue detail

The p parameter appears to be vulnerable to SQL injection attacks. The payload ' was submitted in the p parameter, 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 Oracle.

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:

Request

GET /pls/otn/f?p=42988:2' HTTP/1.1
Host: apex.oracle.com
Proxy-Connection: keep-alive
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Referer: http://www.oracle.com/us/corporate/contact/about-your-account-070507.html
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: s_wgw_lv=1315343380912; s_nr6=1315343380933-New; s_cc=true; s_nr=1318816293527; gpw_e24=http%3A%2F%2Fwww.oracle.com%2Fus%2Fcorporate%2Fcontact%2Fabout-your-account-070507.html; s_sq=oraclecom%2Coracleglobal%3D%2526pid%253Docom%25253Aen-us%25253A%25252Fcorporate%25252Fcontact%25252Fabout-your-account-070507.html%2526pidt%253D1%2526oid%253Djavascript%25253AopenWindow('http%25253A%25252F%25252Fapex.oracle.com%25252Fpls%25252Fotn%25252Ff%25253Fp%25253D42988%25253A2'%25252C''%25252C'595'%25252C'435')%2526ot%253DA

Response

HTTP/1.1 200 OK
Date: Mon, 17 Oct 2011 01:55:05 GMT
Server: Oracle-Application-Server-11g
Content-Length: 518
Content-Type: text/html; charset=UTF-8
Content-Language: en

<table summary=""><tr><td><img src="/i/error.gif" border="0" /></td><td>Error</td><td>ERR-1412 Unable to resolve page alias (2').</td></tr><tr><td></td><td></td><td>ORA-06502: PL/SQL: numeric or value error: character to number conversion error
ORA-06502: PL/SQL: numeric or value error: character to number conversion error</td>
...[SNIP]...

2. Cross-domain Referer leakage  previous

Summary

Severity:   Information
Confidence:   Certain
Host:   http://apex.oracle.com
Path:   /pls/otn/f

Issue detail

The page was loaded from a URL containing a query string:The response contains the following link to another domain:

Issue background

When a web browser makes a request for a resource, it typically adds an HTTP header, called the "Referer" header, indicating the URL of the resource from which the request originated. This occurs in numerous situations, for example when a web page loads an image or script, or when a user clicks on a link or submits a form.

If the resource being requested resides on a different domain, then the Referer header is still generally included in the cross-domain request. If the originating URL contains any sensitive information within its query string, such as a session token, then this information will be transmitted to the other domain. If the other domain is not fully trusted by the application, then this may lead to a security compromise.

You should review the contents of the information being transmitted to other domains, and also determine whether those domains are fully trusted by the originating application.

Today's browsers may withhold the Referer header in some situations (for example, when loading a non-HTTPS resource from a page that was loaded over HTTPS, or when a Refresh directive is issued), but this behaviour should not be relied upon to protect the originating URL from disclosure.

Note also that if users can author content within the application then an attacker may be able to inject links referring to a domain they control in order to capture data from URLs used within the application.

Issue remediation

The application should never transmit any sensitive information within the URL query string. In addition to being leaked in the Referer header, such information may be logged in various locations and may be visible on-screen to untrusted parties.

Request

GET /pls/otn/f?p=42988:3:4168696846582948::NO::: HTTP/1.1
Host: apex.oracle.com
Proxy-Connection: keep-alive
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.202 Safari/535.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Referer: http://www.oracle.com/us/corporate/contact/about-your-account-070507.html
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: WWV_CUSTOM-F_5924477525731666862_42988=339128DA72ED85F6; s_wgw_lv=1315343380912; s_nr6=1315343380933-New; s_cc=true; s_nr=1318816293527; gpw_e24=http%3A%2F%2Fwww.oracle.com%2Fus%2Fcorporate%2Fcontact%2Fabout-your-account-070507.html; s_sq=oraclecom%2Coracleglobal%3D%2526pid%253Docom%25253Aen-us%25253A%25252Fcorporate%25252Fcontact%25252Fabout-your-account-070507.html%2526pidt%253D1%2526oid%253Djavascript%25253AopenWindow('http%25253A%25252F%25252Fapex.oracle.com%25252Fpls%25252Fotn%25252Ff%25253Fp%25253D42988%25253A2'%25252C''%25252C'595'%25252C'435')%2526ot%253DA; BIGipServerapex-ext_oracle_com_http=1680380557.24862.0000

Response

HTTP/1.1 200 OK
Date: Mon, 17 Oct 2011 01:51:15 GMT
Server: Oracle-Application-Server-11g
Content-Length: 13203
Content-Type: text/html; charset=UTF-8
Content-Language: en


<html lang="en-us" xmlns:htmldb="http://htmldb.oracle.com">
<head>
<title>External Account Help Form</title>
<link rel="stylesheet" href="/i/themes/theme_1/theme_V3.css" type="text/css" />

<link
...[SNIP]...
<input type="hidden" name="p_request" value="" id="pRequest" /><img border="0" src="http://www.oracleimg.com/us/assets/oralogo-small.gif"><table summary="" cellpadding="0" width="100%" cellspacing="0" border="0">
...[SNIP]...

Report generated by XSS.CX at Sun Oct 16 21:26:44 CDT 2011.