PHP2Shell: download the patch and install it (CVE-2026-109618, CVE-2026-109619)

The PHP2Shell patch is PHP 8.5.12, 8.4.27, 8.3.36 or 8.2.35, released by the PHP project on 21 October 2026 to fix CVE-2026-109618 and CVE-2026-109619, two flaws that allow unauthenticated remote code execution.

Download the fixed build for your branch from php.net, or take your Linux distribution's patched packages, then restart every PHP worker. The PHP guide hub collects every related update, download and mitigation post in one place.

PHP2Shell: download the patch and install it (CVE-2026-109618, CVE-2026-109619)
The php.net advisory lists both flaws and the fixed releases: PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35. (Image: php.net)

What is PHP2Shell?

PHP2Shell is the name used for two PHP vulnerabilities disclosed together. Wikipedia reports that the flaws were publicly announced on 20 October 2026 and patched the next day, and lists Wiz, OpenAI and Calif as discoverers.

PHP.net rates both flaws CVSS v4.0 9.2 and describes them this way.

CVE Advisory What goes wrong
CVE-2026-109618 GHSA-w8hw-w9fx-j79w, RCE via OOM corruption Out-of-memory handling can interrupt PHP while request data is only partly initialized; cleanup then treats the invalid data as valid
CVE-2026-109619 GHSA-6wmf-4rv5-p3rp, RCE via stale global state Request-owned state can survive after its memory is freed, and a later request on the same worker may use it before initialization resets it

Wikipedia also reports that Cloudflare saw signs of early exploitation before the patch and deployed temporary web application firewall rules, and that many organizations took websites offline while patches were pending. The PHP security update news covers the release itself.

Is my server affected by PHP2Shell?

PHP.net says all PHP installations serving web requests are at risk, including PHP-FPM, Apache with mod_php, php-cgi, FrankenPHP and LiteSpeed. It considers the risk highest for mod_php, where a demonstrated exploit runs before any application code.

  1. Run php -v on the server and note the version on the first line.
  2. Compare it with the fixed release for its branch: 8.5.12, 8.4.27, 8.3.36 or 8.2.35.
  3. Treat any lower version on those branches as vulnerable.
  4. Treat PHP 8.1, 8.0 and 7.4 as vulnerable unless your vendor confirms a backported fix.
  5. On distribution packages, compare the package version with your vendor's security notice instead, because vendors use their own version numbers.

The web server can run a different PHP build from the command line, so also check your PHP version on a temporary phpinfo() page.

PHP2Shell patch download: fixed PHP versions

PHP.net publishes source downloads and Windows binaries for every fixed branch on its downloads page. Linux distributions and LTS vendors received the patches in advance.

Branch Fixed release Where to get it Security support ends
PHP 8.5 8.5.12 php.net downloads page or your vendor 31 Dec 2029
PHP 8.4 8.4.27 php.net downloads page or your vendor 31 Dec 2028
PHP 8.3 8.3.36 php.net downloads page or your vendor 31 Dec 2027
PHP 8.2 8.2.35 php.net downloads page or your vendor 31 Dec 2026
PHP 8.1, 8.0, 7.4 No official release Vendor backport or source patch Already end of life

Download only from https://www.php.net/downloads.php or https://windows.php.net/download/. Per-version notes are in the PHP 8.5.12 download for Windows and PHP 8.4.27 download posts.

PHP2Shell patch versions: php.net supported versions table for branches 8.2 to 8.5
Only branches still listed as supported get the official PHP2Shell fix from the PHP project. (Image: php.net)

How to install the PHP2Shell patch on Windows

PHP.net recommends x64 builds. Use the Thread Safe (TS) build when Apache loads PHP as a module, and the Non-Thread Safe (NTS) build for IIS with FastCGI or the CLI. The builds need the Visual C++ Redistributable for Visual Studio 2015-2022.

  1. Open https://windows.php.net/download/ and find the fixed release for your branch.
  2. Download the Zip that matches your current architecture and thread-safety type.
  3. Stop the web server or service that runs PHP.
  4. Rename the current PHP folder, for example C:\php to C:\php-old, to keep a backup.
  5. Extract the new ZIP to the original folder path.
  6. Copy php.ini and any third-party extension DLLs from the backup folder into the new one.
  7. Start the web server again and run php -v to confirm the new version.

XAMPP keeps its own PHP folder, so a system update does not patch it; the XAMPP PHP update steps cover bundled stacks.

PHP2Shell patch download for Windows on windows.php.net with Thread Safe builds
Pick the same Thread Safe or Non Thread Safe build and architecture you already run. (Image: windows.php.net)

How to install the PHP2Shell patch on Linux

Use your distribution's packages, because vendors received the fixes before release. PHP.net urges users of rpms.remirepo.net to switch to distribution packages or build from source, since that repo will not have updates on release day.

Ubuntu or Debian

PHP comes from apt packages

  1. Run sudo apt update to refresh the package lists.
  2. Run sudo apt upgrade to install the patched PHP packages.
  3. Compare the installed version with your vendor's security notice for both CVEs.

RHEL, AlmaLinux or Fedora

PHP comes from dnf packages

  1. Run sudo dnf check-update to list available updates.
  2. Run sudo dnf upgrade to install them.
  3. Compare the installed package with your vendor's security advisory.

Any distribution

