---
title: "php2shell: patching PHP is easy, finding it is the hard part"
description: "PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35 fix two unauthenticated RCE memory-safety bugs (CVE-2026-109618/109619, dubbed php2shell) in the request lifecycle, reachable on mod_php via a crafted multipart POST before application code runs."
url: "https://swe.quest/articles/php2shell-patching-php-is-easy-finding-it-is-the-hard-part-9a45e6f935b2d2f4"
canonical: "https://sourcegraph.com/blog/php2shell-patching-php-is-easy-finding-it-is-the-hard-part"
source: "Sourcegraph"
published: "2026-10-21"
difficulty: "medium"
kind: "How-to"
reading_minutes: 5
tags: ["php","vulnerability-research","supply-chain-security","incident-response","memory-safety"]
---

# php2shell: patching PHP is easy, finding it is the hard part

A post on [Sourcegraph](https://swe.quest/sources/sourcegraph.md), published 2026-10-21, 5 min read, How-to. Original: [https://sourcegraph.com/blog/php2shell-patching-php-is-easy-finding-it-is-the-hard-part](https://sourcegraph.com/blog/php2shell-patching-php-is-easy-finding-it-is-the-hard-part)

## Summary

PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35 fix two unauthenticated RCE memory-safety bugs (CVE-2026-109618/109619, dubbed php2shell) in the request lifecycle, reachable on mod\_php via a crafted multipart POST before application code runs. PHP 8.1 and older get no fix. The hard part is inventorying every PHP runtime across Dockerfiles, OS package installs, Helm charts, CI workflows and Composer pins, and concrete regex searches are given for each. Remediation order: patch internet-facing mod\_php first, restart workers, rotate credentials the web user can read, preserve forensics, rebuild images, and isolate EOL hosts. The rest is a pitch for Sourcegraph Deep Search and Agentic Batch Changes to automate the inventory and version bumps.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [PHP](https://swe.quest/tags/php.md) (Languages)
- [Vulnerability research](https://swe.quest/tags/vulnerability-research.md) (Security)
- [Supply chain security](https://swe.quest/tags/supply-chain-security.md) (Security)
- [Incidents & postmortems](https://swe.quest/tags/incident-response.md) (Reliability & operations)
- [Memory safety](https://swe.quest/tags/memory-safety.md) (Security)

## Prerequisites

- PHP deployment models (mod\_php, FPM) ([easy posts on PHP](https://swe.quest/tags/php.md?difficulty=easy))
- Docker base images ([easy posts on Containers](https://swe.quest/tags/containers.md?difficulty=easy))
- Kubernetes/Helm manifests ([easy posts on Kubernetes](https://swe.quest/tags/kubernetes.md?difficulty=easy))

## Keywords

php2shell, CVE-2026-109618, CVE-2026-109619, PHP, mod\_php, Sourcegraph Deep Search, Agentic Batch Changes

## Related posts

- [How Cloudflare WAF helps protect against phpAfterShell and other critical PHP flaws](https://swe.quest/articles/how-cloudflare-waf-helps-protect-against-phpaftershell-and-other-critical-php-3843ce810931b50e.md): Cloudflare · 2026-11-20 · Medium · 9 min read · PHP, Application security, Vulnerability research, Security
  phpAfterShell (CVE-2026-126714, CVSS 9.2) lets an interrupted write in PHP's default file-based session handler leave a mixed session file.
- [The WordPress Chain Massacre](https://swe.quest/articles/the-wordpress-chain-massacre-f4c4d6206cb6b273.md): Calif · 2026-08-05 · Hard · 8 min read · Vulnerability research, Memory safety, PHP, Linux
  wp2root extends AssetNote's wp2shell pre-auth WordPress RCE from constrained PHP execution to native code execution and Linux root.
- [Coding Agent Horror Stories: The CVE That Did Not Exist](https://swe.quest/articles/coding-agent-horror-stories-the-cve-that-did-not-exist-6a97fa18ca5ac54f.md): Docker · 2026-10-29 · Medium · 15 min read · AI agents, Sandboxing & isolation, AI for coding, Code review, CI/CD
  A self-hosted, read-only AI code review bot running on Ollama answered a routine PostgreSQL 16.11→16.13 patch bump with a 1,500-word report alleging an "architectural takeover".
- [Ruby2Shell (CVE-2026-132825): find vulnerable Ruby across your repos](https://swe.quest/articles/ruby2shell-cve-2026-132825-find-vulnerable-ruby-across-your-repos-943808a4d97a4f48.md): Sourcegraph · 2026-11-20 · Medium · 5 min read · Ruby, Vulnerability research, Supply chain security, Developer tools
  Ruby2Shell (CVE-2026-132825) is a critical heap overflow in Ruby's string case conversion that researchers say default Rails and classic Sinatra apps expose without authentication, with remote code execution proofs of concept known.
- [Well, That Wasn't Fun: October 16 '26](https://swe.quest/articles/well-that-wasn-t-fun-october-16-26-83d1120fe160ef39.md): Fly.io · 2026-11-06 · Medium · 7 min read · Incidents & postmortems, Vulnerability research, Linux, Virtualization, Networking
  A Linux kernel bug in IPv4 checksum offload validation let a guest VM direct the host to write its computed checksum into an already-trusted IPv4 header field.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
