Wazuh Walkthrough Detects PHP2Shell Exploitation Attempts and Guides Patching

Summary
A Wazuh walkthrough shows how to identify vulnerable PHP packages, check partial mitigations, and alert on PHP2Shell indicators. It recommends fixed PHP releases as the only complete fix for CVE-2026-109618 and CVE-2026-109619.
Key points
- PHP advisories describe two critical memory-corruption vulnerabilities, CVE-2026-109618 and CVE-2026-109619, that can enable unauthenticated remote code execution; each has a CVSS 4.0 score of 9.2.
- PHP lists fixed releases 8.2.35, 8.3.36, 8.4.27, and 8.5.12. The article says updating to a fixed release is the only complete fix.
- The Wazuh walkthrough monitors Apache error logs, auditd events, and web-root file changes, and adds rules for memory-exhaustion errors, worker crashes, commands run by www-data, and new or modified PHP files.
- Wazuh vulnerability detection identifies affected PHP packages, while a custom Security Configuration Assessment policy checks selected temporary mitigations.
- The article says the vulnerabilities have reportedly been exploited in the wild since October 21, 2026; it cautions that missing relevant log entries do not prove a server is safe.
- Disabling session upload progress and, on PHP 8.5, fatal error backtraces can partially mitigate CVE-2026-109619. These settings do not address CVE-2026-109618.
Article Details
- Defense Focus
- Detect PHP2Shell exposure and exploitation attempts by assessing vulnerable PHP packages and mitigations, monitoring error and audit logs, and identifying suspicious web-root file changes.
- Detection Methods
- Use Wazuh vulnerability detection to identify vulnerable PHP packages.
- Use a custom Security Configuration Assessment policy to check PHP mitigation settings.
- Alert on PHP memory-exhaustion and maximum-execution-time errors in Apache logs, and correlate repeated memory-exhaustion errors from the same source IP.
- Monitor commands executed with effective UID 33, used by the www-data account.
- Use real-time file integrity monitoring to detect new or modified PHP-related files in the web root.
- Monitor Apache worker segmentation-fault alerts as possible exploitation indicators.
- Data Sources
- Apache HTTP Server error logs
- Linux auditd logs, including execve events
- File integrity monitoring events for the web root
- PHP package inventory and vulnerability data
- PHP configuration files checked by the SCA policy
- Rule Types
- Custom Wazuh XML rules with PCRE2 regular expressions and event correlation
- Linux auditd syscall rules for execve events by effective UID 33
- Wazuh Security Configuration Assessment YAML policy
- File integrity monitoring rules for new or modified PHP-related files
- Platforms
- Ubuntu 24.04 Linux endpoint running Apache HTTP Server with mod_php
- Defensive Actions
- Update PHP to a fixed release; the article identifies PHP 8.2.35, 8.3.36, 8.4.27, and 8.5.12, or use the fixed package version specified by the distribution.
- Until updating, disable session.upload_progress.enabled; on PHP 8.5, also disable fatal_error_backtraces.
- Limit request-body size and multipart structure at a reverse proxy or web application firewall; treat memory_limit=-1 as a partial mitigation with denial-of-service tradeoffs.
- For PHP-FPM, consider pm.max_requests = 1 as a partial risk-reduction measure, accounting for the added worker-startup overhead.
- Review adjacent conf.d configuration and Apache php_flag directives because they can override the main php.ini settings.
- Inspect web-root directories for newly created web shells after suspected exploitation.
- Tune detection rules to account for legitimate applications that exhaust memory or run programs as www-data.
MITRE ATT&CK
T1059.004 · Unix ShellThe article monitors shell commands executed by the web server account, including a test that runs /bin/sh as www-data.T1190 · Exploit Public-Facing ApplicationThe article describes unauthenticated remote code execution through crafted HTTP requests to vulnerable PHP web applications and uses this ID in its detection rules.T1505.003 · Web ShellThe article detects new or modified PHP-related files in the web root as possible web shells.
CVE
CVE-2026-109618Vendor / Product unavailablePHP2Shell remote code execution (RCE) refers to two critical memory corruption vulnerabilities in PHP (PHP: Hypertext Preprocessor), tracked as CVE-2026-109618 and CVE-2026-109619.CVE-2026-109619Vendor / Product unavailablePHP2Shell remote code execution (RCE) refers to two critical memory corruption vulnerabilities in PHP (PHP: Hypertext Preprocessor), tracked as CVE-2026-109618 and CVE-2026-109619.
Vendors
Products
Apache HTTP ServerWazuh collects Apache HTTP Server error logs and Linux Audit (auditd) logs to detect suspicious activity.PHPPHP2Shell remote code execution (RCE) refers to two critical memory corruption vulnerabilities in PHP (PHP: Hypertext Preprocessor), tracked as CVE-2026-109618 and CVE-2026-109619.PHP-FPMPHP FastCGI Process Manager (PHP-FPM): Runs PHP behind NGINX, Apache HTTP Server with mod_proxy_fcgi, or another FastCGI frontend.UbuntuIn this blog post, we demonstrate how to detect PHP2Shell remote code execution attempts against an Ubuntu web server using Wazuh.WazuhThe Wazuh unified XDR and SIEM platform helps detect vulnerabilities and investigate exploitation attempts by monitoring endpoint activity and system changes.
