NVD gives this SOAP bug a scary score, but it only touches one fairly niche setting. Here’s how to tell whether you use it.

At a glance

  • CVE: CVE-2026-7261
  • Severity: 9.8 (Critical) at NVD. PHP’s own advisory rates it medium (6.3 on CVSS 4.0).
  • Affected: PHP 8.2 before 8.2.31, 8.3 before 8.3.31, 8.4 before 8.4.21, and 8.5 before 8.5.6, but only for a SoapServer set to SOAP_PERSISTENCE_SESSION.
  • Known exploited: No. It’s not on CISA’s KEV list.

What’s going on

Normally, a SoapServer’s handler object (the class you hand to setClass()) lives for a single request and gets thrown away once handle() is done. Call setPersistence(SOAP_PERSISTENCE_SESSION) and PHP keeps that object in the user’s session instead, so it survives from one request to the next.

The bug is in the error path. If the handler for a SOAP header fails, by returning false or throwing an exception, PHP frees the handler object as if persistence were off, while the session still points at it. When the session gets saved at the end of the request, PHP reads that freed object and writes it to session storage. That’s a use-after-free, and NVD says it can lead to memory corruption, information disclosure or crashes. PHP’s advisory adds some useful context: because a SOAP server normally handles just one SOAP request per PHP request, it’s unlikely an attacker can control the freed memory, though it’s not impossible.

So who’s at risk? Only SOAP endpoints that call setPersistence(SOAP_PERSISTENCE_SESSION). The default mode, SOAP_PERSISTENCE_REQUEST, isn’t affected. A quick search of your codebase for SOAP_PERSISTENCE_SESSION tells you whether you’re using it.

Timeline

  • Disclosed: 2026-05-07 (PHP’s advisory went public with the fixed releases)
  • Patch released: 2026-05-07 (PHP 8.2.31, 8.3.31, 8.4.21 and 8.5.6)
  • CVE published at NVD: 2026-05-10

== UPDATE ==

The May 2026 PHP releases fix it, and there’s a simple workaround if you need one.

  • Patch available: Yep.
  • Fixed in: PHP 8.2.31, 8.3.31, 8.4.21, 8.5.6. Branches older than 8.2 are end of life and aren’t covered by PHP’s advisory.
  • How to apply: Update PHP through your package manager (or PHP distribution) to the fixed release or anything newer on your branch, then restart your web server and any PHP-FPM pools so every worker loads the new build. As of this write-up, the newest releases are 8.2.36, 8.3.37, 8.4.28 and 8.5.13, and they include later security fixes too. If you use your distro’s PHP packages, install the distro’s security update; distros often backport the fix without bumping to the upstream version number.
  • If you can’t patch yet: if your handler object doesn’t really need to survive between requests, switch to the default SOAP_PERSISTENCE_REQUEST (or just drop the setPersistence() call). That keeps you off the buggy code path until you can upgrade.

References