Insights

Security Advisory: critical remote code execution vulnerabilities in PHP

Two critical vulnerabilities in PHP, together known as PHP2Shell, can allow an attacker to run code on a web server without needing to log in. The PHP project released fixed versions on 21 October 2026. Chorus CSOC is monitoring the situation as a priority and is running hunts to identify potentially vulnerable customer systems and any signs of compromise.

Who is affected?

PHP is a server-side scripting language used to build websites and web applications, including content management systems such as WordPress, Joomla and Drupal. It is also built into many third-party products and appliances.

Every PHP installation that serves web requests is at risk unless it has been updated. This includes PHP-FPM, Apache with mod_php, php-cgi, FrankenPHP and LiteSpeed. The PHP project considers Apache with mod_php to be at highest risk, because a demonstrated exploit works before any application code runs. All PHP versions are affected, including those that are no longer supported.

How the vulnerabilities work

Both issues are in how PHP manages memory while it handles a web request.

  • CVE-2026-109618: if PHP runs out of memory part-way through a request, it can leave internal data only partly set up and then treat that data as valid when it cleans up.
  • CVE-2026-109619: data belonging to one request can survive after its memory has been freed, and a later request handled by the same worker process can use it.

What could an attacker do?

A successful attack lets the attacker run their own code on the server with the same permissions as the web server. From there they could install web shells or backdoors for persistent access, run cryptocurrency miners, or steal data the website can reach, such as databases and stored credentials.

What you should do?

1) Find PHP across your estate

Identify every system running PHP, starting with those exposed to the internet. Do not limit this to older versions, and include third-party products and appliances that bundle PHP. NCSC-NL maintains a list of products with a PHP dependency that may be affected.

If your website is built, hosted or maintained by an external web agency or hosting provider, contact them to confirm whether it uses PHP. If it does, ask them to confirm it has been updated and checked for signs of compromise. These sites often sit outside the environments Chorus CSOC monitors, so our hunts may not cover them.

2) Update PHP

Update to the fixed version for your PHP branch:
8.5 – 8.5.12
8.4 – 8.4.27
8.3 – 8.3.36
8.2 – 8.2.35
8.1 and older – No official update, see below

  • Windows: download the updated binaries from the PHP Windows downloads page.
  • Linux: install the updated packages from your distribution. Linux vendors received the fixes in advance.
  • Building from source: source code is on the PHP downloads page.
  • If you use the volunteer-maintained remirepo repository, the PHP project recommends switching to your distribution’s packages or building from source, so that you can apply updates immediately.
  • After updating, restart the web server or PHP-FPM service so that every worker runs the fixed version.

PHP 8.1 and older no longer receive updates from the PHP project. Some distributions and long-term support vendors provide backported fixes, so check with your vendor or upgrade to a supported version. The PHP security team has also published minimal source backports for PHP 7.4, 8.0 and 8.1 for anyone who builds from source.

PHP 8.2 reaches end of life on 31 December 2026. If you run 8.2, please also plan your move to a supported branch.

PHP 8.1 and older no longer receive updates from the PHP project. Some distributions and long-term support vendors provide backported fixes, so check with your vendor or upgrade to a supported version. The PHP security team has also published minimal source backports for PHP 7.4, 8.0 and 8.1 for anyone who builds from source.
PHP 8.2 reaches end of life on 31 December 2026. If you run 8.2, please also plan your move to a supported branch.

3. If you cannot update immediately

The PHP project is clear that the measures below only reduce exposure to specific attack paths. They do not make an installation safe, so please update as soon as you can.

The safest interim option is to take affected websites offline until they can be updated. If that is not possible, apply the following configuration changes.

To reduce exposure to CVE-2026-109618

  • Set memory_limit=-1 in a way that applications cannot override, such as php_admin_value in the FPM pool or Apache configuration. Check that no pool, directory or application setting puts a finite limit back.
  • Use a container or cgroup memory limit to protect availability, ideally one that stops only the affected worker. Do not use RLIMIT_AS or RLIMIT_DATA, as these can trigger the vulnerable condition.
  • Set a low post_max_size: 8M for applications that do not need file uploads, or 32M if uploads are required. Keep upload_max_filesize below post_max_size.

To reduce exposure to CVE-2026-109619

  • Set session.upload_progress.enabled=0 in php.ini, an FPM pool or a server configuration that applies before request parsing, then restart every worker. Do not rely on ini_set() or FPM .user.ini files for this.
  • On PHP 8.5, also set fatal_error_backtraces=0 and restart every worker.

Developers should also review the PHP security advisory for further steps, including removing deprecated per-request settings and fixing errors or timeouts that an attacker could trigger.

4) Protect public websites with a web application firewall

We recommend that all internet-facing web applications sit behind a web application firewall (WAF). If you already have one, check with your vendor for rules that cover PHP2Shell. Microsoft has published Azure WAF mitigations, linked below. Limits on request size and complexity at the web server, proxy or WAF can also reduce exposure.

What Chorus CSOC is doing

We are monitoring this situation as a priority and running hunts across customer environments to identify potentially vulnerable systems and any signs of compromise. We will share further updates as the situation develops.

Get in touch

If you need help identifying affected systems, applying updates or investigating suspicious activity, please contact us.