DELTAWEB
Web security
Web security11 min read

PHP2Shell: what two critical PHP flaws mean for your website

On 21 October the PHP team fixed two flaws that can let an attacker run code on a server without logging in. We separate fact from hype, show you how to check your site, and explain what to do when a patch alone won't cut it — with sources throughout.

Arif KuruArif KuruLast updated: October 22, 2026

PHP powers more than two thirds of websites whose server-side language is known.[4] On 21 October 2026 the PHP team fixed two vulnerabilities that affect almost all of those installations: CVE-2026-109618 and CVE-2026-109619. Both are rated critical, and neither requires the attacker to have an account or a password.[1]

The pair was quickly nicknamed “PHP2Shell”. Some headlines compare it to Log4Shell; others call it overblown. In this article we separate what is firmly known today from what is still unclear, and set out what you need to do as a site owner.

In short

What we know

  • The flaw is in the PHP engine itself, so the server is exposed even if your WordPress or Laravel code is clean.[1]
  • The attacker needs no user account or password.[1]
  • The four supported branches have fixes; 7.4–8.1 only get source-code patches.[1]
  • The first exploitation attempt was seen on 17 October, four days before disclosure.[4]

Still unclear

  • Whether a universal single-request exploit exists. None has been demonstrated so far.[5]
  • How many sites have actually been compromised. No source gives a number.[5]
  • When the proof-of-concept code in circulation will become reliable.[4]

The practical takeaway: if your site isn't running PHP 8.5.12, 8.4.27, 8.3.36 or 8.2.35 — or a newer release on the same branch — it needs updating today. On shared hosting this is usually in your provider's hands, so ask them for written confirmation.

What happened?

Security firms Calif and Wiz Research found the flaws in August and reported them to the PHP team through coordinated disclosure. The patches were scheduled for 22 October. When the CVE IDs leaked on social media a day earlier, PHP brought the release forward — but exploitation attempts had already started before the patches were out.[4][5]

  1. 1 Aug

    Calif finds the flaws

    Several unauthenticated code-execution paths are identified in the PHP engine.[5]

  2. 11 Aug

    Reported to PHP

    Coordinated disclosure begins. On 24 August, Wiz Research independently reports the same issues.[5]

  3. 17 Oct

    First exploitation attempt

    Amazon records a php2shell attempt on its MadPot honeypot network. How the attacker got the details is unknown.[4]

  4. 20 Oct

    CVE IDs leak

    The identifiers surface on Hacker News and social media. CERT-EU publishes advisory 2026-018.[4]

  5. 21 Oct07:43 UTC

    Attacks before the patch

    Cloudflare sees attack traffic and rolls out WAF rules to every customer, free plan included.[5]

  6. 21 Oct14:00 UTC

    Patches released

    The release planned for 22 October is brought forward a day because of the leak.[4]

  7. 22 Oct

    First assessments

    Sansec reports that mass exploitation is harder than first feared and that most PoCs fail on a default install.[5]

How does the flaw work?

PHP handles each request in a worker process. When a request finishes, the worker cleans up its memory and moves on to the next one. Both flaws exploit the moment that cleanup is skipped: when a request hits a fatal error (most typically exceeding memory_limit), PHP bails out using the C function longjmp().[6] What's left behind — half-built data and state pointing to freed memory — becomes something an attacker can shape.

One PHP worker process handling two consecutive requests
Normally
Request Aresponse sent
Cleanupmemory reset
Request Bstarts clean
PHP2Shell
Request Asent by attacker
Skippedno cleanup
Request Breads stale memory
  1. 1The request is crafted to exceed the memory limit or hit a fatal error. PHP aborts it with longjmp().
  2. 2Normal cleanup never runs. Half-built data and state pointing to freed memory are left behind.
  3. 3The next request on the same worker treats that state as valid. The result can be code execution or a memory leak.

Here is how the PHP security team officially describes the two flaws:

CVE-2026-109618 · Out-of-memory corruption · CVSS 9.2

“Out-of-memory handling can interrupt PHP while internal request data is only partially initialized. Request cleanup may then treat the invalid data as valid.”[2]

CVE-2026-109619 · Stale global state · CVSS 9.2

“Request-owned internal state can survive after its backing memory has been freed. A later request handled by the same worker may use that stale state before normal initialization resets it.”[3]

The records that circulated during the leak showed a score of 10.0; the PHP Foundation said this was incorrect.[4] The official score for both is 9.2 on CVSS v4.0.

Who is affected?

According to the PHP advisory, every PHP installation that serves web requests is at risk.[1] The vulnerable code path has existed since PHP 5.4.0 — that is, since 2012 — and is present in the default configuration.[4] The level of risk depends on how PHP is connected to the web server:

Server setupRiskNotes
Apache mod_phpHighestThe demonstrated exploit triggers before any application code runs.
PHP-FPMHighBehind Nginx or Apache; most shared and VPS hosting.
LiteSpeed (LSAPI)HighCommon on cPanel/CloudLinux shared hosting.
php-cgiHighTargeted by ransomware campaigns via CVE-2024-4577 in 2024.
FrankenPHPHighListed as affected in the official advisory.

