NEW DELHI, October 23, 2026: Two critical vulnerabilities in PHP, collectively referred to as PHP2Shell, have prompted security warnings for website owners, hosting providers and developers. Tracked as CVE-2026-109618 and CVE-2026-109619, the flaws involve memory corruption and unsafe internal state during PHP request processing. Successful exploitation could allow an unauthenticated attacker to execute code remotely or access sensitive information from PHP process memory.
Both vulnerabilities have a reported CVSS v4.0 severity score of 9.2 out of 10. On October 21, the PHP project released security updates for PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35. Administrators should identify affected installations and apply the appropriate vendor-supported security updates immediately. The PHP project identifies updating as the only complete solution. Read the official PHP security release information.
What Is the PHP2Shell Vulnerability?
PHP2Shell refers to two security vulnerabilities in PHP's core runtime. PHP is a server-side programming language used by websites and applications, including systems built with WordPress, Drupal and Joomla. Because the reported flaws affect PHP itself rather than a particular website plugin, vulnerable PHP installations may be exposed even when the application's own code does not contain the underlying defect.
The PHP project identifies web-serving installations using PHP-FPM, Apache with mod_php, php-cgi, FrankenPHP and LiteSpeed as potentially affected. Apache mod_php is identified as a particularly high-risk configuration because a request can trigger the vulnerable path before application code runs. Actual exposure depends on the runtime, configuration and deployment.
What Exactly Are CVE-2026-109618 and CVE-2026-109619?
CVE-2026-109618: Out-of-Memory Handling and Memory Corruption
This vulnerability concerns how PHP handles certain out-of-memory errors during request processing. PHP can interrupt normal execution when an allocation fails. In a vulnerable execution path, some internal request data may not be fully initialised before cleanup continues. Subsequent cleanup operations can then use invalid or uninitialised memory, potentially resulting in memory corruption and remote code execution.
In simple terms, PHP may encounter a memory-allocation failure while processing a request and then mishandle its internal state during recovery or cleanup. Under suitable conditions, an attacker may be able to exploit that unsafe state. The weakness is in PHP's internal error-handling path, not simply in a website's PHP memory-limit setting.
CVE-2026-109619: Stale Internal State Referencing Freed Memory
This vulnerability concerns internal global state that temporarily points to memory associated with a request. Under certain conditions, that state may not be reset correctly after the request's memory is released, or it may be repopulated incorrectly. A later request handled by the same worker may then encounter a reference to memory that is no longer valid.
Using such a stale reference can cause memory corruption and may allow remote code execution. The precise conditions depend on the affected PHP runtime and request-processing path.
The vulnerabilities are related in their potential impact but are not identical. CVE-2026-109618 concerns unsafe handling of out-of-memory failures, while CVE-2026-109619 concerns stale internal state referencing freed request memory. Consult the official advisories for their technical descriptions.
How Could an Attack Affect a Website?
At a high level, an attacker may send a specially crafted HTTP request to an exposed, vulnerable PHP service. Under the right conditions, PHP's internal request-processing or error-handling logic enters a vulnerable state. If exploitation succeeds, the attacker may gain the ability to execute code with the privileges of the affected service or access sensitive data held in its process memory.
Potential consequences include unauthorised changes to website files, theft of information accessible to the PHP process, misuse of application credentials, installation of malicious code and further compromise of the hosting environment. These are possible impacts, not proof that every vulnerable website has been attacked or compromised.
Because exploitation may occur before application code executes in some configurations, relying only on plugin updates, application-level input validation or login protection is insufficient. The PHP runtime itself must be secured.
Which PHP Versions Are Affected?
The PHP security release information identifies the following fixed releases:
- PHP 8.5: Update to 8.5.12 or a later release containing the fixes.
- PHP 8.4: Update to 8.4.27 or a later release containing the fixes.
- PHP 8.3: Update to 8.3.36 or a later release containing the fixes.
- PHP 8.2: Update to 8.2.35 or a later release containing the fixes.
- PHP 8.1 and older: These branches are no longer supported by the main PHP project. Check whether the operating-system vendor or hosting provider supplies a backported security fix, or migrate to a supported PHP release.
Do not assume that a version number displayed in a control panel tells the whole story. Some Linux distributions and long-term-support vendors backport security patches without adopting the corresponding upstream version number. Confirm the patch status with the relevant vendor.
Official references: PHP release archive, CVE-2026-109618 advisory and CVE-2026-109619 advisory.
How to Secure a Website Against PHP2Shell
1. Identify the PHP Version Actually Serving the Website
Check the PHP version assigned to each website in your hosting control panel, or ask your hosting provider to confirm the runtime and patch status. Websites on the same hosting account may use different PHP versions. Also check production and staging environments, containers, background workers and other internet-facing services that use PHP.
Where shell access is available, the command php -v reports the command-line PHP version. However, command-line PHP may differ from the version used by PHP-FPM, Apache or another web server. Confirm the web-serving runtime separately. Avoid publishing a publicly accessible diagnostic page that reveals server configuration.
2. Install the Applicable Security Update
Upgrade to a fixed, supported PHP release or install the equivalent security update supplied by the operating-system vendor. On managed hosting, contact the provider if the patched release is not available in the control panel. Confirm which PHP runtime serves the website and whether the provider has completed the update.
After updating, restart or reload the relevant PHP workers and services as required by your deployment. Verify the running version and patch status again. Updating WordPress, a theme or a plugin alone does not patch a vulnerable PHP runtime.
3. Check Every Environment and Bundled PHP Runtime
Inventory all PHP installations, including separate PHP-FPM pools, Apache modules, containers, staging systems and applications that bundle PHP inside appliances or other products. A server may have multiple runtimes, and patching one does not automatically update the others. Apply the affected product's own vendor update when PHP is bundled into a third-party product.
4. Apply Temporary Mitigations Only If Patching Is Delayed
The PHP project publishes limited temporary mitigations for specific attack paths. These measures reduce exposure but do not make a vulnerable installation fully safe.
- For CVE-2026-109618: PHP recommends setting
memory_limit=-1in an administrator-controlled configuration, such as an applicable PHP-FPM pool or Apache configuration, to remove the configured PHP memory-limit failure path. Underlying allocation failures may still reach the vulnerable path. Disabling the PHP memory limit can also increase resource-exhaustion risk, so use appropriate container, cgroup or other resource controls and follow the official advisory. - Request-size limits: PHP recommends a low
post_max_sizewhile patching is delayed: 8 MB for applications that do not need file uploads, or 32 MB where uploads are necessary. Keepupload_max_filesizebelowpost_max_size, and enforce suitable request-size and multipart limits at the web server or proxy where possible. These are temporary mitigation values, not universal permanent settings. - For CVE-2026-109619: PHP recommends disabling
session.upload_progress.enabledin configuration that takes effect before request parsing, then restarting all relevant workers. On PHP 8.5, disablingfatal_error_backtracesis also listed as a mitigation for a confirmed attack path. These measures do not block every possible variant.
Do not assume that changing settings through application-level ini_set() calls or a per-directory .user.ini file will apply early enough. Follow the official PHP advisory for the correct configuration scope and restart requirements. If the affected service cannot be patched promptly, assess the risk and consider taking it offline until a fix is available.
Important: Setting memory_limit=-1 is not the permanent PHP2Shell fix and does not address both vulnerabilities. The official PHP guidance identifies updating as the only complete solution. Read the PHP project's release and mitigation information.
How to Check Whether a Website May Have Been Compromised
Applying a patch prevents exploitation of the fixed vulnerabilities but does not remove malicious changes that may already have occurred. If the website was exposed while running a vulnerable PHP version, review available evidence rather than assuming either that it was attacked or that it is safe.
- Review logs: Examine web server, PHP, hosting control-panel, authentication and security-monitoring logs for unusual requests, unexpected PHP errors, suspicious outbound connections or activity outside normal operating patterns.
- Inspect file changes: Compare website files with a trusted backup or clean deployment. Investigate unexpected PHP files, modified application files, unfamiliar scripts and changes to scheduled tasks.
- Check accounts and permissions: Review administrator accounts, hosting access, SSH keys, API credentials, scheduled jobs and other privileged access for unauthorised changes.
- Look for persistence: Review cron jobs, service configurations, startup tasks and other mechanisms that could allow an intruder to retain access.
- Preserve evidence: Keep relevant logs and snapshots before making destructive changes. If compromise is suspected, isolate the affected system where appropriate and follow an incident-response process.
- Rotate exposed secrets: If investigation indicates that credentials or tokens may have been accessed, rotate them from a clean environment and review associated accounts and services.
No single log entry or error message conclusively proves exploitation. Likewise, an absence of obvious suspicious activity does not prove that a system was never compromised. Seek qualified incident-response assistance if there are signs of unauthorised code execution or data access.
Why PHP2Shell Matters for WordPress and News Websites
PHP supports a broad range of websites, including online publications, business portals, online stores and content-management systems. A vulnerability in the PHP runtime can affect different applications that share the same underlying technology. A website does not have to be running a particular vulnerable plugin for its PHP runtime to be at risk.
For news portals and other organisations that depend on uninterrupted publishing, an incident could threaten website integrity, reader trust, data confidentiality and service availability. Maintaining backups, restricting administrative access and monitoring changes are important security practices, but they do not replace patching PHP.
Official Security Resources
- PHP official release and security announcements
- PHP advisory for CVE-2026-109618
- PHP advisory for CVE-2026-109619
- NCSC-NL PHP2Shell operational information
- NHS England cybersecurity alert
PHP2Shell highlights why core server software must be patched promptly. Website owners should confirm the actual runtime version, install the relevant security fix, restart affected workers, review potentially exposed systems and apply temporary mitigations only when necessary. A patched runtime and a documented verification process are the strongest starting points for protecting a PHP-based website.
Comments (0)
Leave a Comment
No comments yet. Be the first to comment!