Language

Article

Two critical PHP core flaws disclosed: your code never runs, and the server still falls

CVE-2026-109618 and CVE-2026-109619 (CVSS 9.2): an unauthenticated, crafted multipart POST request can trigger memory corruption and remote code execution. Secure versions are 8.2.35 / 8.3.36 / 8.4.27 / 8.5.12.

On 2026/10/21 PHP released security versions fixing two critical flaws: CVE-2026-109618 and CVE-2026-109619 (community name "PHP2Shell"). The official advisory and the GitHub security advisories rate them Critical, CVSS 9.2. An unauthenticated remote attacker only has to send one crafted multipart POST request to trigger memory corruption and, in the end, execute arbitrary code with the privileges of the PHP worker process. The secure versions are 8.2.35, 8.3.36, 8.4.27, 8.5.12 (and any later patch release of each line).

What each flaw actually is

CVE-2026-109618: PHP handles out-of-memory (OOM) errors with longjmp(). If an allocation fails before the request has finished initialising, control flow jumps out of request initialisation early, and the request shutdown path then operates on memory state that was never fully initialised — that is the corruption. The advisory classifies it under use-after-free, uninitialised pointer and dereference of an externally controlled pointer.

CVE-2026-109619: global state inside the worker (errors, sessions, objects, extensions and so on) is not properly reset once a request ends, and some of those pointers refer to request memory that has already been freed. An attacker can send two requests in sequence on the same worker: the first leaves uncleaned state behind, the second touches those stale pointers before it finishes initialising — a cross-request use-after-free.

Trigger paths include multipart request parsing and the session upload progress feature, which is on by default.

Why "my code is fine" does not mean "my site is safe"

Both defects live in the interpreter's request lifecycle. They do not require WordPress, Drupal, Joomla, Magento, Laravel or Symfony to contain a bug of their own. The advisory is explicit: under Apache mod_php the attack can be triggered before application code runs at all.

The affected surface is therefore "every PHP installation that handles web requests from the outside", regardless of framework; PHP-FPM (including php-fpm images in containers) has to be in scope as well. Also note that branches 8.1 and older no longer receive routine security updates, so those environments depend on whether the distribution or a long-term-support vendor shipped a separate patch.

According to domestic reporting, exploit details and a PoC are public and in-the-wild use has been observed; mass scanning worldwide was seen shortly after the patch was published, and some sites took themselves offline in a hurry.

What to do now

  1. Check the version first: php -v, and check the container image base layer and the CLI version on the hosting machine too (many sites upgrade only FPM and forget the CLI that cron uses).
  2. Upgrade to a secure version: 8.2.35 / 8.3.36 / 8.4.27 / 8.5.12 or later. Take a data backup before upgrading.
  3. Do not treat mitigation as a fix. The official statement is clear: temporary mitigations only reduce exposure on specific attack paths and cannot make an installation secure.
  4. Mitigations, when an upgrade cannot be scheduled: set memory_limit = -1, and set it in a way the application cannot override (the FPM pool or Apache's php_admin_value), then confirm that no pool, directory or application re-applies a limit; with no file-upload requirement set post_max_size = 8M, otherwise 32M, and keep upload_max_filesize below post_max_size; at the web server or proxy layer limit the decoded request size, the number of input fields, the number of multipart parts, the number of headers and the nesting depth, and the rules must cover requests without a Content-Length; enable session.use_strict_mode = 1 and turn off session.upload_progress.enabled. Do not substitute RLIMIT_AS / RLIMIT_DATA — they can instead create allocation failures on exactly the vulnerable path.
  5. Look for signs: PHP workers crashing unexpectedly, diagnostics and fatal errors during the cleanup phase, unusual child-process creation, file writes that should not have happened.

What this asks of us

We are not going to conclude that "PHP is insecure" — memory-safety defects are an inherent property of a C runtime, and every runtime that writes an interpreter in C faces the same family of problems. The dimension that is actually comparable is how fast you discover and follow up.

So this news maps onto two disciplines for us. Dependency vulnerability scanning is a failure condition of the full gate, not a report you may ignore: when the database updates and we have not followed, the build goes red outright. And the toolchain's patch level is a hard constraint, not a preference, because this product's shape is a single process talking TLS and HTTP/2 directly — a runtime flaw reachable from the server side has nobody else standing in front of it. Upload and request-body ceilings are also declared in exactly one place: any endpoint that has to exceed the kernel default must register explicitly, and only on one precise method and path. That does not stop any particular CVE; it stops "the limit" from drifting into two answers.

Scope note

The facts here come from the PHP security advisories and the GitHub advisories (GHSA-w8hw-w9fx-j79w, GHSA-6wmf-4rv5-p3rp), the National Vulnerability Sharing Platform (CNVD-2026-41674 / 41675) and public alerts from the national cyber notification centre. We did not reproduce an exploit and we do not offer emergency response for third-party runtimes; take the exact versions and mitigation parameters from the official advisories.