PHP2Shell
Recorded: Oct. 21, 2026, 4:01 p.m.
| Original | Summarized |
PHP2Shell — AI uncovers critical vulnerabilities in the backbone of the webPHP2ShellRead on Wiz blogRead on Calif blogRead on OpenAI blogRead on PHP blogBlog postsRead on Wiz blogRead on Calif blogRead on OpenAI blogRead on PHP blog××PHP2ShellAI uncovers critical vulnerabilities in the backbone of the webPHP2Shell is a family of critical vulnerabilities recently fixed in core PHP, with severity reaching CVSS 9.2, that can allow unauthenticated attackers to execute code or expose sensitive process memory. PHP powers approximately 70% of websites, including platforms such as WordPress, Drupal and Wikipedia's MediaWiki.Research and responsible disclosure: Wiz Research — Sagi Tzadik, Shir Tamari, Nir Ohfeld and Tomer Schwartz; OpenAI Codex Security — Amy Burnett; Calif — Ryan A.Review upgrade guidanceHelp me respondWhat is PHP2Shell?PHP2Shell is a family of memory-safety vulnerabilities in core PHP. It comprises two related vulnerability classes, tracked as two CVEs: corruption caused by out-of-memory handling, and stale global state that survives across requests.The vulnerable code is in PHP itself. Websites can be affected even when their application code is secure, including a simple "Hello World" application running on an affected PHP version.Sites running the latest patched PHP releases are protected. The PHP team responded to these reports with exceptional speed and professionalism, working closely with researchers to deliver comprehensive fixes.WordPress, Drupal and Joomla were representative targets used to demonstrate unauthenticated remote code execution. Exploitation does not require one of those applications.~7070% of websites use PHPPHP powers approximately 70% of websitesPHP is the programming language behind WordPress, Drupal and MediaWiki, the software that runs Wikipedia. Vulnerabilities in its core engine can affect websites across this ecosystem.What attackers can doExecute code on affected servers without authentication, potentially taking control of the server, accessing sensitive data, moving laterally, or defacing its websites.Read sensitive PHP process memory, including passwords, authentication tokens, API keys and certificates belonging to other requests or the server itself.Steal sensitive data through memory disclosure without first achieving remote code execution. This can make the activity harder to detect with tools focused on malicious code execution.We demonstrated remote code execution against WordPress, Drupal and Joomla using their latest container images at the time of testing. We also demonstrated application-agnostic memory disclosure.Common PHP softwareWordPressMoodleNextcloudLaravelSymfonyDrupalJoomlaMediaWikiPHP2Shell in actionWatch PHP2Shell automatically identify each application and demonstrate pre-authentication command execution in controlled test environments.Download the WordPress demonstration video.WordPressPre-authentication RCE demonstrationDownload the Drupal demonstration video.DrupalPre-authentication RCE demonstrationDownload the Joomla demonstration video.JoomlaPre-authentication RCE demonstrationThe vulnerabilitiesThe research identified two related vulnerability classes in core PHP: out-of-memory corruption and stale global state across requests. They are tracked as CVE-2026-109618 and CVE-2026-109619, with severity of CVSS 9.2.CVEVulnerabilityWhat an attacker can achieveWhat we demonstratedCVE-2026-109618CVE-2026-109618Out-of-memory (OOM) corruptionWhat an attacker can achieveExecute code without authentication as the PHP web workerWhat we demonstratedPre-authentication RCE on WordPress, Drupal and JoomlaCVE-2026-109619CVE-2026-109619Stale global state across requestsWhat an attacker can achieveTrigger a use-after-free to disclose worker memory or execute codeWhat we demonstratedPre-authentication RCE on WordPress and Drupal; application-agnostic remote memory disclosureThese vulnerability classes include multiple attack paths with different exploitation requirements and impacts. PHP-FPM RCE was confirmed through application-level code paths. The PHP team's fixes address the underlying failure patterns rather than only the demonstrated paths.Upgrade PHPInstall a fixed PHP release on every runtime, then restart Apache, PHP-FPM and any long-running PHP workers. This is the only complete fix. Updating an application does not update the PHP runtime beneath it.Official PHP releases are available from php.net. Downstream distributions will make corresponding package updates available through their normal update channels.Vulnerable and first fixed PHP releases by branchPHP branchVulnerable releasesFirst fixed release8.2< 8.2.358.2.358.3< 8.3.368.3.368.4< 8.4.278.4.278.5< 8.5.128.5.12If you cannot upgrade immediatelyUpgrading PHP is the only complete remediation. The measures below may reduce exposure to specific exploitation paths while you prepare to upgrade, but they do not address every variant.Some measures can affect application functionality, performance or availability. Test configuration changes against your application's requirements and apply the PHP security update as soon as possible.Consider disabling PHP's finite memory limitSetting memory_limit = -1 can prevent some attack paths that rely on PHP's memory-limit handling, but it transfers memory-exhaustion handling to the operating system. With this configuration, memory-exhausted workers may be terminated, interrupting requests and affecting stability and availability of the server. If you decide to enable this, use Linux cgroup v2 memory.max, or an equivalent operating-system mechanism, to help contain resource consumption and limit the availability impact to PHP processes. Apply configuration changes administratively and restart the affected workers.Do not use RLIMIT_AS or RLIMIT_DATA as replacement memory limits. The PHP advisory warns that these can trigger the same vulnerable failure paths.This measure does not cover application-specific large-allocation paths or non-memory-related triggers. In threaded deployments, terminating a process can also interrupt requests running on other threads.Reduce attacker-controlled memory pressureLower post_max_size to a value compatible with your application's upload requirements. This also constrains file uploads, so test legitimate upload flows.Lower max_input_nesting_level where the application permits it. Complex forms may require a higher limit.Set session.upload_progress.enabled = 0 if the application does not depend on upload-progress tracking.These settings limit particular sources of memory pressure. Other attacker-controlled paths to memory exhaustion remain.Disable PHP error displaySet display_errors = 0 in production and restart the affected workers to prevent PHP error output from being exposed to remote users. This reduces an additional information-disclosure path but does not remediate the underlying vulnerabilities.Disable fatal-error backtraces where applicableSet fatal_error_backtraces = 0 where supported and restart the affected workers. This addresses the demonstrated fatal-backtrace mechanism, but other mechanisms can still trigger the vulnerability family.Reduce worker reuseLower PHP-FPM pm.max_requests to recycle workers more frequently. This can reduce persistence of corrupted state across requests, but it has a performance cost and does not address mechanisms that do not rely on multiple requests.Constrain the impact of exploitationUse SELinux or AppArmor policies, where compatible with the application, to restrict worker capabilities and execution of other programs. These controls can constrain impact but should not be treated as preventing all exploitation or memory disclosure.Hardening after upgradingThe PHP advisory describes a new hard memory limit in the fix. Reaching that limit terminates the process and prevents shutdown handlers from running. Review the operational effect on your application as part of the upgrade.After patching:Review memory_limit together with request-size limits and expected application memory use. Revisit any temporary memory_limit = -1 setting used before the upgrade and follow the final PHP recommendations.Keep post_max_size appropriately below the configured memory budget while supporting legitimate uploads.Limit max_input_nesting_level to the depth your application requires, and test complex forms.Consider expose_php = 0 to reduce PHP version disclosure. This is optional hardening and does not remediate PHP2Shell.These steps support application resilience after the security update. They do not replace patching.Technical detailsFor technical analysis and coordinated disclosure details, read the official blog posts from the research and response teams.Wiz ResearchRead official postOpenAIRead official postCalifRead official postPHP FoundationRead official postAkamaiRead official postImpervaRead official postCloudflareRead official postCorelightRead official postCrowdStrikeRead official postUnit 42Read official postCisco TalosRead official postQuestions and answersAm I affected?The research identified affected releases dating back to PHP 5.4, with nearly every PHP version affected by at least one issue before the fix. Exposure depends on the version, configuration and individual vulnerability. Check every PHP runtime against the official affected-version guidance, including runtimes serving custom applications. See Upgrade PHP for remediation.Is this limited to WordPress, Drupal or Joomla?No. These applications were representative targets used to demonstrate remote code execution. The vulnerable code is in PHP itself and can affect other applications, including a simple "Hello World" application on an affected PHP runtime.Does an attacker need an account?The demonstrated remote code execution and memory-disclosure attacks did not require authentication or an application account. The requirements for individual variants differ.What information can be leaked?PHP process memory may contain passwords, authentication tokens, API keys and certificates belonging to other requests or the server itself. Sensitive data can be disclosed without first achieving remote code execution.What is the fix?Apply the PHP security update to every affected runtime and restart the relevant services and workers. The fix addresses the underlying failure pattern and its variants. Application updates alone and temporary configuration changes do not replace the PHP update.Can a WAF, CDN or hosting-provider rule protect me?Industry partners prepared guidance, detections and temporary mitigations for customers who cannot update immediately. Coverage depends on the provider and the exploitation path. Follow your provider's PHP2Shell guidance, but do not treat a protective rule as a substitute for updating PHP.Can I tell whether someone exploited it?A single detection rule is unlikely to cover every exploitation path. Investigation signals include unexpectedly large or malformed PHPSESSID response cookies, unusual multipart requests followed by memory-limit errors or repeated HTTP 500 responses, and unexplained PHP worker crashes or restarts.These signals can help guide an investigation, but they do not establish exploitation on their own. Their absence does not establish that a system is unaffected. Some attacks can disclose sensitive memory without executing malicious code on the server, and application logs may contain little context because the vulnerable paths run below the application layer.Apply the PHP security update regardless of whether suspicious activity has been observed.Why is it called PHP2Shell?php2shell is the name we gave the combined exploit script used to demonstrate unauthenticated remote code execution on WordPress, Drupal and Joomla. PHP2Shell also names the broader research into these core PHP vulnerabilities.How was AI used in the research?Wiz Research used Wiz Atlas, Gemini 4 Argon and GPT-5.6-Sol during discovery, exploit development and patch validation. Frontier models helped work through complex exploit chains and adapt them across different deployments. Gemini 4 made a particularly significant contribution to exploit development and patch validation. See The AI inflection point.How Wiz can helpWiz customers can refer to the Wiz Threat Intel Center advisory for PHP2Shell for agentless and runtime vulnerability detection, exploitation detection through Wiz Defend and Sensor, automatic response policies, remediation guidance and threat hunting guidance.Coordination and acknowledgementsResearchers from Wiz Research, OpenAI Codex Security and Calif worked with the PHP security team and the Gemini team at Google on discovery, coordination and patch verification.Google Cloud, Cloudflare, AWS, Microsoft, Automattic, Fastly, Akamai, Imperva, Vercel and other industry partners helped prepare customer guidance, detections and temporary mitigations for organizations that could not update immediately.Research and industry collaborators:WizPHPGemini team at GoogleOpenAICalifGoogle CloudAWSMicrosoftAutomatticFastlyAkamaiImpervaCloudflareVercelCorelightCrowdStrikeUnit 42Cisco TalosGet ahead of PHP2ShellNeed help identifying affected PHP environments or planning your next steps? Connect with Wiz for guidance on exposure and remediation.Contact Wiz© 2026 Wiz, Inc.Privacy PolicyTerms of UseCookie Settings |
PHP2Shell is a family of critical memory-safety vulnerabilities in core PHP, assigned a severity of CVSS 9.2 and tracked as CVE-2026-109618 (out-of-memory corruption) and CVE-2026-109619 (stale global state across requests). These flaws, located in PHP's core engine, can enable unauthenticated attackers to execute code or expose sensitive process memory, thereby compromising websites that rely on PHP, which powers approximately 70% of the web ecosystem. The vulnerabilities affect any application running on an impacted PHP version, even when the application code is secure, and were demonstrated against representative targets including WordPress, Drupal, and Joomla, as well as a simple "Hello World" application. The research and responsible disclosure were led by Wiz Research, with Sagi Tzadik, Shir Tamari, Nir Ohfeld, and Tomer Schwartz; contributions came from OpenAI Codex Security (Amy Burnett) and Calif (Ryan A). The PHP security team responded with exceptional speed and professionalism, collaborating closely with the research teams to deliver comprehensive fixes. Technical analysis identified two related vulnerability classes with multiple exploitation paths. CVE-2026-109618 involves OOM corruption leading to unauthenticated PHP-FPM RCE through application-level code paths, while CVE-2026-109619 involves stale global state triggering a use-after-free that can disclose worker memory or execute code. PHP-FPM RCE was confirmed via application-level triggers, and the fixes address the underlying failure patterns rather than only demonstrated paths. Affected PHP releases span from PHP 5.4 onward, with specific vulnerable and first fixed releases documented per branch, such as PHP 8.2 before 8.2.35, 8.3 before 8.3.36, 8.4 before 8.4.27, and 8.5 before 8.5.12. The only complete remediation is upgrading to a fixed PHP release on every runtime and restarting Apache, PHP-FPM, and relevant workers; application updates alone do not update the PHP runtime. In the interim, several measures may reduce exposure to specific exploitation paths but are not complete fixes and can impact functionality, performance, or availability. These include setting memory_limit = -1 with caution, adjusting post_max_size, max_input_nesting_level, and session.upload_progress.enabled, disabling display_errors and fatal_error_backtraces, lowering pm.max_requests, and applying hardening like SELinux or AppArmor. After patching, operational hardening must be reviewed, including revisiting memory limits, ensuring post_max_size remains appropriately low, limiting max_input_nesting_level, and optionally setting expose_php = 0. These steps support application resilience but do not replace patching. Attackers can achieve unauthenticated remote code execution, potentially taking control of the server, accessing sensitive data, or defacing websites. Additionally, PHP process memory may be disclosed without first executing malicious code, exposing passwords, authentication tokens, API keys, and certificates from other requests or the server itself, which can complicate detection. Detection signals include large or malformed PHPSESSID cookies, unusual multipart requests followed by memory errors or repeated HTTP 500s, and unexplained PHP worker crashes or restarts. However, a single rule is unlikely to cover all paths, and these signals are not definitive; their absence does not confirm safety, and some attacks can disclose memory without code execution. PHP2Shell is the name given to the combined exploit script used to demonstrate unauthenticated RCE on WordPress, Drupal, and Joomla, and also denotes the broader research. The research utilized AI tools including Wiz Atlas, Gemini 4 Argon, and GPT-5.6-Sol for discovery, exploit development, and patch validation, with frontier models assisting in complex exploit chains and cross-deployment adaptation. Collaboration involved Wiz Research, OpenAI Codex Security, Calif, the PHP security team, and the Gemini team at Google, alongside industry partners such as Google Cloud, Cloudflare, AWS, Microsoft, Automattic, Fastly, Akamai, Imperva, Vercel, Corelight, CrowdStrike, Unit 42, and Cisco Talos, who provided customer guidance, detections, and temporary mitigations. Wiz offers its customers the PHP2Shell Threat Intel Center advisory, agentless and runtime vulnerability detection, exploitation detection through Wiz Defend and Sensor, automatic response policies, remediation guidance, and threat hunting guidance to help identify exposed environments and plan remediation. |