Skip to main content

PHP2Shell (CVE-2026-109618 & CVE-2026-109619): How to Find, Mitigate and Verify with Qualys

A vulnerability management walkthrough for two critical, unauthenticated PHP RCE flaws

Updated 17 min readMarkdown
PHP2Shell (CVE-2026-109618 & CVE-2026-109619): How to Find, Mitigate and Verify with Qualys

TL;DR

  • Two critical PHP core flaws, nicknamed PHP2Shell, allow unauthenticated remote code execution. Both are rated CVSS v4.0 9.2.
  • PHP shipped fixes on 21 October 2026: 8.5.12, 8.4.27, 8.3.36, 8.2.35.
  • PHP 8.1 and older are end of life upstream. Most of those systems will need an OS-vendor backport, isolation or retirement.
  • In Qualys: start with QID 45110 for discovery, then QID 520310 (potential) and QID 533086 (confirmed, non-intrusive).
  • In Policy Compliance: import the "PHP2Shell" policy from the Policy Library. It contains Control IDs (CIDs) 32813, 32814, 32815, 32820 and 32822, which check PHP version state and hardening settings. These are controls, not vulnerability QIDs.
  • Patching is the only complete fix. Config hardening only reduces specific attack paths.

1. What happened

On 20 October 2026, the PHP security team announced a coming critical security release, and the CVE IDs leaked before the planned date. PHP then moved the release up and published fixes on 21 October.

The two issues come from how PHP behaves after a fatal error such as running out of memory. PHP "bails out" of the current work abruptly, and the cleanup that should follow gets skipped. That can leave request state half-built, or leave a worker holding pointers to memory that was already freed.

CVE Short description CVSS v4.0
CVE-2026-109618 Out-of-memory condition corrupts request state during cleanup, leading to RCE 9.2
CVE-2026-109619 Stale request-owned global state is reused by a later request on the same worker (use-after-free), leading to RCE 9.2

Why it is nasty

  • Exploitation does not require authentication.
  • Researchers demonstrated RCE on Apache mod_php before any application code runs. A login page, WordPress hardening or a framework maintenance page will not protect you.
  • PHP also validated RCE against PHP-FPM, so FPM is not a safe harbour.
  • Leaked worker memory can expose secrets such as passwords, tokens and API keys.
  • Attack traffic was reported soon after disclosure, and public proof-of-concept code exists.

CVE-2026-115560 (session upload progress feature) was disclosed by PHP on 23 October. As of the latest reporting I found, it had no permanent patch, and PHP's interim advice is to disable session upload progress (see the mitigation section). Check php.net for the fix status before you publish or act.


2. Affected and fixed versions

PHP branch Fixed release Status
8.5 8.5.12 Supported
8.4 8.4.27 Supported
8.3 8.3.36 Supported
8.2 8.2.35 Supported (reaches EOL on 31 Dec 2026)
8.1 and older (incl. 7.x, 5.x) No normal upstream fix End of life. Use OS vendor backports, vendor builds, isolation or retirement

Watch out for distro backports. Linux vendors patch without bumping the upstream version string, so PHP 8.1.2 on Ubuntu 22.04 can be fixed. Compare the full package revision against the vendor advisory, not just the PHP version.

OS Fixed package revision
Ubuntu 22.04 LTS 8.1.2-1ubuntu2.28
Ubuntu 24.04 LTS 8.3.6-0ubuntu0.24.04.13
Ubuntu 26.04 LTS 8.5.4-0ubuntu1.5
Debian 12 (Bookworm) 8.2.35-1~deb12u1
Debian 13 (Trixie) 8.4.27-1~deb13u1

Also remember PHP hides in places people forget: containers, FrankenPHP and other static builds (these bundle their own PHP), vendor appliances with PHP admin portals, and old staging servers.


3. The scale of the problem

