πŸ“ˆ GH Trending Explorer 🎲 Surprise me

← all repos

ikow / php2shell-poc

git clone https://github.com/ikow/php2shell-poc.git

CVE-2026-109618/109619 β€” 5 RCE chains + detection rules (Suricata, Sigma, ModSecurity). PHP session.upload_progress pre-auth exploit research.

+394
stars, 24h Β· #73
+1.6k
stars, 7 days Β· #123
+1.6k
stars, 30 days Β· #522
1.6k
β˜… total Β· +1585% this week
557
forks Β· 2 open issues

Star history (as recorded here)

2026-10-22 Β· 1,191 β˜… 2026-10-23 Β· 1,585 β˜…
LanguagePython
LicenseMIT
Created2026-10-21 (2d ago)
Last pushtoday
Watchers7
OwnerUser

GitHub topics

Links

README excerpt
php2shell 
 CVE-2026-109618 & CVE-2026-109619 β€” PHP Pre-Auth RCE Exploit & Detection Toolkit 
 Exploits Β· Detection Β· Lab Β· Writeup 
---
Five independent RCE chains exploiting PHP's `session.upload_progress` and the Zend engine's OOM bailout. **14 years of vulnerable code** β€” PHP 5.4.0 (2012) through 8.5.11. Pre-auth. No application vulnerability required for some chains.
Impacts **78% of all websites** β€” including WordPress (43%), Joomla, Drupal, Laravel, Magento, and every default PHP installation.
**Author:** Qi Deng Β |Β  **Writeup:** Substack Β |Β  **Date:** 2026-10-21
## CVE Details
| CVE | GHSA | CVSS | Description |
|-----|------|------|-------------|
| CVE-2026-109618 | GHSA-w8hw-w9fx-j79w | 9.2 | OOM β†’ `longjmp()` leaves Zend engine state invalid β†’ RCE |
| CVE-2026-109619 | GHSA-6wmf-4rv5-p3rp | 9.2 | Stale global state across FPM worker requests β†’ UAF β†’ RCE |
**Patch:** Commit 3584a98 β€” 300 files changed across the Zend engine.
## Attack Chains
| Chain | Vector | Pre-auth | Conditions | SAPI |
|-------|--------|:--------:|------------|------|
| **A** | Session injection + LFI | Yes | App has any LFI sink | All |
| **B** | var_destroy UAF β†’ handler overwrite | No | App calls `unserialize()` | All |
| **C** | Handler mismatch β†’ `__destruct` | Yes | Two dirs with different serialize_handler | FPM |
| **D** | OOM corruption β†’ stale `EG()` | Yes | **None** β€” any endpoint | mod_php |
| **E** | FPM session OOM β†’ stale `BG()` | Yes | Producer: any `session_start()` endpoint; Consumer: **any** endpoint | FPM |
Chain D is the most critical: **zero-dependency pre-auth RCE** against any Apache mod_php installation.
Chain E is nearly as broad on FPM: the producer needs any endpoint that calls `session_start()` (near-universal β€” WordPress, Laravel, Joomla, Drupal all do), and the **consumer can be any PHP endpoint** β€” the `rfc1867` upload_progress handler runs during SAPI startup before application code. Verified: `nosession.php` (no `session_start()` in code) triggers 502 crash when consuming stale `BG(unserialize)` state.
## Exploits
Three RCE exploits (Chains A, B, C) are included in `exploit/`:
| File | Chain | What It Does |
|------|-------|-------------|
| `chain_a_session_lfi.py` | A | Injects PHP code via upload filename β†’ LFI includes session file β†’ RCE |
| `chain_b_uaf_rce.php` | B | var_destroy UAF β†’ discovers `zif_system` via EG() β†’ overwrites `var_dump` handler via `/proc/self/mem` β†’ RCE |
| `chain_c_mismatch_rce.py` | C | Pollutes FPM worker `PS(serializer)` β†’ injects serialized object via filename β†’ `__destruct` fires on decode failure β†’ RCE |
Chains D and E exploits are available to paid subscribers.
 [code] 
## Detection Rules
Pre-built IDS / WAF / SIEM rules in `detection/`:
| File | Format | Signatures |
|------|--------|-----------|
| `php2shell.rules` | Suricata / Snort | 13 rules β€” request, response, and recon |
| `php2shell.yaml` | Sigma | 5 rules β€” web logs, process creation, file events |
| `modsecurity.conf` | ModSecurity v2/v3