PHP Release 5.2.2


PHP 5.2.2 Release Announcement

The PHP development team would like to announce the immediate availability of PHP 5.2.2. This release continues to improve the security and the stability of the 5.X branch and all users are strongly encouraged to upgrade to it as soon as possible.

Security Enhancements and Fixes in PHP 5.2.2:

  • Fixed CVE-2007-1001, GD wbmp used with invalid image size (by Ivan Fratric)
  • Fixed a header injection via Subject and To parameters to the mail() function (MOPB-34 by Stefan Esser)
  • Fixed asciiz byte truncation inside mail() (MOPB-33 by Stefan Esser)
  • Fixed wrong length calculation in unserialize S type (MOPB-29 by Stefan Esser)
  • Fixed a bug in mb_parse_str() that can be used to activate register_globals (MOPB-26 by Stefan Esser)
  • Fixed unallocated memory access/double free in in array_user_key_compare() (MOPB-24 by Stefan Esser)
  • Fixed a double free inside session_regenerate_id() (MOPB-22 by Stefan Esser)
  • Added missing open_basedir & safe_mode checks to zip:// and bzip:// wrappers. (MOPB-20, MOPB-21 by Stefan Esser).
  • Fixed substr_compare and substr_count information leak (MOPB-14 by Stefan Esser) (Stas, Ilia)
  • Limit nesting level of input variables with max_input_nesting_level as fix for (MOPB-03 by Stefan Esser)
  • Fixed CRLF injection inside ftp_putcmd(). (by loveshell[at]Bug.Center.Team)
  • Fixed a possible super-global overwrite inside import_request_variables(). (by Stefano Di Paola, Steffan Esser)
  • Fixed a remotely trigger-able buffer overflow inside make_http_soap_request(). (by Ilia Alshanetsky)
  • Fixed a buffer overflow inside user_filter_factory_create(). (by Ilia Alshanetsky)
  • Fixed a remotely trigger-able buffer overflow inside bundled libxmlrpc library. (by Stanislav Malyshev)

While majority of the issues outlined above are local, in some circumstances given specific code paths they can be triggered externally. Therefor, we strongly recommend that if you use code utilizing the functions and extensions identified as having had vulnerabilities in them, you consider upgrading your PHP.

The key improvements of PHP 5.2.2 include:

  • Further improvements to the Memory Manager with the goal of improving realloc() performance.
  • Bundled GD, SQLite and PCRE libraries were upgraded.
  • Additional methods were added to SPL's DirectoryIterator and SplFileInfo classes.
  • Over 120 bug fixes.

For users upgrading from PHP 5.0 and PHP 5.1, an upgrade guide is available here, detailing the changes between those releases and PHP 5.2.2.

For a full list of changes in PHP 5.2.2, see the ChangeLog.

Source Code
Change Logs
added tidynode
  • Added --ri switch to CLI which allows to check extension information.
added openbasedir and safemode checks in zip
  • Added php_pdo_sqlite_external.dll, a version of the PDO SQLite driver that links against an external sqlite3.dll. This provides Windows users to upgrade their sqlite3 version outside of the PHP release cycle.
  • Added linenumbers to array returned by token_get_all().
  • Upgraded SQLite 3 to version 3.3.16
  • Upgraded libraries bundled in the Windows distribution.
  • c-client to version 2006e
  • libpq to version 8.2.3
  • libmysql to version 5.0.37
  • openssl to version 0.9.8e
  • Upgraded PCRE to version 7.0
  • Updated timezone database to version 2007.5.
  • Fixed commandline handling for CLI and CGI.
  • Fixed iterator_apply() with a callback using __call().
  • Fixed possible multi bytes issues in openssl csr parser
  • Fixed shmop_open() with IPC_CREAT|IPC_EXCL flags on Windows. .