Qualys Threat Research Unit analysed anonymised data from more than 10,000 customers:

  • About 167 million PHP package installations, 73% on internet-facing assets.
  • About 110 million (71%) run EOL/EOS PHP versions (5.4 to 8.1).
  • Only about 581,000 (0.37%) were patched within 24 hours of disclosure.

That last number is the real story for us as VM practitioners. Detection is easy. Getting owners to patch, restart and verify is the hard part.


4. Finding it with Qualys

Step 1: Discover every PHP instance (QID 45110)

QID 45110 – PHP Server Detected is an Information Gathered check. It tells you where PHP exists, but it does not confirm vulnerability. Use it to build your inventory across:

  • Network/authenticated scans
  • Cloud Agent
  • Container assessments
  • Deep Scan (where supported)

Step 2: Run the vulnerability QIDs

QID What it does Notes
520310 PHP RCE Vulnerabilities (PHP2Shell), CVE-2026-109618/109619. A Potential check Version-based. Qualys documents it as checking PHP version in headers such as X-Powered-By/Server and cookies for web apps. Released in VULNSIGS 2.6.728-2
533086 PHP RCE Vulnerability (PHP2Shell). Confirmed Non-intrusive. For web apps, it sends a POST with a session ID containing an invalid character. Released in VULNSIGS 2.6.728-8
533068 PHP2Shell Active Crash Detection. Confirmed Intrusive. Sends large payloads to test memory exhaustion. Qualys says to run it only on non-production or verified-patched systems, with approval, in a maintenance window

⚠️ Do not point QID 533068 at production without change approval. The test is designed to provoke a memory-exhaustion condition, which is the very behaviour that makes these flaws dangerous.

Qualys's PHP2Shell playbook lists more detections depending on your sensor and scan type:

QID What it detects Notes
48394 PHP Installation and Configuration Detected Inventory
389102 PHP2Shell multiple vulnerabilities Cloud Agent and container sensors
39033 PHP2Shell Unauthenticated
520404 Session upload-progress RCE in web apps TotalAppSec
39036, 389141 Session upload-progress RCE (CVE-2026-115560) Listed as "coming soon" in the playbook, so check the KnowledgeBase

The playbook also notes that Qualys adds distro and vendor QIDs as advisories land, so search the KnowledgeBase by CVE as well as by QID.

For configuration hardening (as opposed to vulnerability detection), Qualys uses Policy Compliance control IDs. Those are covered in section 5.

Step 3: Build a view in VMDR

Create a saved search or dashboard widget that filters on the QIDs above, then group by:

  • Internet-facing vs. internal
  • PHP branch (8.2 to 8.5 vs. EOL)
  • Business criticality / TruRisk score
  • Asset owner

Example QQL starting point (validate the field names in your own tenant before relying on it):

vulnerabilities.vulnerability.qid: [520310, 533086]

TotalAppSec (WAS) covers web apps and APIs with six new QIDs for PHP2Shell and the related Node2Shell, four non-intrusive and two intrusive, so you can scan the app layer in addition to hosts.

If you are a Qualys customer, there was also a time-limited free assessment offer (15 days, up to 1,000 assets) announced in late October. Check whether it is still open.

Step 4: Prioritise

Use this order:

  1. Internet-facing + mod_php or PHP-FPM + unpatched supported branch
  2. Internet-facing + EOL PHP
  3. Internal systems that process untrusted input (portals, upload endpoints)
  4. Everything else

Pair exposure with TruRisk, asset criticality and any TruConfirm results to resolve ties.


5. Policy Compliance: auditing your PHP hardening baseline

Vulnerability QIDs tell you whether PHP is vulnerable. Qualys Policy Compliance (PC) tells you whether PHP is configured the way you want it. For PHP2Shell that matters twice: it shows where compensating settings are missing on systems that cannot be patched yet, and it gives auditors evidence that the temporary controls were applied and later reverted.

5.1 Import the PHP2Shell policy

