Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
php2shell-CVE-2026-109619 — CVE-2026-109619 (PHP2Shell): Pre-Auth Remote Code Execution (RCE) via PHP-FPM Stale Global State Deserialization UAF. Reproducible Docker lab, interactive shell, reverse shell & WAF/IDS rules. | Kitploit
Tools/GitHubGitHub/dev-maple/php2shell-cve-2026-109619
Static Code Analysis (SAST)Vulnerability AnalysisExploitationReverse EngineeringWeb Application ExploitationWAF BypassPenetration TestingIntrusion Detection
Share
Payload Development
Labs & Practice
GitHubdev-maple/php2shell-cve-2026-109619

php2shell-CVE-2026-109619

CVE-2026-109619 (PHP2Shell): Pre-Auth Remote Code Execution (RCE) via PHP-FPM Stale Global State Deserialization UAF. Reproducible Docker lab, interactive shell, reverse shell & WAF/IDS rules.

View Repository
2127 days agoNot yet reviewed

CVE-2026-109619: PHP2Shell — Security Research Lab & PoC

CVE-2026-109619 CVSS 9.2 RCE Verified Affected Platforms MIT License

A comprehensive research lab and exploit reproduction toolkit for CVE-2026-109619 (also known as PHP2Shell), a critical vulnerability in PHP's deserialization subsystem affecting persistent worker architectures (such as PHP-FPM), enabling pre-auth cross-request use-after-free and arbitrary remote code execution under the privileges of the web process.

CVE-2026-109619 Exploit Demonstration


1. Technical Analysis (Root Cause Analysis)

Vulnerability Overview

  • Component: PHP Deserialization Subsystem (ext/standard/var_unserializer.re)
  • Affected Versions: PHP 8.2.0–8.2.34, 8.3.0–8.3.35, 8.4.0–8.4.26, 8.5.0–8.5.11
  • Vulnerability Class: CWE-672: Operation on Resource After Expiration or Release / CWE-416: Use After Free
  • CVSS Score: 9.2 (CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N)

Defect Mechanics

  1. Unchecked Bailout in Deserialization: During deserialization, php_var_unserialize_init() initializes reference tracking structures and destruction chains in BG(unserialize).data, incrementing BG(unserialize).level = 1. If an in-script fatal error or memory exhaustion occurs (e.g. inside __wakeup() or class constructor), PHP executes zend_bailout(). Ordinary request cleanup routines (php_var_unserialize_destroy()) are skipped, leaving dirty global pointers and unzeroed reference counters in the worker's memory space.

  2. Persistent Worker Survival (PHP-FPM): In persistent multi-request architectures like PHP-FPM (pm = static or dynamic), child worker processes survive in-script fatal errors across HTTP requests without terminating. When a subsequent HTTP request arrives at the same worker process, it inherits the dirty BG(unserialize) parser state from the preceding aborted request.

  3. Cross-Request Reference Poisoning & Memory Corruption: When the surviving worker enters unserialize() again, it detects BG(unserialize).level > 0 and mistakes the new payload for a nested call within an already-active deserialization session.

    • By supplying cross-request references (R:1), the deserializer resolves pointers into previously freed memory.
    • By reclaiming the dangling 4096-byte first_dtor structure in Zend MM through controlled POST allocations, the attacker constructs a fake HashTable whose pDestructor points directly to zif_system.
    • Upon destruction, arbitrary shell commands are executed with www-data privileges.

2. Repository Layout