fixed possible leak in ziparchive
  • Fixed possible relative path issues in zip_open and TS mode (old API)
  • Fixed zend_llist_remove_tail
  • Fixed a thread safety issue in gd gif read code
  • Fixed CVE-2007-1001, GD wbmp used with invalid image size
  • Fixed unallocated memory access/double free in in array_user_key_compare() (MOPB-24 by Stefan Esser)
  • Fixed wrong length calculation in unserialize S type (MOPB-29 by Stefan Esser)
  • Fixed bug #41215 (setAttribute return code reversed).
  • Fixed bug #41192 (Per Directory Values only work for one key).
  • Fixed bug #41175 (addAttribute() fails to add an attribute with an empty value).
  • Fixed bug #41159 (mysql_pconnect() hash does not account for connect flags).
  • Fixed bug #41121 (range() overflow handling for large numbers on 32bit machines).
  • Fixed bug #41118 (PHP does not handle overflow of octal integers).
  • Fixed bug #41109 (recursiveiterator.inc says "implements" Iterator instead of "extends").
  • Fixed bug #40130 (TTF usage doesn't work properly under Netware).
  • Fixed bug #41093 (magic_quotes_gpc ignores first arrays keys).
  • Fixed bug #41075 (memleak when creating default object caused exception).
  • Fixed bug #41067 (json_encode() problem with UTF-16 input).
  • Fixed bug #41063 (chdir doesn't like root paths).
fixed bug #41061 ("visibility error" in reflectionfunction
  • Fixed bug #41043 (pdo_oci crash when freeing error text with persistent connection).
  • Fixed bug #41037 (unregister_tick_function() inside the tick function crash PHP).
  • Fixed bug #41034 (json_encode() ignores null byte started keys in arrays).
fixed bug #41026 (segfault when calling "self
  • Fixed bug #40999 (mcrypt_create_iv() not using random seed).
  • Fixed bug #40998 (long session array keys are truncated).
  • Implement feature request #40947, allow a single filter as argument for filter_var_array
  • Fixed bug #40935 (pdo_mysql does not raise an exception on empty fetchAll()).
  • Fixed bug #40931 (open_basedir bypass via symlink and move_uploaded_file()).
  • Fixed bug #40921 (php_default_post_reader crashes when post_max_size is exceeded).
  • Fixed bug #40915 (addcslashes unexpected behavior with binary input).
  • Fixed bug #40899 (memory leak when nesting list()).
  • Fixed bug #40897 (error_log file not locked).
  • Fixed bug #40883 (mysql_query() is allocating memory incorrectly).
  • Fixed bug #40872 (inconsistency in offsetSet, offsetExists treatment of string enclosed integers).
  • Fixed bug #40861 (strtotime() doesn't handle double negative relative time units correctly).
  • Fixed bug #40854 (imap_mail_compose() creates an invalid terminator for multipart e-mails).
  • Fixed bug #40848 (sorting issue on 64-bit Solaris).
  • Fixed bug #40836 (Segfault in ext/dom).
  • Fixed bug #40833 (Crash when using unset() on an ArrayAccess object retrieved via __get()).
  • Fixed bug #40822 (pdo_mysql does not return rowCount() on select).
fixed bug #40815 (using strings like "class
  • Fixed bug #40809 (Poor performance of ".=").
  • Fixed bug #40805 (Failure executing function ibase_execute()).
  • Fixed bug #40800 (cannot disable memory_limit with -1).
fixed bug #40794 (reflectionobject
  • Fixed bug #40784 (Case sensitivity in constructor's fallback).
  • Fixed bug #40770 (Apache child exits when PHP memory limit reached).
  • Fixed bug #40764 (line thickness not respected for horizontal and vertical lines).
  • Fixed bug #40758 (Test fcgi_is_fastcgi() is wrong on windows).
  • Fixed bug #40754 (added substr() & substr_replace() overflow checks).
  • Fixed bug #40752 (parse_ini_file() segfaults when a scalar setting is redeclared as an array).
  • Fixed bug #40750 (openssl stream wrapper ignores default_stream_timeout).
  • Fixed bug #40727 (segfault in PDO when failed to bind parameters).
  • Fixed bug #40709 (array_reduce() behaves strange with one item stored arrays).
  • Fixed bug #40703 (Resolved a possible namespace conflict between libxmlrpc and MySQL's NDB table handler).
  • Fixed bug #40961 (Incorrect results of DateTime equality check).
  • Fixed bug #40678 (Cross compilation fails).
  • Fixed bug #40621 (Crash when constructor called inappropriately).
  • Fixed bug #40609 (Segfaults when using more than one SoapVar in a request).
  • Fixed bug #40606 (umask is not being restored when request is finished).
  • Fixed bug #40598 (libxml segfault).
  • Fixed bug #40591 (list()="string"; gives invalid opcode).
  • Fixed bug #40578 (imagettftext() multithreading issue).
  • Fixed bug #40576 (double values are truncated to 6 decimal digits when encoding).
  • Fixed bug #40560 (DIR functions do not work on root UNC path).
