xfocus logo xfocus title
首页 焦点原创 安全文摘 安全工具 安全漏洞 焦点项目 焦点论坛 关于我们
English Version

FreeBSD ncurses存在缓冲溢出


发布时间:2000-04-23
更新时间:2000-04-23
严重程度:
威胁程度:本地管理员权限
错误类型:输入验证错误
利用方式:服务器模式

受影响系统
BSD
FreeBSD 3.4
>> 不影响系统: FreeBSD FreeBSD 4.0
详细描述
FREEBSD一些版本中的ncurses工具(一高级终端处理
库),存在缓冲溢出的攻击,如果TERMCAP环境变量里包含
的数据超过库代码中预定的最大数量,由于不检测的操作会
导致堆栈被覆盖,任何与ncurses有关的SETUID程序就可以
被通过这个漏洞来获得ROOT权限。ncurses1.8.6版本存在
这个漏洞,它在FREEBSD3.4中随带发行。

下面的测试可以看到有缓冲溢出产生:
lubi:venglin:~> cat tescik.c
#include <ncurses.h>
main() { initscr(); }

lubi:venglin:~> cc -g -o te tescik.c -lncurses
lubi:venglin:~> setenv TERMCAP `perl -e 'print "A"x5000'`
lubi:venglin:~> gdb ./te
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"...
(gdb) run
Starting program: /usr/home/venglin/./te

Program received signal SIGSEGV, Segmentation fault.
0x41414141 in ?? ()

测试代码
暂无

解决方案
暂无

相关信息