Running workers still hold the old code

  1. Restart PHP-FPM with sudo systemctl restart <service-name>, using your PHP-FPM service name.
  2. Restart Apache or Nginx the same way.

Ubuntu and Debian specifics are in the Ubuntu and Debian PHP update post, and service names are in the guide to restart PHP-FPM.

PHP2Shell patch install on Linux using the dnf command from php.net
On Linux, install the patched packages from your distribution, as the php.net advisory recommends. (Image: php.net)

PHP2Shell patch for PHP 7.4, 8.0 and 8.1

PHP 8.1 and older no longer receive updates from the PHP project, so there are no official PHP2Shell binaries for them. Given the severity, the PHP security team provided minimal source backports for 7.4, 8.0 and 8.1 for people who build from source or have no LTS vendor.

Your situation What to do
Distribution or LTS vendor package Ask the vendor for its backported fix and install it
You build PHP from source Apply the PHP project's minimal source backport for your branch
Neither option is available Upgrade to PHP 8.2 or newer

The PHP 8.1, 8.0 and 7.4 options post goes through each route.

PHP2Shell on PHP 8.1, 8.0 and 7.4: php.net end-of-life branches table
PHP 8.1 and older are past end of life, so fixes come only from source backports or LTS vendors. (Image: php.net)

PHP2Shell mitigations if you can't patch yet

PHP.net says only the update is a complete solution. These measures reduce exposure to specific attack paths but do not make an installation safe.

Flaw Partial mitigation from PHP.net
CVE-2026-109618 Set memory_limit=-1 in a way applications cannot override, such as php_admin_value in the FPM pool or Apache config
CVE-2026-109618 Set post_max_size = 8M without file uploads, or 32M with them, and keep upload_max_filesize below it
CVE-2026-109618 Use a container or cgroup limit as an availability boundary; do not substitute RLIMIT_AS or RLIMIT_DATA
CVE-2026-109619 Set session.upload_progress.enabled=0 in php.ini, an FPM pool or server config, then restart every worker
CVE-2026-109619 On PHP 8.5, set fatal_error_backtraces=0 and restart every worker
CVE-2026-109619 Remove invalid or deprecated per-request settings that emit diagnostics, and fix attacker-reachable fatal errors and timeouts

Do not rely on ini_set() or FPM .user.ini for the session setting, and hiding diagnostics with display_errors does not help. Each of these partial PHP2Shell mitigations has exact config placement and caveats.

PHP2Shell mitigation: session.upload_progress.enabled in the PHP session configuration manual
Mitigations reduce exposure to specific attack paths but do not replace installing the patched release. (Image: php.net)

How to confirm the PHP2Shell patch is installed

  1. Run php -v and confirm 8.5.12, 8.4.27, 8.3.36 or 8.2.35, or your vendor's fixed package version.
  2. Create info.php in the web root containing <?php phpinfo(); and open it in a browser.
  3. Confirm the same version appears at the top of the page, so the web server uses the patched build.
  4. Check that Loaded Configuration File points at the php.ini you expect.
  5. Delete info.php, because it exposes server details.

If the page still shows the old version, a PHP-FPM pool or Apache process was not restarted.

PHP2Shell FAQ

What is the PHP2Shell CVE?

PHP2Shell covers two CVEs: CVE-2026-109618, remote code execution via out-of-memory corruption, and CVE-2026-109619, remote code execution via stale global state.

Where can I download the PHP2Shell patch?

Download PHP 8.5.12, 8.4.27, 8.3.36 or 8.2.35 from php.net/downloads.php, with Windows builds at windows.php.net/download. On Linux, install your distribution's updated packages instead.

How do I fix PHP2Shell?

Update to the fixed release for your branch and restart every PHP worker. PHP.net says there are no complete mitigations and updating is the only safe choice.

Is there a PHP2Shell exploit?

PHP.net says it has a demonstrated exploit against mod_php in which an unauthenticated request triggers the attack before any application code runs. Wikipedia reports Cloudflare saw signs of early exploitation before the patch.

How severe is PHP2Shell?

PHP.net rates both vulnerabilities CVSS v4.0 9.2, which is critical, and urges all PHP users to update immediately.

Does the PHP2Shell patch need a restart?

Yes. PHP-FPM, Apache with mod_php and other long-running workers keep the old code in memory until they restart.

Should you install the PHP2Shell patch today?

Yes. Install 8.5.12, 8.4.27, 8.3.36 or 8.2.35, or your vendor's patched package, and restart every PHP worker now. Both flaws allow unauthenticated remote code execution on any PHP server handling web requests, and PHP.net says no mitigation is complete.

Philip Celasco

Philip is a Texas-based technology writer and IT administrator at Techdows.com with more than 10 years of experience creating practical content for everyday users and professionals. He specializes in web browsers, particularly Chromium-based platforms such as Google Chrome, Microsoft Edge, Brave, and Opera. Through his work as an IT administrator, Philip has hands-on experience managing devices, configuring browser policies, troubleshooting software and network issues, and helping people resolve problems that affect productivity and security. His articles are based on practical testing and real-world technical experience. He covers browser settings, extensions, performance problems, privacy controls, security features, and Windows troubleshooting. Outside work, Philip enjoys the quieter side of life in Texas and stepping away from the screen when he can. He has two kids, two cats and loves to play golf with his mother during the weekends.

Leave a Reply

Your email address will not be published. Required fields are marked *