fixed bug #40546 (splfileinfo
  • Fixed bug #40545 (multithreading issue in zend_strtod()).
  • Fixed bug #40503 (json_encode() value corruption on 32bit systems with overflown values).
  • Fixed bug #40467 (Partial SOAP request sent when XSD sequence or choice include minOccurs=0).
  • Fixed bug #40465 (Ensure that all PHP elements are printed by var_dump).
  • Fixed bug #40464 (session.save_path wont use default-value when safe_mode or open_basedir is enabled).
  • Fixed bug #40455 (proc_open() uses wrong command line when safe_mode_exec_dir is set).
  • Fixed bug #40432 (strip_tags() fails with greater than in attribute).
  • Fixed bug #40431 (dynamic properties may cause crash in ReflectionProperty methods).
  • Fixed bug #40451 (addAttribute() may crash when used with non-existent child node).
fixed bug #40442 (arrayobject
  • Fixed bug #40428 (imagepstext() doesn't accept optional parameter).
  • Fixed bug #40417 (Allow multiple instances of the same named PDO token in prepared statement emulation code).
  • Fixed bug #40414 (possible endless fork() loop when running fastcgi).
  • Fixed bug #40410 (ext/posix does not compile on MacOS 10.3.9).
  • Fixed bug #40392 (memory leaks in PHP milter SAPI).
  • Fixed bug #40371 (pg_client_encoding() not working on Windows).
  • Fixed bug #40352 (FCGI_WEB_SERVER_ADDRS function get lost).
  • Fixed bug #40290 (strtotime() returns unexpected result with particular timezone offset).
  • Fixed bug #40286 (PHP fastcgi with PHP_FCGI_CHILDREN don't kill children when parent is killed).
  • Fixed bug #40261 (Extremely slow data handling due to memory fragmentation).
  • Fixed bug #40236 (php -a function allocation eats memory).
  • Fixed bug #40109 (iptcembed fails on non-jfif jpegs).
  • Fixed bug #39965 (Latitude and longitude are backwards in date_sun_info()).
  • Implement #39867 (openssl PKCS#12 support)
  • Fixed bug #39836 (SplObjectStorage empty after unserialize).
  • Fixed bug #39416 (Milliseconds in date()).
  • Fixed bug #39396 (stream_set_blocking crashes on Win32).
  • Fixed bug #39351 (relative include fails on Solaris).
  • Fixed bug #39322 (proc_terminate() destroys process resource).
  • Fixed bug #38406 (crash when assigning objects to SimpleXML attributes).
  • Fixed bug #37799 (ftp_ssl_connect() falls back to non-ssl connection).
  • Fixed bug #36496 (SSL support in imap_open() not working on Windows).
  • Fixed bug #36226 (Inconsistent handling when passing nillable arrays).
  • Fixed bug #35872 (Avoid crash caused by object store being referenced during RSHUTDOWN).
  • Fixed bug #34794 (proc_close() hangs when used with two processes).
  • Fixed PECL bug #10194 (crash in Oracle client when memory limit reached in the callback).
  • Fixed substr_compare and substr_count information leak (MOPB-14)
  • Fixed crash on op-assign where argument is string offset
  • Fixed bug #38710 (data leakage because of nonexisting boundary checking in statements in mysqli)
  • Fixed bug #37386 (autocreating element doesn't assign value to first node).
  • Fixed bug #37013 (server hangs when returning circular object references).
  • Fixed bug #33664 Console window appears when using exec()
To Top