PHP2Shell: Is Your PHP Infrastructure at Risk?

A practical SOC guide to check your PHP systems for vulnerabilities, assess your exposure, and take the right steps to secure your infrastructure.

PHP2Shell: Is Your PHP Infrastructure at Risk?
In brief: what happened and what to do

Two critical vulnerabilities, CVE-2026-109618 and CVE-2026-109619 (CVSS v4.0: 9.2, PHP score), affect the PHP runtime and can allow unauthenticated remote code execution. PHP released fixes on 21 October 2026: 8.2.35, 8.3.36, 8.4.27 and 8.5.12. A third vulnerability, CVE-2026-115560, disclosed on 23 October, remains unpatched in those releases and has specific exploitation conditions.

The priority is to identify the PHP version that actually serves web traffic, apply the fixed release and restart or reload the PHP processes. Checking only with php -v is not enough: the CLI, PHP-FPM and the Apache PHP module may run different versions. Include containers, test environments and products that bundle PHP in your inventory.

In parallel, watch for signs of exploitation: web processes spawning shells, suspicious multipart requests, worker crashes and new PHP files in upload directories.

In brief: what happened and what to do

Why it matters

According to W3Techs, PHP was used by 69.2% of the websites whose server-side language is known, as of 21 October 2026, a statistic Hadrian used in its PHP2Shell analysis to illustrate the potential scale of exposure. The percentage does not mean that 69.2% of sites are vulnerable; real exposure depends on the installed version, the distributor's packages and the system configuration.

The exposure is not merely theoretical. Wiz Research demonstrated unauthenticated code execution on the current official container images for WordPress, Drupal and Joomla. Standard CMS installs are therefore direct targets, with no special configuration required.

What we know about exploitation as of 27 October

Amazon Threat Intelligence observed an attempt in its MadPot honeypots on 17 October, before the vulnerabilities and patches were published. Retroactive log review should therefore start from 17 Oct 2026. Scanning and exploitation attempts were reported afterwards, and PoCs became public.

On 24 October, the first high-quality public confirmation of successful exploitation appeared: Adel Karimi, detection & response lead at Perplexity, recorded in his honeypots 35 shells launched from two IP addresses, on Apache mod_php with PHP 8.4.26, through a four-stage HTTP chain that matched a public PoC. The evidence included an 800 KiB memory dump, which led Karimi to conclude “confirmed RCE with usable memory disclosure”. The finding was independently validated by Marcus Hutchins (Expel) as “by far the highest quality confirmation of in-the-wild exploitation so far”. Karimi stressed, however, that the test ran on an intentionally favorable single-worker mod_php profile and does not measure reliability on other worker counts, builds or applications.

On 26 October, CISA added both CVEs to its Known Exploited Vulnerabilities (KEV) catalog, with a remediation deadline of 29 October for US federal agencies. Separately, CYFIRMA reported, with moderate confidence, a scanning and probing campaign attributed to the Lazarus ecosystem, targeting 216 unpatched or partly mitigated PHP hosts, probing activity, not confirmed exploitation.

The technical part: identifying and remediating vulnerable systems
1. Inventory every place PHP runs
  • Check the CMDB, vulnerability scanners, server configs, repositories and container images.

  • Include VMs, App Service, Kubernetes, containers, staging/test environments, on-premises applications and third-party products/appliances that bundle PHP.

  • Prioritize internet-facing systems, especially those running Apache mod_php, as well as applications that accept uploads.

  • Use the X-Powered-By header or external fingerprinting only as hints, they do not confirm the real runtime version.

2. Check the version that serves web traffic

Do not rely on the CLI version alone. The version shown by php -v may differ from PHP-FPM's or the Apache module's. Check them separately:

For packages shipped by Linux distributions, check whether a backport of the patch exists. A seemingly older version number does not automatically mean the package is vulnerable; consult the distribution's changelog.

3. Determine the execution mode (SAPI) - risk differs

Risk is not the same for every install. The table summarizes what has been confirmed by researchers and what follows from code analysis. If mod_php is loaded and serves public applications, the system falls into the very high risk category.

4. Apply the patch and confirm the updated code is running

Update to the fixed release for your branch. Then restart or reload the PHP-FPM/Apache services and the relevant workers, following your operational procedures. Re-check the version through the path used by the web application. Updating the package without restarting the processes can leave existing workers still running the vulnerable code.

