Horizon Alert
Summary of the vulnerability and why it matters
A recently identified vulnerability in PHP, a widely used web development language, presents a critical risk of memory corruption, worker crashes, and potential remote code execution. This issue arises from a specific sequence involving fatal errors during request shutdown and the subsequent handling of error backtraces, which can be triggered under certain configuration conditions that are not the default. The concern is heightened due to the potential for attackers to exploit this to gain control over affected systems.
- Error in PHP could crash servers or allow code execution.
- Widespread use of PHP makes this a significant potential risk.
- Confirm relevance and exposure for critical systems.
Attack Path
How an attacker could exploit the issue
An attacker could exploit this by leveraging specific server configurations that lead to a fatal error during request shutdown. When the server attempts to restore modified settings, it can inadvertently reuse memory that has already been freed, potentially corrupting data and leading to a crash or even remote code execution.
- Entry condition: Specific server configurations.
- Trigger point: Fatal error during request shutdown.
- Resulting risk: Memory corruption or code execution.
Live Threat
Current exploitation, exposure, and threat context
A use-after-free vulnerability in PHP's error handling could lead to memory corruption and worker crashes when specific INI settings are restored during request shutdown. When a fatal error occurs under these conditions, a diagnostic can be emitted using a backtrace that has already been cleaned up, potentially allowing an attacker to access stale data.
- PHP worker memory could be corrupted.
- Stale backtrace data may be accessed.
- Remote code execution is possible.
Operational Fix
Recommended remediation, mitigation, and detection steps
The core issue lies within PHP's error handling during request shutdown, specifically when using per-path configurations like `max_memory_limit` or `zlib.output_compression` with `output_handler`. This can lead to memory corruption and potential remote code execution. Technical leaders, security teams, and system owners responsible for web infrastructure, particularly those managing PHP-FPM or mod_php deployments, must prioritize identifying and assessing the risk associated with these specific configurations. The first practical move involves inventorying all PHP installations, confirming reachability and business criticality, identifying the accountable owner for each instance, and then developing a targeted remediation plan based on the identified risks.
- Owner: Application or Infrastructure teams.
- Verify first: Specific configurations, reachability, and criticality.
- Action: Plan remediation based on risk.