├── lab/
│   ├── nginx-fpm/           # Vulnerable Nginx 1.27 + PHP-FPM 8.4.26 environment
│   │   ├── nginx.conf       # FastCGI reverse proxy configuration
│   │   ├── php.ini          # PHP runtime configuration (memory_limit = 8M)
│   │   ├── fpm-pool.conf    # PHP-FPM static pool configuration (1 worker)
│   │   ├── lab.sh           # Container management script (up, down, status, logs)
│   │   ├── test_behavior.py # Diagnostic script verifying worker survival
│   │   └── webroot/         # Target web application endpoints
│   │       ├── cve_109619_poc.php   # Two-stage exploitation endpoint
│   │       ├── cve_109619_demo.php  # Diagnostic demonstration
│   │       └── index.php            # Worker status and PID baseline
│   ├── docker-compose.yml   # Multi-container lab orchestration
│   ├── run_lab.sh           # Lab startup script
│   └── stop_lab.sh          # Lab teardown script
├── poc/
│   ├── poc.py               # Full-featured network PoC (arbitrary RCE, interactive shell, reverse shell)
│   ├── universal.py         # Universal pre-RINIT exploit engine targeting session.upload_progress
│   ├── discover.py          # Dynamic endpoint crawler and parameter discovery engine
│   ├── scan.py              # Non-destructive passive vulnerability assessment scanner
│   ├── poc_raw.py           # Low-level Zend MM memory corruption exploit (zif_system)
│   ├── revshell.py          # Standalone reverse TCP shell handler
│   ├── profiles.json        # Affected version catalog and fix matrix
│   └── ui.py                # Terminal output and status helpers
├── rules/
│   ├── suricata.rules       # Suricata / Snort network IDS detection signatures
│   ├── modsecurity.conf     # ModSecurity / OWASP CRS perimeter WAF rules
│   └── semgrep.yml          # Semgrep SAST rule for unsafe unserialize calls
├── assets/
│   ├── showcase.gif         # Terminal demonstration GIF
│   └── showcase.webm        # High-definition screencast
├── docs/
│   ├── analysis.md          # In-depth technical root cause analysis
│   └── licensing.md         # License details
├── test_all.sh              # Automated verification suite for all lab services
├── php2shell.py             # Root CLI entrypoint
├── Makefile                 # Automation recipes
└── README.md                # Research report and documentation

3. Lab Setup

Docker is required to run the local lab environment.

# Start lab containers (Nginx 1.27 + PHP-FPM 8.4.26)
./lab/run_lab.sh
# or: make lab-up

Once running, the following endpoints are exposed:

  • Webroot Oracle: http://127.0.0.1:8180/index.php (SAPI & PID verification)
  • Target Vulnerable Endpoint: http://127.0.0.1:8180/cve_109619_poc.php
  • Diagnostic Endpoint: http://127.0.0.1:8180/cve_109619_demo.php

To shut down the lab:

./lab/stop_lab.sh
# or: make lab-down

To reset the lab with clean logs and fresh worker memory:

make lab-restart

4. Exploitation Scenarios

4.1. Scenario 1: Non-Destructive Vulnerability Assessment (scan.py)

Performs fingerprinting of PHP version, FastCGI SAPI, worker survival during in-script memory exhaustion, and cross-request state reuse without executing arbitrary commands.

python3 poc/scan.py -u http://127.0.0.1:8180/
# or: ./php2shell.py -u http://127.0.0.1:8180/ --check

Example Output:

target: http://127.0.0.1:8180
version: php 8.4.26 (vulnerable, php 8.4.26 < 8.4.27)
worker: pid 7
survival: ok (pid 7)
stale state: clean
verdict: vulnerable to cve-2026-109619

4.2. Scenario 2: Remote Code Execution (poc.py / php2shell.py)

Exploits the stale deserializer state across requests. Stage 1 triggers memory exhaustion inside __wakeup(), leaving BG(unserialize) dirty (level > 0) while the persistent PHP-FPM worker survives. Stage 2 supplies cross-request reference R:1 to resolve stale pointers in Zend MM.

[!NOTE] The exploit operates entirely at the PHP interpreter and Zend Engine layer without requiring application-level gadgets. For low-level memory corruption targeting native engine function pointers (zif_system), see poc/poc_raw.py and the pre-RINIT exploit engine in poc/universal.py.

The PoC accepts arbitrary targets (-u) and commands (-c):

Download Tool

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    891
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    810
  • 3

    wifit3

    derv82/wifit3

    Wifite but USB-only & cross-platform.

    638
  • 4

    looking-glass

    anonghosty/looking-glass

    CSIRT platform that ingests Shadowserver reports into MongoDB and replays them as interactive maps, analysis, findings, advisories and executive dashboards.

    453
  • 5

    jumpserver

    jumpserver/jumpserver

    JumpServer is an open-source Privileged Access Management (PAM) platform that provides DevOps and IT teams with on-demand and secure access to SSH, RDP, Kubernetes, Database and RemoteApp endpoints through a web browser.

    436
  • 6

    SafeLine

    chaitin/safeline

    Self-hosted WAF and reverse proxy that filters malicious HTTP traffic, blocks SQL injection, XSS, and bot attacks, with rate limiting and dynamic HTML/JS encryption.

    386

Explore all tools

Browse our collection of tools

View all tools →