For PHP 8.1 and older, check whether your distributor provides documented backported patches. If no supported fix exists, plan a migration. Rebuild container images from updated base images and redeploy them; updating the host does not update PHP inside the container.

5. Check per-request INI overrides (consumer for CVE-2026-109619)

Warnings generated when applying per-directory INI settings can act as a “consumer” in the CVE-2026-109619 chain. Look for php_value / php_flag / php_admin_* directives in .htaccess and Apache config, and PHP_VALUE / PHP_ADMIN_VALUE sent by nginx to FPM. Hiding errors does not protect you, because the global state is accessed before PHP decides whether to display the message. Move the configuration into php.ini or the FPM pool.

6. Temporarily mitigate CVE-2026-115560

CVE-2026-115560 is a separate vector, disclosed on 23 October and still unpatched as of 27 October — PHP is expected to publish the full advisory, with affected versions and the CVSS score, with the next release, with no announced date. Per PHP's notice, the risk arises only when three conditions are met simultaneously:

1.  session.serialize_handler is php_binary or php_serialize;

2.  the application switches the handler to php via ini_set() before session_start(); and

3.  session.upload_progress.enabled stays enabled.

Applications that do not switch the session handler at runtime are not exposed through this specific vector. Temporary measure: set session.upload_progress.enabled=0 in php.ini or .user.ini, or via the PHP-FPM pool configuration. Test the effect on upload functionality, then reload the services and confirm the effective setting. This measure does not replace the patches for CVE-2026-109618 and CVE-2026-109619.

7. Compensating controls and their limits

If you cannot patch immediately, consider temporarily isolating the exposed system and controls that reduce multipart traffic. Any change must be approved, tested and monitored. WAF rules can reduce some attempts, but they do not fix the runtime and have limited efficacy against formally valid requests.

Do not treat the following as a fix:

  • hiding errors (display_errors=Off, error_reporting, log_errors=Off or the @ operator)- the attack happens before application code runs;

  • a CMS maintenance mode;

  • WAF rules based on payload signatures (the malicious requests are formally valid).

The absence of errors in logs does not prove the system was not targeted. Do not test production systems with public PoCs: many are unreliable, some may contain unsafe code, and a negative result does not prove the server is not vulnerable.

Detection and response

Alongside patching, the SOC recommends a retroactive review of exposed systems at least from 17 Oct 2026, where telemetry exists. Correlate suspicious access with process execution, file changes, outbound connections and authentication events. The absence of telemetry or alerts does not prove exploitation did not occur.

1. Process telemetry / EDR

Alert on any process spawned by php-fpm, php-cgi, httpd or apache2 that starts a shell or download tools (sh, bash, dash, curl, wget, nc, python, perl). In normal operation this behavior is rare and should be treated as possible compromise.

2. Web and PHP logs

•   Bursts of POST multipart/form-data requests from the same source, especially with an unusual number of parts or headers.

•   Deeply nested field names or requests that include PHP_SESSION_UPLOAD_PROGRESS, including to endpoints that should not accept uploads.

•   Repeated HTTP 500 responses, crashes or unexpected restarts of PHP workers.

•   Malformed or unusually long PHPSESSID cookies and repeated errors (SIGSEGV, AH00052, zend_mm_heap corrupted, "Allowed memory size … in Unknown on line 0") in the PHP, Apache or FPM logs.

3. File system and persistence

•   New or modified PHP files in upload, cache or web-accessible directories; check timestamp, owner and content.

•   New cron jobs for the web server user, recently added SSH keys or accounts; unusual outbound connections initiated by web workers.

4. How to use indicators of compromise (IOCs)

Treat IOCs as starting points for correlation, not as standalone proof: some addresses may belong to anonymization infrastructure or appear in legitimate traffic. A match does not confirm compromise and does not justify automatic blocking. Validate the source, date and context of each indicator, comparing it against host/network telemetry.

Incident response: if there are credible signs of compromise

1.  Isolate the affected system and limit network access without destroying evidence.

2.  Preserve logs and, where possible, a disk image and relevant memory/process artifacts.

3.  Rotate all credentials accessible to the web process: database passwords, API keys, tokens and .env secrets.

4.  Continue the investigation for persistence, exfiltration and lateral movement. Updating PHP alone does not remove an attacker's access if the system was already compromised.

5.  Escalate to the SOC/IR team and assess applicable notification obligations (GDPR, NIS2).

Reference tables

Affected and fixed versions

Reference tables

The two fixed CVEs, compared

Recommended action plan

Sources and references