Because the flaw sits in PHP rather than in any application, every PHP application on the same server is exposed. Calif reported confirmed unauthenticated code execution against specific versions of WordPress, Drupal, Joomla and Magento; the same list includes Laravel, Symfony, phpMyAdmin, Nextcloud, Roundcube, MediaWiki and WHMCS.[5] Applications that aren't on the list, such as WooCommerce, OpenCart or PrestaShop, carry the same risk as long as they run on the same PHP version.

Find your PHP version

Everything depends on the PHP version you're running. There are three ways to find out, depending on your access:

If you have SSH access
php -v
php-fpm -v    # the version serving the web may differ from the CLI
If you only have a browser
curl -sI https://yoursite.com | grep -i x-powered-by
# X-Powered-By: PHP/7.4.33
If you run WordPress
Dashboard → Tools → Site Health → Info → Server
# the "PHP version" row

No command line? Use our free HTTP header inspector to look at the X-Powered-By header. If the header is hidden you won't see a version — that's good practice, but it means you'll need to check your hosting panel instead. Enter the version you find below:

Safety depends on the patch number, not the branch (8.3, 8.4): each branch has its own fixed release. For example, 8.3.36 is patched while 8.4.20 is not.

PHP
Try:

The check runs entirely in your browser; nothing you type is sent anywhere. Distribution packages (Debian, RHEL, CloudLinux) may carry the fix under a different version number — check your provider's announcement too.

PHP branchFirst fixed releaseStatus
8.58.5.12Fixed release availableSecurity support until end of 2029
8.48.4.27Fixed release availableSecurity support until end of 2028
8.38.3.36Fixed release availableSecurity support until end of 2027
8.28.2.35Fixed, support endingSupport ends 31 December 2026
7.4 – 8.1—No official releaseSource-code patches and distro packages only
5.4 – 7.3—No fixThe PHP project is not releasing fixes

Source: PHP security advisory.[1] Distributions such as Debian, RHEL and CloudLinux may ship the fix under their own package version numbers.

What should you do?

Today

Upgrade PHP to a fixed release and restart every PHP worker. An update has no effect until running workers are restarted. On shared hosting you can usually pick a version in cPanel's “MultiPHP Manager” or Plesk's “PHP Settings”, but only your provider can confirm the patch is actually installed on the server.

If you can't update right away

PHP has published settings that narrow specific attack paths. They don't make an installation safe; in PHP's own words, updating is the only complete fix.[1]

Interim mitigations — from the PHP security advisory
; php.ini or FPM pool (php_admin_value). ini_set() and .user.ini are not enough.
memory_limit = -1                   ; CVE-2026-109618 — monitor memory usage
post_max_size = 8M                  ; 32M if you need file uploads
upload_max_filesize = 2M            ; keep below post_max_size
session.upload_progress.enabled = 0 ; CVE-2026-109619
fatal_error_backtraces = 0          ; PHP 8.5 only

; Then restart every worker, for example:
;   sudo systemctl restart php8.3-fpm

Two caveats: memory_limit = -1 lets a single request consume all of the server's memory, so you'll need to monitor usage. And the multipart/form-data block suggested by Sansec can break file uploads and some checkout forms.[5] If you use Cloudflare, the WAF rules released for known attack patterns are enabled on the free plan too — again, only a stopgap.[4]

This week

Since the first exploitation attempt was seen on 17 October, check access logs from that date onward for unusual multipart/form-data requests, look for new or modified PHP files in the web root, and watch for admin accounts you don't recognise.[4] Because the flaw also allows memory disclosure, it's prudent to rotate your database password, API keys, payment integration keys and session secrets.[5]

How worried should you be?

The Log4Shell comparison doesn't hold — for now. In its 22 October update, Sansec writes that no universal request that works against every server has been shown, and that an attack needs specific knowledge of, and conditions on, the target. In one researcher's tests, most of the circulating PoCs failed against a default PHP install.[5] The PHP security team also says it found no working exploit among the code that appeared after the leak at the time of disclosure.[4]

Calling it “just noise” would be wrong, though. Amazon and Cloudflare saw exploitation attempts before the patches shipped, and Amazon now reports broad exploitation. In the Netherlands, several sites — including the House of Representatives and the NCSC — were taken offline as a precaution.[4][5] History also argues for caution: CVE-2024-4577 in PHP-CGI and CVE-2019-11043 in PHP-FPM both ended up on the known-exploited list and were used in ransomware campaigns.[4]

A fair summary for today: not every site can be taken over with one click, but an unpatched PHP server is now a known target — and exploits mature over time.

When a patch isn't enough

If you're on a supported PHP branch, this story ends with an update and a restart. The real problem is sites built years ago, whose themes and plugins are tied to old PHP versions. On those sites, updating PHP can break the site — and not updating leaves the hole open.

