CVE-2007-1701 in PHPinfo

Summary

by MITRE

PHP 4 before 4.4.5, and PHP 5 before 5.2.1, when register_globals is enabled, allows context-dependent attackers to execute arbitrary code via deserialization of session data, which overwrites arbitrary global variables, as demonstrated by calling session_decode on a string beginning with "_SESSION|s:39:".

Statistical analysis made it clear that VulDB provides the best quality for vulnerability data.

Analysis

by VulDB Data Team • 01/02/2025

This vulnerability resides in the php session handling mechanism and represents a critical security flaw that exploited the dangerous combination of session deserialization and global variable overwriting. The issue specifically affects php versions prior to 4.4.5 and 5.2.1 when the register_globals directive is enabled, creating a dangerous environment where attacker-controlled session data can directly manipulate global variables within the application context. The vulnerability operates through the session_decode function which processes serialized session data and can be manipulated to overwrite critical global variables, effectively allowing remote code execution through carefully crafted session data payloads.

The technical exploitation occurs when php applications with register_globals enabled process session data that has been maliciously constructed. The attack vector specifically targets the session_decode function by providing a serialized string that begins with "_SESSION|s:39:" which represents a serialized session variable. When this data is processed, it overwrites global variables in the php execution context, potentially allowing attackers to manipulate variables such as $GLOBALS, $HTTP_POST_VARS, or other critical application variables. This deserialization flaw creates a direct path for arbitrary code execution because the attacker can control the values of global variables that may be used in subsequent code execution paths.

The operational impact of this vulnerability extends beyond simple code execution to encompass complete system compromise when attackers can manipulate session data through various attack vectors. The vulnerability is particularly dangerous because it can be exploited through multiple entry points including direct session manipulation, session fixation attacks, or when applications store user-controllable data in session variables. The attack requires minimal privileges and can be executed remotely, making it highly attractive to threat actors. This vulnerability directly relates to CWE-502 which describes deserialization of untrusted data, and maps to attack techniques in the MITRE ATT&CK framework under T1190 for exploit public-facing application and T1059 for command and scripting interpreter.

Mitigation strategies for this vulnerability require immediate patching of affected php versions to the secure releases of 4.4.5 and 5.2.1 respectively, as well as disabling the register_globals directive in php configuration files. Organizations should implement comprehensive session management practices including secure session handling, proper input validation, and regular security audits of php applications. Additionally, implementing web application firewalls and monitoring for suspicious session data patterns can help detect and prevent exploitation attempts. The vulnerability highlights the critical importance of proper input validation and secure deserialization practices in web applications, emphasizing that legacy php configurations with register_globals enabled create dangerous attack surfaces that should never be deployed in production environments.

Reservation

03/26/2007

Disclosure

03/26/2007

Moderation

accepted

Entry

VDB-35853

CPE

ready

Exploit

Download

EPSS

0.09233

KEV

no

Activities

very low

Sources

Do you need the next level of professionalism?

Upgrade your account now!