Qualys published a ready-made policy in the Policy Library:

  1. Go to Policy Editor > Create a New Policy > Policy from Library.
  2. Search for "PHP2Shell" and import it.
  3. Scope it to the PHP assets you tagged during discovery (for example a dynamic tag such as "PHP2Shell – PHP hosts" built from your CSAM or VMDR PHP inventory).
  4. Add it to a compliance scan or Cloud Agent policy and let it run.

Platform support (per Qualys): Linux through the Qualys Scanner or Cloud Agent. Windows through the Cloud Agent only.

5.2 Controls in the policy

CID Control statement CVE
32813 State of the installed PHP version CVE-2026-109618
32814 Configuration of memory_limit in PHP configuration files CVE-2026-109618
32815 Configuration of post_max_size in PHP configuration files CVE-2026-109618
32820 Configuration of maximum input nesting level policy CVE-2026-109618
32822 Configuration of upload_max_filesize relative to post_max_size CVE-2026-109618

CIDs are not QIDs. A CID is a Policy Compliance control. A QID is a vulnerability KnowledgeBase entry. They live in different parts of the platform and report in different places (Posture vs. Vulnerabilities), so keep them separate in your tickets and dashboards.

5.3 What each control is really telling you

Control What a pass or fail means How to read it
32813 (PHP version state) Whether the installed PHP is at a fixed state Treat this as the posture-side twin of QID 520310/533086. If the two disagree, check for a distro backport, multiple PHP installs, or an outdated scan
32814 (memory_limit) Whether the memory cap matches your policy See the trade-off below. This control is where -1 risk gets documented
32815 (post_max_size) Whether the request body cap is small enough to limit out-of-memory attempts PHP's guidance suggests 8M with no uploads or 32M with uploads
32820 (input nesting) Whether the nesting limit is constrained Qualys describes this as a "maximum input nesting level policy". Confirm the exact PHP directive in the control's technical details
32822 (upload_max_filesize vs. post_max_size) Whether the upload cap stays below the body cap PHP's guidance keeps upload_max_filesize smaller than post_max_size

The memory_limit trade-off. PHP's own temporary advice includes memory_limit = -1, but Qualys itself warns that this removes the per-request cap and raises resource-exhaustion risk. A PC control that simply says "must be -1" can push teams into a worse position. Decide deliberately:

  • If you adopt -1 as a stopgap, make it a time-boxed exception with an owner and an expiry date, ideally paired with a container or cgroup memory boundary.
  • After patching, restore a finite limit and update the policy so the control stops expecting -1.

Expected values depend on your app. CrowdStrike's analysis found that one demonstrated path depends on how memory_limit relates to post_max_size (a stock install with defaults was not reachable through that specific path, but common tuned-for-uploads setups can be). Read that as a reason to review combinations of limits, not a reason to relax anything. Set expected values per application tier and document the reasoning.

5.4 Gaps to fill with custom controls (UDCs)

All five CIDs above are tagged to CVE-2026-109618 (the out-of-memory flaw). The settings most associated with CVE-2026-109619 and the follow-on session issue are not in that list:

  • session.upload_progress.enabled = 0
  • fatal_error_backtraces = 0 (PHP 8.5 only)
  • Absence of per-request INI overrides (Apache php_value, .htaccess, front-end PHP_VALUE)
  • Optional FPM pool setting pm.max_requests = 1

If your auditors want evidence for those, build User Defined Controls (UDCs). Practical design notes:

  1. Check the config the web SAPI actually loads. php -i and the CLI php.ini can differ from what Apache or PHP-FPM uses. Typical paths are /etc/php/<ver>/fpm/php.ini, /etc/php/<ver>/apache2/php.ini, and pool files under /etc/php/<ver>/fpm/pool.d/. Use a file-content style UDC aimed at those, not the CLI file.
  2. Cover both forms of the setting. The value may be in php.ini or in a pool file as php_admin_value[session.upload_progress.enabled] = 0. Prefer the php_admin_value form for enforcement because applications cannot override it at runtime.
  3. Match accepted spellings. PHP accepts 0, Off, false and similar. Illustrative regex to test and adapt before you deploy it:
^\s*session\.upload_progress\.enabled\s*=\s*(0|off|false|no)\s*(;.*)?$
  1. Handle drop-in files and includes (conf.d/*.ini). A later file can override an earlier one, so a pass on php.ini alone can be a false comfort.
  2. Expect false negatives on runtime state. A config file check cannot prove the running worker loaded the change. Pair the UDC with a restart check or the vulnerability QIDs.
  3. Name controls clearly (for example "PHP2Shell – session.upload_progress disabled (FPM)") and tag them to the CVE in the control description so they show up in CVE-based reporting.

5.5 Operating the policy

  • Baseline first, then enforce. Run the policy in report mode, review the failure list with app owners, and only then tie it to change tickets.
  • Use exceptions with end dates. In Policy Compliance, request exceptions for hosts that legitimately need different limits (large upload apps) and for temporary memory_limit = -1. Expiry dates stop temporary workarounds becoming permanent.
  • Report both views together. For each asset, show vulnerability status (QIDs) next to compliance status (CIDs). The combinations tell different stories:
Vulnerability QID PC controls Interpretation Action
Open Fail Unpatched and unhardened Highest priority. Patch, or apply stopgaps now
Open Pass Unpatched but hardened Stopgap in place. Keep a patch deadline
Fixed Fail Patched, but config drift or weak limits Lower urgency. Fix config and restore sane limits
Fixed Pass Patched and hardened Done. Keep monitoring
  • After patching, revisit the policy. If you set temporary values (for example memory_limit = -1), update expected values so the policy reflects the final state, and re-run the scan to show the controls pass.
  • Evidence for auditors. Keep the dated scan results showing the exposure window, when stopgaps were applied, when patches landed, and when temporary settings were reverted.

6. Remediation: patch first

  1. Update PHP to the fixed release for your branch, or install your OS vendor's fixed package.
  2. Containers: rebuild from a patched base image and replace the running containers. Patching the host does nothing for a container's bundled PHP.
  3. Static builds (for example FrankenPHP) need their own binary updated.
  4. Restart PHP-FPM, Apache or any long-running worker so the new runtime loads. A patched package on disk with an old process in memory is still vulnerable.
  5. Verify the web runtime, not the CLI. php -v shows command-line PHP, which can differ from what your web server runs. Check the version served through the actual SAPI.
  6. Managed or shared hosting: ask the provider in writing whether your site's runtime is patched.
# Debian/Ubuntu example
sudo apt update && sudo apt install --only-upgrade php*
apt-cache policy php8.3-fpm            # compare full revision to the vendor advisory
sudo systemctl restart php8.3-fpm apache2
ps -o pid,lstart,cmd -C php-fpm8.3     # confirm worker start time is AFTER the update

(Adjust package and service names for your distro and PHP branch.)


7. Workarounds if you cannot patch yet

PHP's position is clear: there is no complete mitigation other than updating. Treat everything below as a time-boxed stopgap with an owner and an expiry date.

6.1 Disable session upload progress

Blocks the confirmed session-based paths (CVE-2026-109619 and the related CVE-2026-115560 interim advice):

session.upload_progress.enabled = 0

On PHP 8.5, also disable fatal error backtraces:

fatal_error_backtraces = 0

Apply these in php.ini, an FPM pool config or server config that loads before request parsing. ini_set() and .user.ini are too late to help. Restart every worker and check the effective values.

6.2 Reduce the out-of-memory attack surface (CVE-2026-109618)

  • Block multipart requests at the front end (reverse proxy/WAF/load balancer) if the app does not need uploads. Do it before PHP parses the body, and test your forms first.
  • Tighten body limits. PHP's guidance suggests roughly post_max_size = 8M without uploads, or 32M with uploads, with upload_max_filesize kept below it. Also enforce decoded body size at the proxy.
  • Reduce nesting and upload-count limits and enforce them at the proxy.
  • memory_limit = -1 is a PHP-documented but incomplete workaround. It removes the per-request cap, so one request can consume host memory. Use it only with a container or cgroup memory boundary, and understand it trades one risk for another. Do not use RLIMIT_AS/RLIMIT_DATA as a substitute, because they can trigger the failure condition.

6.3 Add compensating controls

  • WAF: Cloudflare deployed PHP-specific managed rules (on paid plans, confirm the Managed Ruleset is in Block mode). Make sure the origin cannot be reached directly, or attackers will bypass the WAF.
  • IDS/IPS: Emerging Threats released multiple Suricata-style signatures on 22 October covering multipart and session-injection patterns.
  • EDR / process monitoring: exploitation tends to show up as unexpected child processes spawned by PHP workers (php-fpm, php-cgi, httpd, apache2). Alert on shells, curl/wget or interpreters launched by the web server account.

6.4 EOL PHP (8.1 and earlier)

In order of preference:

  1. Upgrade to a supported branch.
  2. Use your OS vendor's maintained backport (for example Ubuntu 22.04's PHP 8.1 package).
  3. Isolate: put the system behind strict network controls and a WAF, remove internet exposure, and schedule retirement.
  4. PHP's security team supplied minimal source backports for 7.4, 8.0 and 8.1, but these are not a return to normal support or ready-made packages. Do not treat third-party "patched builds" as production-grade without vetting.

6.5 Last resort: take it offline safely

If you cannot patch and cannot isolate, stop the web server or return a static maintenance page. Do not simply remove the PHP handler. Many web servers will then serve your PHP source as plain text and leak secrets. Verify from outside.


8. Verify and close the loop in Qualys

  1. Rescan the same assets with the same QIDs. Remember that a rescan after patching but before restarting workers may still show the issue.
  2. Confirm 520310/533086 detections move to Fixed. Watch for Reopened detections.
  3. For intrusive QID 533068, only re-run on patched or non-production systems and inside a change window.
  4. Re-run the PHP2Shell policy (and any UDCs). Confirm CID 32813 passes, and that temporary settings were reverted and the remaining limits match your approved values.
  5. Close or expire Policy Compliance exceptions that were raised for stopgaps.
  6. Review exceptions. Every unpatched system needs an owner, a mitigation record and a deadline.
  7. Track metrics: time-to-detect, time-to-patch, percentage on EOL PHP, number of systems relying on compensating controls, and policy pass rate for the PHP2Shell controls.

Don't forget compromise assessment

Patching does not remove an attacker who already got in. Because exploitation attempts were reported before many patches landed, look for:

  • Unexpected processes or commands run by the web server user
  • New or modified files in web directories (webshells)
  • New scheduled tasks, cron jobs or accounts
  • Unusual outbound connections from web servers
  • Secrets that may have been exposed from leaked worker memory: rotate database passwords, API keys and tokens on systems that were exposed

If you find signs of compromise, isolate the host, preserve logs and engage incident response.


8. Key takeaways for VM teams

  1. Version numbers lie on backported distros. Check package revisions.
  2. Discovery is half the job. QID 45110 plus software inventory finds the PHP you forgot about (containers, appliances, staging).
  3. Restart is part of remediation. Verify the running process, not just the package.
  4. Mitigation is not remediation. Track every workaround with an expiry.
  5. EOL is a risk decision, not a patching task. Escalate it with business owners.
  6. Rotate secrets where exposure is plausible.
  7. Use Policy Compliance as the evidence trail. QIDs show vulnerability, CIDs show hardening. Report them side by side, and keep dated results for auditors.
  8. Watch the memory_limit = -1 trap. It is a documented temporary measure, but it needs an expiry date and a boundary around it.

About the author

  • Security operation centre analyst | Vulnerability management and penetration testing (VAPT) | Qualys Compliance | Cloud security

No comments yet. Be the first to comment.