| Oracle Database Link Buffer Overflow
Author : David Litchfield <firstname.lastname@example.org>
NGSSoftware Insight Security Research Advisory
Name: Oracle Database Link Buffer Overflow
Systems Affected: All platforms; Oracle9i Database Release 2 and 1, 8i
releases, 8 all releases, 7.3.x
Severity: High Risk
Vendor URL: http://www.oracle.com
Author: David Litchfield (email@example.com)
Date: 29th April 2003
Advisory number: #NISR29042003
Oracle is the leader in the database market with a 54% market share lead
under ERP (Enterprise Resource Planning). The database server is vulnerable
to a remotely exploitable buffer overflow vulnerability. The problem exists
with database links; functionality that allows the querying of one Oracle
database server from another.
A classic stack based buffer overflow vulnerability exists in the Oracle
database server that can be set up for exploitation by providing an overly
long parameter for a connect string with the 'CREATE DATABASE LINK' query:
CREATE DATABASE LINK ngss
CONNECT TO hr
IDENTIFIED BY hr
By default, the 'CREATE DATABASE LINK' privilege is assigned to the CONNECT
role and as most Oracle accounts are assigned membership of this role
low privileged accounts such as SCOTT and ADAMS can create database links.
By creating a specially crafted database link and then by selecting from
select * from table@ngss
the overflow can be triggered, overwriting the saved return address on
stack. This allows an attacker to gain control of the Oracle process'
of execution and permits the execution of arbitrary, user supplied code.
code supplied would run in the security context of the account running
Oracle database server. On unix based systems this is typically the 'oracle'
user and on Windows the local SYSTEM user. In the former this allows for
full compromise of the data and in the latter a full compromise of the
and the operating system.
This is a high risk vulnerability and as such should be patched as soon
possible, after a suitable period of testing.
NGSSoftware alerted Oracle to this vulnerability on 30th September 2002.
Oracle has reviewed the code and created a patch which is available from:
NGSSoftware advise Oracle database customers to review and install the
as a matter of urgency.
A check for this issue already exists in NGSSQuirreL for Oracle, a
comprehensive automated vulnerability assessment tool for Oracle Database
Servers of which more information is available from the NGSSite
It is further recommend that Oracle DBAs have their network/firewall
administrators ensure that the database server is protected from Internet
For further information about the scope and effects of buffer overflows,
NGSSoftware design, research and develop intelligent, advanced application
security assessment scanners. Based in the United Kingdom, NGSSoftware
offices in the South of London and the East Coast of Scotland. NGSSoftware's
sister company NGSConsulting, offers best of breed security consulting
services, specialising in application, host and network security
Telephone +44 208 401 0070
Fax +44 208 401 0076