Critical Severity CVE-2026-109618
Published: Nov 19, 2026

[GitHub] php2shell-poc

Rce
Type
N/A
CVSS Score
6
Views
Anonymous
Author

Description

Unauthenticated PHP 8.4.26 RCE (CVE-2026-109618/109619)

# php2shell — PHP 8.4.26 Session Vulnerability Reproduction

[中文](#中文) | [English](#english)

---

## English

Under the constraints of "fully remote, HTTP only, target page has no `session_start()`, write no PHP on target side," use **a single `exploit.py`** to achieve RCE on PHP 8.4.26 + Apache prefork + mod_php. The target page contains only `<?php echo "OK\n"; ?>`.

### Supported Scope (Read First)

> **The only supported runtime environment is the official `php:8.4.26-apache` image** (PHP 8.4.26 / Debian 12 / Apache prefork + mod_php) with configuration from [docker/](docker/) in this repository.

This is not a universal ASLR bypass, nor does it disable ASLR:

- The exploitation process leaks only **Zend MM chunk base** and **libphp base** via two out-of-bounds reads; it does not leak libc, stack, or complete memory maps.
- The address space remains randomized by ASLR. Host kernel ASLR (kASLR), container runtime, kernel `mmap` behavior, allocators, and the specific build of PHP/Apache all affect heap layout and leak results.
- Heap geometry, calibration values, and libphp offsets in the chain are measured against the official image and do not include address scanning or brute-force enumeration. After changing images, PHP builds, or distributions, even if addresses can still be leaked, the subsequent forged object layout may not hold.

There are also hard requirements on the Apache side:

- Must be **prefork MPM + single worker + mod_php**. After a child process aborts, the parent process directly `fork`s a new worker without re-`exec`, preserving libphp mappings and address spaces required at each stage.
- `docker/apache.conf` fixes `StartServers/MinSpareServers/MaxSpareServers/MaxRequestWorkers/ServerLimit = 1`, `MaxConnectionsPerChild = 0`, and disables KeepAlive.
- Multiple workers, event/worker MPM, Apache restart/graceful restart, worker re-`exec`, container rebuild, or parent process exit may re-randomize addresses or route requests to different processes, breaking the entire chain.
- If any stage leak fails, ASLR remains effective; retrying only switches to a different worker and does not "defeat" ASLR.

The current RCE also requires: `display_errors=1`, `memory_limit=8M`, `max_input_vars=1000`, `session.use_cookies=1`, `session.use_strict_mode=0`, `session.upload_progress.enabled=1`.

### One-Command Reproduction

This repository does not compile PHP/Apache or use `docker build`: the environment is the official `php:8.4.26-apache` image plus mounted configuration from `docker/`.

```bash
# Dependencies: Docker Engine/Desktop + Docker Compose v2 + Python 3.9+
git clone https://github.com/9bie/php2shell-bypass-aslr-exp.git
cd php2shell-bypass-aslr-exp

# 1) Pull official image (PHP 8.4.26 / Debian 12 / Apache prefork)
docker compose -f docker/docker-compose.yml pull

# 2) Start target: single worker, display_errors=On, memory_limit=8M
docker compose -f docker/docker-compose.yml up -d

# 3) Wait for Apache readiness and verify normal page
for i in $(seq 1 20); do
curl -fsS http://127.0.0.1:8088/index.php >/dev/null 2>&1 && break
sleep 0.5
done
curl -s http://127.0.0.1:8088/index.php # OK

# 4) Complete exploitation in one command; first run auto-reads libphp offset
python3 exploit.py -u http://127.0.0.1:8088

Translated to English from Chinese. Show original · see the source links.
Community Rating
0

Login to rate this exploit

Quick Actions