All articles

PHP2Shell: What to Patch and How to Verify the Fix

A practical response to the October 2026 PHP vulnerabilities: fixed releases, the session upload progress follow-up and checks for live web workers.

PHP application server beside an emerald shield and two contained red fault indicators

A PHP security update needs to reach the process serving your application. Updating a command-line binary, while an older web worker or container continues handling requests, leaves the response unfinished.

On 21 October 2026, PHP released fixes for two critical vulnerabilities that can allow unauthenticated remote code execution. They are commonly discussed as PHP2Shell. PHP identifies web-serving deployments as the concern and considers Apache mod_php the highest-risk configuration. PHP security announcement.

What changed

The two issues affect how PHP handles request state:

  • CVE-2026-109618: memory exhaustion can interrupt initialization and leave invalid internal data for cleanup to consume. PHP's OOM advisory.
  • CVE-2026-109619: state retained by a worker can refer to memory already freed after a request. A subsequent request can reach that stale state before normal initialization replaces it. Exploitability depends on the relevant application and server paths. PHP's stale-state advisory.

This is a runtime patching issue. Reviewing application code remains useful, but it does not replace deploying the PHP fix.

Fixed upstream releases

Use a supported release containing the fixes, or a later supported security release in the same branch:

PHP branch Security release containing the fixes
8.2 8.2.35
8.3 8.3.36
8.4 8.4.27
8.5 8.5.12

These are the upstream fix versions announced on 21 October, not a promise that they remain the newest releases. PHP also notes that distributions and support vendors may supply backported packages. Check the vendor advisory for the full installed package revision instead of judging an operating-system package only by its upstream version. PHP release guidance.

The 23 October follow-up matters

PHP subsequently recommended disabling session upload progress until its next regular bugfix release for an additional, unusual remote-code-execution path, tracked as CVE-2026-115560. It involves an application changing its session serialization handler at runtime under specific conditions. Do not assume the two earlier fixes also close this follow-up issue. PHP follow-up notice.

PHP's recommended setting is:

ini
session.upload_progress.enabled=0

Apply it in the server's administrative PHP configuration and restart the affected workers. PHP's earlier advisory explains that runtime application settings do not reliably block the early session path. This setting addresses particular paths; it is not a substitute for the runtime update. PHP mitigation details.

A practical deployment checklist

  1. Find each deployment. Build a list of web servers, application pools, containers and vendor appliances that include PHP. Give every service an owner.
  2. Match the right update channel. Use the distribution, runtime vendor or application vendor responsible for that installation. Record the advisory and package revision that establish the fix.
  3. Test a representative service. Include authentication, file uploads, sessions, scheduled tasks and the extensions that service actually uses.
  4. Replace the running process. Plan the worker restart or container replacement with the application owner. Keep sufficient capacity available while instances restart.
  5. Verify from the service environment. Confirm the deployed artifact and worker configuration, then exercise an ordinary application request. A healthy homepage alone is not a complete functional check.

These read-only commands can help identify the CLI installation:

sh
php -v
php --ini

They do not prove which binary or configuration PHP-FPM, Apache or another web server uses. Check that separately. Avoid publishing a public diagnostic page exposing PHP configuration.

Keep evidence of what actually changed

For each service, retain the before-and-after package revision, deployment time, worker restart and health-check result. An exception should have an owner and a deadline. If a service cannot be updated, document its temporary controls and the remaining exposure explicitly.

Use RemediForge's host inventory, available updates and job history to coordinate operating-system package changes where its configured update source supplies the fix. Treat application-bundled runtimes and container replacement as explicit application-owner work; a host package update does not establish that those artifacts changed.

The useful outcome is specific: the intended service now runs the corrected runtime, the follow-up configuration has been reviewed, and normal application behavior still works.

Technical facts checked against the linked PHP advisories on 25 October 2026. Recheck vendor guidance before deployment.

See it on your own fleet

Enroll a few hosts and RemediForge shows what each one is missing.

Start free trial
PHP2Shell: What to Patch and How to Verify the Fix | RemediForge