Bug #15153 Updated: Php starts writing log in an infinite loop resulting is system DoS

From: Date: Tue, 18 Jun 2002 10:15:37 +0000
Subject: Bug #15153 Updated: Php starts writing log in an infinite loop resulting is system DoS
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-11102@lists.php.net to get a copy of this message
ID: 15153 Updated by: derick@php.net Reported By: mikael.jokela@ursa.fi -Status: Open +Status: Bogus Bug Type: Directory function related Operating System: Linux 2.2.20 (Redhat 5.2) PHP Version: 4.1.1 New Comment: Sorry, but the bug system is not the appropriate forum for asking support questions. Your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php Thank you for your interest in PHP. Previous Comments: ------------------------------------------------------------------------ [2002-02-24 07:48:14] nohn@php.net Fixed this in the documentation, but I still think it's an issue that should be fixed in the PHP-source ------------------------------------------------------------------------ [2002-01-22 14:21:51] sander@php.net Reclassified as a documentation problem. ------------------------------------------------------------------------ [2002-01-21 16:23:16] mikael.jokela@ursa.fi A piece of code that you have at http://www.php.net/manual/en/function.readdir.php leads to system DoS with php-4.1.1, Linux 2.2.20, apache 1.3.22: Example 1. List all files in the current directory <?php $handle=opendir('.'); echo "Directory handle: $handle\n"; echo "Files:\n"; while (false !== ($file = readdir($handle))) { echo "$file\n"; } closedir($handle); ?> When this code is executed, php enters a loop writing this line to the log file an infinite number of times: [date] PHP Warning: Supplied argument is not a valid Directory resource in /path/to/script.php on line 5. Httpd uses all processor time and finally fills the partition in which the log file is located. The problem seems to be the dot in the function call because the script works normally if the dot is replaced with an absolute path name. My apacle 1.3.22 web server includes the following modules: mod_ssl 2.8.5, mod_perl 1.26, php-3.0.18, php-4.1.1. Php-4.1.1 has been compiled as a dynamic module with the following options: --enable-versioning --with-apxs --with-mysql --with-xml --enable-calendar --enable-memory-limit --enable-session --enable-safe-mode --with-openssl --enable-bcmath --with-gd I also tried this with php-4.0.6 and the result is the same. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=15153&edit=1

« previous php.bugs (#11102) next »