PHP2Shell, memory corruption in PHP leads to remote code execution
PHP2Shell is the name given to two PHP core bugs disclosed in October 2026: CVE-2026-109618 and its companion CVE-2026-109619. Both are memory-safety flaws in PHP itself (not in a specific application), and both were rated critical because they can be reached by an unauthenticated, remote attacker.
- CVSS
- 9.8 / 10
- Vector
- Remote
- Difficulty
- Hard
- Added
- 2026-10-26
About this target
PHP2Shell is the name given to two PHP core bugs disclosed in October 2026: CVE-2026-109618 and its companion CVE-2026-109619. Both are memory-safety flaws in PHP itself (not in a specific application), and both were rated critical because they can be reached by an unauthenticated, remote attacker. This lab installs PHP 8.4.26, the last 8.4 build before the fix, as an Apache `mod_php` module.
CVE-2026-109618 is described by the vendor as an out-of-memory handling issue: if PHP runs out of memory while request data is only partially set up, request cleanup can end up trusting that half-built data. Public reporting ties the observed exploitation attempts to the multipart upload-progress code path. CVE-2026-109619 is a related stale-state issue, where request-owned internal state can outlive the memory it pointed to and get reused by a later request handled by the same persistent worker.
This is a good lab target for practicing memory-corruption research against a real, unmodified web stack, for patch/version verification, and for log and WAF-signature review — rather than for an application-layer bug. A flag is dropped at the filesystem root; winning the lab means getting a shell and reading it.
Remote code execution bugs are the ones defenders care about most. This target is useful for testing detection rules and logging.
- Product
- php
- Version
- 8.4.26
- Type
- RCE
- Severity
- High
Before you start
This playbook needs the setup from the earlier steps. Check these first.
- The base VM from Step 01 is built and reachable over SSH.
- You cloned the playbooks repo and set
inventory/hosts.iniin Step 02. - A snapshot named
clean-baseexists, and the machine is booted from it.
One CVE at a time. Don't run this on top of another playbook. Reset first.
Run the playbook
Boot the machine from clean-base, then run the playbook for CVE-2026-109618. It installs php 8.4.26, sets up its config and starts the service.
ansible-playbook cve/cve-2026-109618.yml
A clean run ends with a recap that shows failed=0. If it fails partway, run it again.
Verify the target
The verify tag checks that the service is listening and running the version this CVE affects. Run it from the host.
ansible-playbook cve/cve-2026-109618.yml --tags verify
You should see target OK.
How it was fixed
The fixed versions are PHP 8.5.12, 8.4.27, 8.3.36 and 8.2.35. PHP 8.1 and older no longer receive supplier-provided patches.
Reset when you're done
Restore clean-base. Nothing from this playbook carries over.
VBoxManage controlvm thehackingmachine acpipowerbutton VBoxManage snapshot thehackingmachine restore clean-base VBoxManage startvm thehackingmachine
References
Credit
Playbook and write-up by TheHackingMachine Team.
Want to add your own? See how to contribute.