PHP2Shell: Two Critical PHP Flaws Put Web Servers at Risk
Two critical vulnerabilities in PHP have put website administrators on alert. Disclosed on October 21, 2026, the flaws could allow an unauthenticated attacker to execute malicious code on a vulnerable server without first logging in.
The vulnerabilities, tracked as CVE-2026-109618 and CVE-2026-109619, have been associated with the name PHP2Shell. They affect PHP itself, the server-side programming language used by many websites and web applications.
The PHP development team has released security updates. Administrators should check their PHP versions and apply the appropriate fixes as soon as possible.
What Is PHP2Shell?
PHP is widely used to build dynamic websites, APIs, content management systems, and web applications. Frameworks such as Laravel also rely on PHP to process requests and run application code.
PHP2Shell refers to two critical vulnerabilities in the PHP runtime. Unlike a typical application bug, these flaws exist in PHP's underlying request-processing and memory-management behavior.
According to the European Union Agency for Cybersecurity and partner agencies, both vulnerabilities could allow remote code execution without authentication.
That means an attacker may not need a valid account or password to trigger a vulnerable code path. However, exploitation does not automatically mean the attacker gains root access or complete control of every affected server. The potential impact depends on the environment and the permissions available to the PHP process.
The Two Vulnerabilities Explained
1. CVE-2026-109618: Memory corruption during error handling
The first vulnerability involves how PHP handles certain out-of-memory conditions.
When PHP processes a request, it allocates memory to hold information about that request. If PHP encounters a memory-limit failure, it must stop processing and clean up the resources it has used.
Under certain conditions, that cleanup process can encounter memory that was not initialized correctly. This can lead to unsafe memory operations, potentially allowing an attacker to influence the program's behavior.
The vulnerability is particularly concerning because specially crafted requests may trigger the affected behavior before the website's normal application code runs.
2. CVE-2026-109619: Stale global state
The second vulnerability involves internal state that PHP maintains while processing requests.
Some internal references can continue pointing to memory after that memory has been released. If PHP later uses those stale references before the relevant state has been correctly initialized, it can perform unsafe operations.
In vulnerable circumstances, this behavior can also lead to remote code execution.
Both issues have been assigned a CVSS v4.0 score of 9.2, indicating critical security risk. The PHP security team has published fixes for both vulnerabilities.
Technical references: PHP security advisories on GitHub and the second advisory.
Which PHP Versions Are Affected?
The PHP security updates released on October 21, 2026, address these vulnerabilities in the following maintained release branches.
| PHP branch | Fixed version |
|---|---|
| PHP 8.5 | 8.5.12 |
| PHP 8.4 | 8.4.27 |
| PHP 8.3 | 8.3.36 |
| PHP 8.2 | 8.2.35 |
Versions earlier than the listed fixes are affected according to the PHP security advisories. PHP 8.1 and older branches are no longer supported by the PHP project, although some operating-system vendors may provide backported security fixes.
If your server uses an older PHP release, do not assume that changing to a different application framework will solve the problem. The underlying PHP runtime must be addressed.
For the latest release information, consult the official PHP website.
Are Laravel, WordPress, and Other PHP Websites at Risk?
Potentially, yes.
The issue is in PHP's runtime rather than exclusively in one website or framework. A vulnerable PHP installation may therefore affect different applications running on it, including Laravel applications and popular content management systems.
The risk is not limited to a particular operating system or one PHP execution method. Security advisories identify multiple configurations, including PHP-FPM, Apache with mod_php, PHP-CGI, FrankenPHP, and LiteSpeed.
A website can have strong passwords, protected administrator pages, and carefully written application code while still relying on a vulnerable PHP runtime.
This is why patching the underlying server software is essential.
How to Protect Your PHP Server
1. Update PHP immediately
Install the appropriate security-fixed release for your environment. Use the official PHP downloads, your operating system's security updates, or your hosting provider's supported update process.
If you use shared hosting, contact your hosting provider and ask whether the PHP runtime serving your website has been patched.
2. Check the PHP version used by your website
Do not rely only on the PHP version installed on your personal computer. Your production website may use a different version.
Check the PHP version configured in your hosting control panel, server environment, or deployment platform. For managed hosting, ask support to confirm the runtime version actually serving web requests.
3. Restart or reload workers when required
Depending on the deployment, PHP-FPM workers or other long-running PHP processes may need to be restarted after an update. Follow the instructions provided by your operating system or hosting provider to ensure the patched runtime is actually running.
4. Review server activity
Because these vulnerabilities can potentially enable remote code execution, administrators should review relevant web server, application, and system logs for suspicious requests or unexpected activity.
Look for unfamiliar processes, modified files, unexpected accounts, or unusual outbound connections. If you suspect a compromise, preserve relevant evidence and investigate before assuming that patching alone has resolved the incident.
5. Do not rely on temporary workarounds
Configuration changes and request limits may reduce exposure to particular attack paths, but they do not fully fix these vulnerabilities. The PHP security team recommends updating to a fixed release as the safe solution.
Final Thoughts
PHP2Shell highlights an important lesson for website owners: keeping an application secure involves more than protecting its login page or writing safe code.
The PHP runtime is part of the application's security boundary. When a critical vulnerability is discovered at that level, every administrator responsible for a PHP-based website should check the affected versions and prioritize the appropriate update.
If you manage a Laravel application, WordPress website, or another PHP-powered service, verify your production PHP version today and confirm that the relevant security fixes have been applied.
Sources and further reading
The conversation (0)
Different perspectives make better conversations. Keep it thoughtful.
Be the first to share a perspective.