Security Advisory: Oracle DBMS – Critical Access Control Bypass in Login Bug


On January 17, 2006, Oracle released a Critical Patch Update that addresses a vulnerability in the authorization mechanism of Oracle 8i, 9i, and 10g - the company's widely deployed database servers (see: By exploiting the flaw, any database user with minimal privileges can assume the role of database administrator. Moreover, any activity performed by the user while exploiting this flaw is not recorded by the database server's built-in auditing mechanisms. This is a major vulnerability and the three months between the problem's discovery and the release of a fix highlights a serious concern about relying solely on database vendors' patches for an enterprise's defense against database attacks.

The Vulnerabilities

In October of 2005, Imperva's security research group, the Application Defense Center (ADC), discovered a severe vulnerability in the authorization mechanism for Oracle 8i, 9i, and 10g. The discovery was the results of the ADC's extensive research into the TNS protocol used by Oracle for communication between clients and Oracle servers.

The standard authentication mechanism requires a client to supply a valid pair of user name and password. During the login process an Oracle user with no more than “create session” privileges can execute commands in the context of the special database user SYS. This grants any user the highest administrative privileges possible.

The authentication part of the protocol is comprised of two steps, including two different client requests and two server responses respectively. The first request (message code 0x76) contains only the user name while the second (message code 0x73) contains the user name and an obfuscated password.

This second request also contains a list of name-value pairs describing various attributes of the client. The value named “AUTH_ALTER_SESSION” is intended for setting up session attributes related to the locale and language, in the form of an ALTER SESSION SQL statement.

It turns out that this value can contain any SQL statement. Moreover, this command is executed in the context of the SYS user, which operates outside of the Oracle access control mechanism. Thus, by setting the value of “AUTH_ALTER_SESSION” to an arbitrary SQL statement an attacker can execute any arbitrary command in the database. In particular, the attacker can create a new database account and create DBA privileges to the new account.

The Problem of Relying on Database Patches

Oracle was notified almost immediately of the flaw and ADC provided all necessary information for reconstructing the issue. In a matter of days, the vendor acknowledged the issue and its severity. However it took over 2 months for a patch to be released to address this critical vulnerability. During that time there was no recommended workaround for this undisclosed and unpatched vulnerability. While the complexity of modern database platforms may necessitate such delays they are not acceptable for companies who rely on databases to run their business. Databases hold the crown jewels of any organization and with the web connecting customers, partners, and remote employees to these databases they are more exposed than ever.

A More Logical Approach

What is needed is an alternative offering that provides database platform protection outside of the database platform itself. One that is focused on delivering fixes for newly discovered vulnerabilities in extremely short time-frames. There is already a model for this approach. Anti-virus software became a vital part of any organization's layered security because it was apparent that waiting for vendor patches was not acceptable when a new vulnerability is discovered. This idea can be applied to the database platform protection problem. In particular a new breed of database security gateways is becoming available from security vendors. These devices are installed in the line of traffic in front of the database server and scrutinize the messages going from clients to server, detecting possible attacks. Such products have the capability to provide protection against platform-level vulnerabilities in the timeframes of hours or days after a new vulnerability is discovered. Moreover, such security gateways are undetected and untouched by potential attackers and are oblivious to attacks that would render the database's own security mechanisms useless.


The information within this advisory is subject to change without notice. Use of this information constitutes acceptance for use in an AS IS condition. Any use of this information is at the user’s own risk. There are no warranties, implied or expressed, with regard to this information. In no event shall the author be liable for any direct or indirect damages whatsoever arising out of or in connection with the use or spread of this information.

Redistribution of this alert electronically is allowed as long as it is not edited in any way. To reprint this alert, in whole or in part, in any medium other than electronic medium, for permission.