Skip to content
KitploitKITPLOIT
OutilsExploitsBlog
Log in
Soumettre
OutilsExploitsBlog
Soumettre

Outils de Hacking, PenTest et Cybersécurité pour votre Arsenal de Sécurité !

Kitploit est un répertoire d'outils de hacking, de cybersécurité et de pentesting. Découvrez les dernières mises à jour des projets pour trouver des vulnérabilités, analyser des systèmes, automatiser les tests et renforcer votre sécurité.

FluxContactConfidentialité© 2026 Kitploit

Répertoire d'outils

Catégories

Voir toutes les catégories
Loading categories
cve-2026-109619 — Working PoC and differential Docker Compose lab for CVE-2026-109619, a PHP stale session global-state bug enabling RCE via heap and ASLR leaks against vulnerable and patched builds. | Kitploit
Outils/GitHubGitHub/taz1920/cve-2026-109619
Container SecurityMemory ForensicsVulnerability AnalysisExploitationWeb Application ExploitationPayload DevelopmentBinary ExploitationLabs & Practice
GitHubtaz1920/cve-2026-109619

cve-2026-109619

Working PoC and differential Docker Compose lab for CVE-2026-109619, a PHP stale session global-state bug enabling RCE via heap and ASLR leaks against vulnerable and patched builds.

il y a 1 moisPas encore vérifié
Partager
Voir le dépôt
Contenu non disponible dans la langue demandée. Affichage de la version anglaise.

CVE-2026-109619 — PHP stale session global state → RCE

A working proof of concept for CVE-2026-109619 / GHSA-6wmf-4rv5-p3rp ("RCE via stale global state"), plus a differential Docker Compose lab:

ServiceImageResult
vulnPHP 8.4.26 + Apache prefork/mod_phpremote code execution as www-data
fixedPHP 8.4.27 (security release)no code execution
attackerPython 3.12runs the exploit against both and reports the differential

The vulnerable page is just <?php echo "OK\n"; ?>. It never calls session_start(): the bug is reached by PHP's session.upload_progress handler before request initialization.

Advisory: https://github.com/php/php-src/security/advisories/GHSA-6wmf-4rv5-p3rp Fixed in 8.2.35 / 8.3.36 / 8.4.27 / 8.5.12 (fix commit 31c0ea7d7f, "Avoid state corruption via bailout").


Quick start

cd cve-2026-109619
docker compose up --build --abort-on-container-exit --exit-code-from attacker

Expected tail of the output:

[+] Zend MM chunk base = 0x...
[+] libphp base = 0x...
[*] stage 3: HTDATA=0x... zif_system=0x...
[+] executed on attempt 1
PROOF: uid=33(www-data) gid=33(www-data) groups=33(www-data)

=== 2/2  PHP 8.4.27 (patched) ===
[-] heap leak failed

==============================================================
 RESULT: CONFIRMED
   PHP 8.4.26: code execution as the Apache worker
   PHP 8.4.27: no code execution (patched)
==============================================================

The command executed by the exploit is id>/out/p; the proof is written to the shared proof-vuln volume and read back by the attacker container. The patched target is attacked with the same chain and produces no proof.

Both targets are also exposed on the host: http://127.0.0.1:8088 (vulnerable) and http://127.0.0.1:8089 (patched).

Troubleshooting

  • cannot overwrite digest sha256:... — old Docker versions can trip over a locally tagged php:8.4.26-apache / php:8.4.27-apache image while composing a digest-pinned service. Remove the tags and retry:

    docker rmi php:8.4.26-apache php:8.4.27-apache
    docker compose up --build --abort-on-container-exit --exit-code-from attacker
    
  • exec format error on an arm64 host — the amd64 QEMU binfmt handler is not registered; see the section below.

Running on arm64 (Apple Silicon, WSL2 on ARM, ...)

The images are pinned to the official linux/amd64 build because the heap calibration and libphp.so offsets were measured there. On an arm64 host, register QEMU binfmt first:

docker run --privileged --rm tonistiigi/binfmt --install amd64
docker compose up --build --abort-on-container-exit --exit-code-from attacker

This PoC was developed and verified on an arm64 host with that emulation (4/4 successful differential runs).


The bug

PHP keeps a lot of worker-global state that points into the request heap. Normally each request resets it. Two things can go wrong:

  1. Producer. session.upload_progress makes PHP initialize the session from the multipart callback before RINIT (inside php_hash_environment()). If a memory_limit OOM bails out of php_session_initialize(), the request is torn down with PG(modules_activated) = 0, so the session RSHUTDOWN path is skipped. PS(http_session_vars) (a zend_reference*) is left pointing into the request heap. That heap is then freed.

  2. Consumer. The next request on the same worker parses its multipart body, allocating attacker-controlled field buffers, and only then reaches php_session_initialize() → php_session_track_init(). The stale PS(http_session_vars) is dereferenced and destroyed before normal request initialization has replaced it.

The OOM is only the interruption that abandons session initialization (the same bailout class is also fixed by the related OOM advisory GHSA-w8hw-w9fx-j79w). The vulnerability demonstrated here is the stale session state surviving into the next request and being consumed before normal initialization — CVE-2026-109619.

