October 24, 2026 · Varun Sharma
Critical PHP Vulnerability in 2026: Attackers Can Execute Code on Your Server
A critical security flaw in PHP could allow attackers to execute malicious code on vulnerable web servers—even without logging in. If your website runs PHP, WordPress, or an e-commerce platform built on PHP, now is the time to check your server.
PHP powers a huge part of the web. It runs everything from custom applications and APIs to content management systems and online stores.
But on October 21, 2026, the PHP project released emergency security updates addressing two critical vulnerabilities that could allow remote attackers to execute code on affected servers.
The vulnerabilities are tracked as CVE-2026-109618 and CVE-2026-109619, collectively known as PHP2Shell. Both received a critical severity rating of 9.2 out of 10. Security agencies have also reported exploitation attempts targeting vulnerable systems.
Sources: Official PHP security announcement | Singapore Cyber Security Agency advisory
What Is the PHP Vulnerability?
The issue affects PHP's internal request-handling mechanisms. Under certain conditions, an attacker can exploit memory-management flaws to execute code on the server.
There are two main vulnerabilities.
1. CVE-2026-109618: Memory Corruption
This vulnerability involves how PHP handles out-of-memory conditions.
Under specific circumstances, PHP can interrupt request processing while internal data is only partially initialized. Subsequent cleanup operations may then handle invalid memory incorrectly.
An attacker may be able to exploit this behavior to execute code on the affected server.
2. CVE-2026-109619: Use-After-Free
This vulnerability involves internal request data that can remain accessible after its memory has been released.
A later request handled by the same worker may encounter this stale state before PHP properly resets it.
Under the right conditions, this can also lead to remote code execution.
The important point: These are vulnerabilities in the PHP runtime itself, not simply bugs in a particular website's application code.
What Can an Attacker Do?
If an attacker successfully exploits a vulnerable server, the consequences may include:
Executing unauthorized commands or code.
Accessing sensitive application data.
Modifying website files.
Installing malicious scripts or backdoors.
Using the compromised server as a starting point for further attacks.
The actual impact depends on the server configuration, the privileges of the PHP process, and the application's environment.
For example, if a compromised PHP worker has permission to modify website files, an attacker may be able to inject malicious code into those files.
A website might continue working normally while unauthorized code runs in the background.
Which PHP Versions Are Affected?
The initial security advisories cover PHP versions across multiple release branches, including older, unsupported versions.
The fixed releases announced by the PHP project are:
PHP 8.5: Update to 8.5.12 or later.
PHP 8.4: Update to 8.4.27 or later.
PHP 8.3: Update to 8.3.36 or later.
PHP 8.2: Update to 8.2.35 or later.
These are the specific minimum fixed releases for the two vulnerabilities discussed above. Check the official PHP advisory and your operating-system vendor for subsequent updates and applicable security backports.
PHP 8.1 and older versions are no longer covered by normal upstream security releases. Some operating-system vendors provide their own patched packages.
Don't assume your server is safe simply because it runs PHP 8.x. The specific patch level matters.
Source: PHP security advisory
Does This Affect WordPress and E-Commerce Websites?
Potentially, yes.
WordPress, WooCommerce, and many other PHP-based applications depend on the PHP runtime provided by their hosting environment.
Updating WordPress plugins or themes alone does not fix a vulnerability in PHP itself.
You need to check the actual PHP version and security status of the server running the application.
The affected environments may include:
PHP-FPM
Apache with
mod_phpphp-cgiFrankenPHP
LiteSpeed
The PHP security team identified Apache's mod_php configuration as particularly high risk for one demonstrated attack path.
However, other configurations should not be considered safe simply because they use a different PHP handler.
How to Protect Your Server
If you maintain a PHP application, take the following steps.
1. Check Your PHP Version
From a terminal, run:
php -vThis displays the PHP version used by the command-line environment.
However, your website may use a different PHP version through PHP-FPM, Apache, or your hosting control panel.
Verify the version actually serving web requests.
2. Update PHP Immediately
Install a fixed PHP release appropriate for your branch and operating system.
For example, a server running PHP 8.4 should be updated to at least the patched 8.4.27 release for these two vulnerabilities.
Use your hosting provider's supported update process or your operating system's package manager.
After upgrading, restart the relevant PHP-FPM services or web server processes as required, and verify that the running workers are using the patched version.
If you're using managed hosting, contact your provider and ask whether the security patches have been applied to your PHP environment.
3. Check All Applications and Servers
Don't check only your primary website.
Review:
Production servers
Staging environments
Development servers exposed to the internet
Legacy applications
Separate PHP-FPM pools
Containers running PHP
Third-party software that bundles or embeds PHP
An overlooked legacy application can remain an entry point even after your main website has been updated.
4. Use Temporary Mitigations Only When Necessary
If you cannot immediately install the security updates, consult the official PHP advisory for temporary measures.
Depending on the vulnerability, these include specific PHP configuration changes and tighter request-size limits.
Such measures can reduce exposure to known attack paths, but they are not a replacement for installing the fixes.
If you cannot patch or adequately mitigate an internet-facing server, consider isolating it from public access until it can be secured.
5. Check for Signs of Compromise
Patching prevents future exploitation through the fixed vulnerabilities, but it does not remove malicious code that may already have been installed.
Review your server for suspicious activity, including:
Unexpected changes to PHP files.
Unknown scripts in upload directories.
Unfamiliar processes running under the web server account.
Unexpected administrator accounts.
Unusual outbound network connections.
Suspicious web server and authentication logs.
If you find evidence of compromise, follow your incident-response process. Preserve relevant logs, investigate the extent of access, remove unauthorized persistence, rotate potentially exposed credentials, and restore from a known-clean source when necessary.
Simply updating PHP does not guarantee that an already compromised server is clean.
Why Keeping PHP Updated Matters
Security vulnerabilities are discovered and fixed throughout the lifecycle of software.
When a critical flaw becomes public, attackers can use the available technical information to develop attacks against systems that have not yet been patched.
That makes the time between disclosure and patching especially important.
Keeping PHP updated should be part of routine server maintenance, alongside:
Updating operating-system packages.
Maintaining application dependencies.
Restricting file permissions.
Protecting secrets and credentials.
Monitoring server logs.
Maintaining tested backups.
Removing unsupported software.
Security is not a one-time task. It is an ongoing responsibility.
One More Important Update
On October 23, the PHP security guidance was updated to discuss an additional remote-code-execution vulnerability affecting an unusual configuration.
This is another reason to check the latest official advisory rather than relying on an older article or assuming that one update covers every possible attack path.
See the CERT-EU security advisory for the latest guidance available at the time of writing.
Final Thoughts
The latest PHP vulnerabilities are a reminder that even mature, widely used programming languages can contain serious security flaws.
If you run a PHP website, don't wait for visible symptoms before acting. A vulnerable server may not show obvious signs that an attacker is attempting to exploit it.
Check the PHP version serving your website, install the appropriate security updates, and investigate any signs of previous compromise.
Your application can have secure code and still be vulnerable if the runtime underneath it is not patched. Keep PHP updated, verify your server, and treat critical security advisories as urgent maintenance—not optional work.
Comments
Join the discussion and share your thoughts.