Security support window for each PHP branch. The flawed code path dates back to 5.4: every branch shown is affected, but only the coloured ones get an official fix.
Support endedEnds 31 December 2026Supported
5.4
5.5
5.6
7.0
7.1
7.2
7.3
7.4
8.0
8.1
8.2
8.3
8.4
8.5
Today
2012201420162018202020222024202620282030

Source: php.net/supported-versions

The orange bar matters most. PHP 8.2 received the fix today, but its security support ends completely on 31 December 2026.[1] If a similar flaw appears in 2027, there will be no official fix for 8.2 — exactly the situation 7.4 and 8.1 users are in today.

Keep patching, or rebuild?

Patch onlyWebsite rebuild
Today's flawClosed — if you're on a supported branchClosed
PHP 8.1 and olderNo official fix; you build from sourceMoved to a supported stack
Old themes and pluginsOften break on newer PHPClean, maintained codebase
The next vulnerabilityAnother emergency fixA defined update process
Speed and SEOUnchangedCore Web Vitals and technical SEO built in

If any of the following applies to you, a patch only buys you time until the next vulnerability:

  1. 1.Your site runs PHP 8.2 or older.
  2. 2.At least one theme or plugin hasn't been updated in a year.
  3. 3.You can no longer reach the agency or developer who built the site.
  4. 4.You're afraid the site will break if you press “update”.
  5. 5.You're not sure who has access to the admin panel.

Risk check

Six questions to see how ready your site is — not just for this flaw, but for the next one.

How exposed is your website?

0/6
  1. 1.Does your site run on a PHP-based system such as WordPress, Joomla, Magento or OpenCart?

    If your admin panel lives at /wp-admin, the answer is yes.

  2. 2.Is your PHP version 8.2 or older?

    Use the version check above.

  3. 3.Have theme, plugin and core updates been applied regularly over the last 6 months?

    Your dashboard shows how many updates are pending.

  4. 4.Does the agency or developer who built the site still support you?

    Who would apply an urgent patch today?

  5. 5.Is the site more than 4 years old?

    When was it last redesigned from scratch?

  6. 6.Does the site have forms, user accounts, payments or file uploads?

    More data to leak, larger attack surface.

Answer 6 more questions to see your result.

FAQ

Frequently Asked Questions

  • What is PHP2Shell?

    PHP2Shell is the name given to the attack chain that combines two critical PHP engine vulnerabilities patched on 21 October 2026: CVE-2026-109618 and CVE-2026-109619. Both are rated 9.2 (critical) on CVSS v4.0 and can allow remote code execution without authentication.

  • Which PHP versions are safe?

    The fixed releases are PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35. Any 8.x release below these is vulnerable. There is no official release for PHP 7.4, 8.0 or 8.1, only source-code patches and distribution packages. The PHP project is not releasing fixes for 5.4 to 7.3.

  • Is my WordPress site affected?

    The flaw is in PHP itself, not in WordPress. So even if your WordPress, WooCommerce, Joomla or Magento code is up to date, the site is at risk if the server's PHP is unpatched. The fix is a PHP update, not a plugin update.

  • I'm on shared hosting. What should I do?

    Check in your hosting panel (cPanel MultiPHP Manager, Plesk PHP Settings, etc.) that your site runs a supported version, and ask your provider for written confirmation that the patched release is installed. If your site breaks on a newer version, the cause is usually an outdated theme or plugin.

  • Do php.ini settings fix the vulnerability?

    No. According to the PHP advisory, settings such as memory_limit=-1 and session.upload_progress.enabled=0 only narrow specific attack paths; they don't make an installation safe. Updating is the only complete fix. The settings must be applied in php.ini or the FPM pool configuration, and every worker must be restarted.

  • How can I tell if my site was compromised?

    The first exploitation attempt was seen on 17 October 2026, so check access logs from that date for unusual multipart/form-data requests, look for new or modified PHP files in the web root, unknown admin accounts and unexpected outbound connections. If in doubt, rotate your database password, API keys and session secrets.

  • Are sites built by Deltaweb affected?

    The sites Deltaweb builds today run on Next.js and don't handle visitor requests through the PHP runtime, so PHP2Shell does not directly affect their front end.

Sources

Every technical claim in this article is based on the primary sources below. We update the article as the story develops.

  1. [1]PHP Group — 21 October 2026 security advisory
  2. [2]GHSA-w8hw-w9fx-j79w (CVE-2026-109618)
  3. [3]GHSA-6wmf-4rv5-p3rp (CVE-2026-109619)
  4. [4]Tenable — php2shell frequently asked questions
  5. [5]Sansec — PHP2Shell research
  6. [6]Palo Alto Unit 42 — Threat Brief
  7. [7]Rapid7 — Critical unauthenticated RCE analysis
  8. [8]Huntress — Rapid Response: php2shell
  9. [9]Google Cloud — Responding to core PHP vulnerabilities
  10. [10]PHP — Supported versions
Add Deltaweb as a preferred source on GoogleSee our new articles more often in your Google results.