php_session_track_init() runs zval_ptr_dtor() on the stale reference:

php_session_initialize
  php_session_track_init
    zval_ptr_dtor(PS(http_session_vars))
      zend_reference_destroy(R0)
        zval_ptr_dtor(&ref->val)          # forged IS_ARRAY_EX
          zend_array_destroy(fake HashTable)
            zend_hash_destroy(fake HashTable)
              pDestructor(&bucket->val)   # -> zif_system()

The whole exploit is two kinds of ordinary multipart POSTs. The producer and consumer must hit the same worker (the lab uses one prefork worker). When a worker aborts, the prefork parent forks a replacement that inherits the same address-space layout, which keeps the heap/ASLR leak results valid across stages.

Reconciling with the official fix

The 8.4.27 patch (and the equivalents on 8.2/8.3/8.5) does several things relevant to this path:

  • replaces OOM longjmp() bailouts with delayed/hard OOM handling,
  • resets request globals at shutdown (PG(http_globals), last error, PG(modules_activated)),
  • early-resets session globals at MULTIPART_EVENT_START,
  • runs upload-progress decode in in_rfc1867_update mode with __PHP_Incomplete_Class-only decoding and no user callbacks,
  • removes $_SESSION before the target script runs.

On 8.4.27 the producer no longer publishes and keeps the dangling session reference, so the heap leak stops working and the chain cannot proceed.


Exploit stages

All three stages use the same stale-session primitive.

  1. Zend MM chunk base. The producer OOMs. The consumer reclaims the stale PS(id) with a 79-byte field whose zend_string length field is 0x1000; php_url_encode() then reads past the string and percent-encodes many request-heap pointers into Set-Cookie. The 2 MB-aligned mode is the Zend MM chunk base.

  2. libphp base. A 56-byte HashTable page is placed at the stale PS(id) so that the cookie data begins at nNextFreeElement | pDestructor. pDestructor is zval_ptr_dtor (libphp+0x65eb60); its address yields the libphp base.

  3. Control flow. A forged 55-byte reference is placed at R0-0x10 (reclaiming the stale zend_reference), and a live 167-byte zend_string (a normal multipart field, kept in $_POST) carries the forged HashTable. pDestructor is zif_system (libphp+0x465370); the forged zend_execute_data next to the bucket passes the command string to it. system() runs the command before the process aborts.

Relevant addresses are all chunk-relative or libphp-relative; ASLR is defeated by the two in-band leaks, not disabled.


Files

cve-2026-109619/
├── compose.yaml                 # vulnerable + patched + attacker
├── attacker/
│   ├── Dockerfile
│   ├── exploit.py               # exploit implementation (stdlib only)
│   └── run_demo.sh              # differential driver
└── target/
    ├── apache.conf              # single prefork worker, KeepAlive Off
    ├── php.ini                  # 8M memory_limit, display_errors On, upload progress On
    └── www/index.php            # <?php echo "OK\n"; ?>

Exploit prerequisites on the target

The lab configuration matches the known reachable case:

  • session.upload_progress.enabled=On, cleanup=On (defaults),
  • memory_limit small enough to OOM during upload-progress session init (8 MB in the lab),
  • display_errors=On for the in-band Set-Cookie leaks,
  • Apache prefork with a single worker (or at least a way to pin the producer and consumer to the same worker),
  • session.use_strict_mode=0, session.save_path writable.

Production exploitation is more constrained (the producer/consumer must be routed to the same worker, and the leaks require displayed errors); the advisory's point is that the underlying stale-state lifecycle is a critical memory-safety bug regardless.

Télécharger l’outil

Populaires

Voir tout →

Découvrez les outils les plus utilisés par notre communauté.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 La boîte à outils OSINT ultime : graphe d'enquête, notation de confiance, familles d'alias, carte, chronologie et rapports. 49 modules, plus de 400 sites, aucune clé API requise.

    897
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    # Application d'exécution en un clic GhostLock (CVE-2026-43499)

    830
  • 3

    wifit3

    derv82/wifit3

    Wifite mais uniquement USB et multiplateforme.

    661
  • 4

    looking-glass

    anonghosty/looking-glass

    Plateforme CSIRT qui ingère les rapports Shadowserver dans MongoDB et les rejoue sous forme de cartes interactives, d'analyses, de constats, d'avis et de tableaux de bord exécutifs.

    448
  • 5

    jumpserver

    jumpserver/jumpserver

    JumpServer est une plateforme open-source de Gestion des Accès Privilégiés (PAM) qui offre aux équipes DevOps et IT un accès sécurisé et à la demande aux terminaux SSH, RDP, Kubernetes, bases de données et RemoteApp via un navigateur web.

    444
  • 6

    SafeLine

    chaitin/safeline

    WAF auto-hébergé et proxy inverse qui filtre le trafic HTTP malveillant, bloque les injections SQL, les XSS et les attaques de robots, avec limitation de débit et chiffrement dynamique HTML/JS.

    396

Explorer tous les outils

Parcourez notre collection d'outils

Voir tous les outils →