The session extension in PHP 4 before 4.4.5, and PHP 5 before 5.2.1, calculates the reference count for the session variables without considering the internal pointer from the session globals, which allows context-dependent attackers to execute arbitrary code via a crafted string in the session_register after unsetting HTTP_SESSION_VARS and _SESSION, which destroys the session data Hashtable.
https://exchange.xforce.ibmcloud.com/vulnerabilities/33520
http://www.vupen.com/english/advisories/2007/2374
http://www.vupen.com/english/advisories/2007/1991
http://www.ubuntu.com/usn/usn-455-1
http://www.php-security.org/MOPB/MOPB-30-2007.html
http://www.novell.com/linux/security/advisories/2007_32_php.html
http://www.debian.org/security/2007/dsa-1283
http://security.gentoo.org/glsa/glsa-200705-19.xml
http://secunia.com/advisories/25850
http://secunia.com/advisories/25445
http://secunia.com/advisories/25423
http://secunia.com/advisories/25062
http://secunia.com/advisories/25057
http://secunia.com/advisories/25056
http://h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?lang=en&cc=us&objectID=c01086137
http://h20000.www2.hp.com/bizsupport/TechSupport/Document.jsp?lang=en&cc=us&objectID=c01056506