[1]  PHP Security Advisory — GHSA-w8hw-w9fx-j79w (CVE-2026-109618) — https://github.com/php/php-src/security/advisories/GHSA-w8hw-w9fx-j79w

[2]  PHP Security Advisory — GHSA-6wmf-4rv5-p3rp (CVE-2026-109619) — https://github.com/php/php-src/security/advisories/GHSA-6wmf-4rv5-p3rp

[3]  PHP official notice — Session upload progress (CVE-2026-115560), 23 Oct — https://www.php.net/archive/2026.php#2026-10-23-1

[4]  Amazon Threat Intelligence — MadPot observations, 17–21 Oct 2026 — https://aws.amazon.com/blogs/security/amazon-threat-intelligence-identifies-php2shell-exploitation-prior-to-public-disclosure-in-madpot/

[5]  Cloudflare — PHP2Shell: WAF mitigations and their limits — https://blog.cloudflare.com/php-vulnerabilities-waf-protection/

[6]  CISA — Critical Vulnerabilities in PHP Require Immediate Patching — https://content.govdelivery.com/accounts/USDHSCISA/bulletins/42ff5ac

[7]  VulnCheck — exploit research update, 23 Oct 2026 — https://www.vulncheck.com/blog/php2shell-vulnerabilities

[8]  Wiz Research — PHP2Shell technical disclosure (RCE on CMS containers) — https://www.wiz.io/blog/php2shell-php-rce

[9]  Censys — PHP2Shell services (dynamic, indicative data) — https://php2shell.censys.com/

[10]       Red Hat — RHSB-2026-013 (packages/distributions) — https://access.redhat.com/security/vulnerabilities/RHSB-2026-013

[11]       AWS Security Blog — WAF mitigating controls, 21 Oct 2026 — https://aws.amazon.com/blogs/security/using-aws-waf-to-apply-mitigations-for-php2shell-rce-vulnerabilities-cve-2026-109618-and-cve-2026-109619/

[12]       Recorded Future News — exploitation attempts and corrections (incl. the Sophos revision) — https://therecord.media/php-php2shell-exploitation-attempts-pocs

[13]       Unit 42 / Palo Alto Networks — PHP2Shell Threat Brief (updated, retraction of the association) — https://unit42.paloaltonetworks.com/cve-2026-109618-cve-2026-109619/

[14]       SecurityWeek — PHP2Shell Exploitation Moves From Probes to Working Shells (35 shells in a honeypot) — https://www.securityweek.com/php2shell-exploitation-moves-from-probes-to-working-shells/

[15]       securityonline.info — PHP2Shell added to CISA KEV; probing campaign attributed to Lazarus (CYFIRMA) — https://securityonline.info/php2shell-cisa-kev-confirmed-rce-dprk/

[16]       The Hacker News — Wordfence IOC lists and the Potassium botnet (secondary source) — https://thehackernews.com/2026/10/php2shell-exploit-attempts-hit-millions.html

[17]       SOCRadar — exploitation report / observed infrastructure — https://socradar.io/blog/php2shell-cve-2026-109618-cve-2026-109619/

[18]       W3Techs — Usage statistics and market share of PHP (statistic dated 21 Oct 2026) — https://w3techs.com/technologies/details/pl-php

BleepingComputer — PHP2Shell security flaws now successfully exploited in the wild (honeypot RCE, 26 Oct) — https://www.bleepingcomputer.com/news/security/php2shell-security-flaws-now-sucessfully-exploited-in-the-wild/

Cloud image

30 Days of Enterprise-Grade Cyber Defense

Step into the future of cybersecurity with full access to a unified, intelligent platform — free for 30 days. Empower your security team with:

  • Advanced SIEM for real-time visibility, smart alerting, and deep forensics across cloud, on-prem, and hybrid environments

  • Continuous Vulnerability Management to identify, prioritize, and remediate risk across all assets

  • Live Cyber Threat Intelligence integrated directly into your workflows, with global insights and attacker profiling

  • AI-Powered Threat Detection that learns from your environment, explains alerts in plain language, and suggests next steps

  • Built-in Compliance Readiness for NIS2, GDPR, ISO 27001, and more, with automated reporting and audit tools

Whether you're managing a lean SOC or a full-scale enterprise security team, this platform gives you the tools to detect faster, respond smarter, and stay ahead of evolving threats — all without the complexity.

Experience enterprise-grade protection, streamlined workflows, and total control.

Your 30-day head start begins now.

Unlock Your 30 Days Free Trial