CRITICALPHP2Shell: patch to 8.2.35 · 8.3.36 · 8.4.27 · 8.5.12 now

Check my exposure
Dirasphp2shell
CVSS v4.0 · 9.2CVE-2026-109619CVE-2026-109618

Two critical PHP flaws allow remote code execution without authentication.

PHP processes the malicious request before any application code runs, so login pages and application-level controls do not stop it. Patching is the only complete fix. Scan a host you own to see where it stands.

Scan a site for PHP2Shell

  • Runs in your browser
  • No account, no install
  • Hosted in the Kingdom

Only scan systems you own or are explicitly authorized to test. Scans are logged.

01What happened

Two flaws in the PHP request life cycle

On 21 October 2026 the PHP project released security updates for both flaws. Any PHP script exposes the vulnerable path, even one that only prints a response.

CVE-2026-1096189.2 CRITICAL

Memory corruption during out-of-memory handling

When a memory allocation fails, PHP can abandon a request and leave invalid data for its cleanup routine. Crafted multipart requests (forms and file uploads) can exhaust memory even when they appear to respect configured limits. On Apache mod_php the attack succeeds before application code executes.

CVE-2026-1096199.2 CRITICAL

Use-after-free across requests

A reused PHP worker can access state that still points to memory freed by an earlier request, and fatal errors or timeouts can interrupt cleanup. RCE is confirmed on mod_php and PHP-FPM through the session lifecycle, and on PHP 8.5 through fatal error backtraces.

02Who is affected

Every PHP installation that serves web requests

PHP 5 through 8.5 are affected. The vendor rates Apache mod_php as the highest risk because exploitation can complete before any application code runs.

  • Apache mod_php
  • PHP-FPM
  • php-cgi
  • FrankenPHP
  • LiteSpeed

This includes platforms built on PHP: WordPress, Laravel, Drupal, Magento and most shared hosting.

Affected versions
BranchVulnerableUpdate to
8.5< 8.5.128.5.12
8.4< 8.4.278.4.27
8.3< 8.3.368.3.36
8.2< 8.2.358.2.35
7.4 – 8.1End of lifeVendor fix or source backport
5.x – 7.3End of lifeUpgrade to a supported branch
03How to mitigate

Response checklist

Treat this as an emergency change, outside normal patch cycles. Tick each step as your team completes it.

0 of 6 complete
  1. Include staging servers, marketing microsites, legacy portals and third-party hosted pages on your domains. You cannot patch what you have not found.

    Diras finds them
  2. 8.2.35 · 8.3.36 · 8.4.27 · 8.5.12, or a distribution package that contains both complete patches. Linux distributions and LTS vendors received patches in advance. Users of rpms.remirepo.net should switch to distribution packages or build from source.

  3. For PHP 7.4, 8.0 and 8.1, use a vendor fix or the limited source backports PHP published for this incident. Anything older must be upgraded to a supported branch.

  4. Restart PHP-FPM pools and Apache so no worker keeps the old binary or old settings in memory. Confirm the version on each host, not just in your package manager.

  5. Limit decoded request size, input and multipart counts, headers per part and nesting depth, including requests without a usable Content-Length. If an application does not use multipart data, block it before it reaches PHP.

  6. Patching closes the door but does not remove an attacker who is already inside.

    What to look for

If you cannot patch today

Temporary. Reduces exposure to known paths only.

; FPM pool or server config, not ini_set() or .user.ini
php_admin_value[memory_limit] = -1
php_admin_flag[session.upload_progress.enabled] = off
php_admin_flag[fatal_error_backtraces] = off  ; PHP 8.5
php_admin_value[post_max_size] = 8M           ; 32M if uploads needed
php_admin_value[upload_max_filesize] = 6M
; then restart every worker

What does not protect you

  • Configuration changes alone. Researchers confirmed that settings such as disabling session upload progress do not stop the attack. Only an update with both fixes is complete.
  • Hiding errors with display_errors or error_reporting or @. Stale state is still reachable.
  • Using RLIMIT_AS or RLIMIT_DATA as a memory cap. They can trigger the vulnerable path.
  • Application login, WAF rules on app routes, or clean logs. The request is processed before your code runs, and missing log entries are not proof of safety.
04Detection

Signs you may already be compromised

The exploit needs no brute force and does not necessarily crash the worker, so there may be no obvious outage.

  • access.log

    Unusually large form submissions

    Multipart POST requests to arbitrary PHP endpoints, including pages that never accept uploads.

  • php_errors.log

    Memory exhaustion during request startup

    Out-of-memory errors raised before application code runs, often in bursts from one source.

  • ps / auditd

    PHP workers spawning shells

    php-fpm or httpd spawning sh or bash or curl or wget.

  • Dark web

    Access to your servers offered for sale

    Initial-access brokers list compromised web shells and credentials soon after mass exploitation.

    Monitor with Diras
05How Diras helps

From exposure to closure, in one platform

Start free assessment
  • EASM

    Find every vulnerable PHP host

    Continuous discovery of domains, subdomains, IPs and services, with PHP version fingerprinting, severity and remediation guidance per asset.

    Scan my perimeter
  • Dark Web Monitoring

    Know if access is being sold

    Alerts on marketplace listings, Breached Employees and Compromised Devices tied to your organization, so you can act before resale turns into ransomware.

    Check my exposure
  • AI Assistant

    Ask what to fix first

    Ask “which of my hosts are exposed to PHP2Shell?” and get an answer from your own findings, with cited remediation steps, in Arabic or English.

    See a demo
  • Hosted in the Kingdom
  • Aligned with NCA ECC, SAMA CSF and PDPL
  • Arabic and English
  • Unlimited users on every plan
06Credits & references

Who found it, and where to read more

This page summarizes public research. The discovery and the primary technical writeups belong to the researchers and vendors below.

Free · 2 weeks · no install

Get your Diras Exposure Score before attackers get your servers.

We assess your external attack surface and dark web exposure for two weeks and deliver a report your team can act on, with PHP2Shell findings prioritized.

  • Every internet-facing PHP host and its version
  • Leaked employee credentials and infected devices
  • Lookalike domains impersonating your brand
  • A walkthrough with a Diras analyst

Start your free assessment