Skip to content
Exploit for Improperly Controlled Sequential Memory Allocation in Php

Exploit for Improperly Controlled Sequential Memory Allocation in Php

Sploitus • November 15, 2026

PHP2Shell Scanner is a **multi-method passive vulnerability detection engine** for identifying PHP environments potentially affected by two critical October 2026 Use-After-Free vulnerabilities:

| **CVE-2026-109618** | Upload-progress unserializer UAF — OOM handler fires mid-serialization, zval refcount drops to 0, dangling pointer survives to worker request | 8.5.12 · 8.4.27 · 8.3.36 · 8.2.35 |

| **CVE-2026-109619** | `EG(last_fatal_error_backtrace)` retained after request heap destruction; dangling pointer + OPcache `map_ptr` type confusion in persistent workers | 8.5.12 · 8.4.27 · 8.3.36 · 8.2.35 |

Both CVEs were confirmed exploitable by Trail of Bits against PHP 8.2–8.5 running under **FPM, mod_php, LiteSpeed, and FrankenPHP** (persistent-worker architectures that maximise UAF exploitability).

> **This tool performs passive reconnaissance only.** It never sends malformed payloads, triggers memory errors, uploads files, or causes any service disruption.

The scanner runs up to five independent detection methods and merges their results through a confidence-weighted engine:

| 1 | **HTTP Header Fingerprinting** | MEDIUM | `X-Powered-By`, `Server`, `X-Generator`, `Via`, `X-PHP-Version` |

| 2 | **HTML / App Fingerprinting** | LOW | PHPSESSID cookie, PHP error pages, HTML version strings, CMS detection |

| 3 | **phpinfo Endpoint Detection** | HIGH | Checks 13 common paths; extracts version, Server API, `memory_limit`, `fatal_error_backtraces` |

| 4 | **Local PHP Runtime Detection** | CONFIRMED | `php --version`, package manager (apt/dpkg/rpm/brew), Windows path scan |

| 5 | **Runtime Architecture Identification** | Additive | FPM, mod_php, CGI, LiteSpeed, FrankenPHP — determines persistent-worker risk tier |

CRITICAL = AFFECTED version + HIGH/CONFIRMED confidence + persistent-worker architecture

HIGH = AFFECTED version + MEDIUM/HIGH confidence + any/unknown architecture

MEDIUM = AFFECTED version + LOW confidence (header/cookie only)

LOW = VENDOR_CHECK (PHP 8.1/8.0/7.4) or LEGACY_EOL (≤ 7.3)

NOT_VULNERABLE = version ≥ fixed release for that branch

UNKNOWN = PHP not detected, or version not determinable

**Version comparison** uses `packaging.version.Version` exclusively — never string comparison. `"8.3.9" phpinfo > header > html)

- End-to-end classification pipeline (CRITICAL → UNKNOWN)

├── php2shell.py # CLI entry point

│ └── vulnerability_db.json # CVE metadata, PHP branch data

│ ├── version_check.py # Semantic version comparison (packaging.version)

│ ├── http_client.py # Hardened GET-only requests.Session

│ ├── confidence.py # Confidence tier engine + signal weights

│ ├── fingerprint.py # Multi-source fingerprint aggregator

│ ├── vulnerability_engine.py # CRITICAL/HIGH/MEDIUM/LOW classification

│ └── scanner.py # Concurrent scan orchestrator

│ ├── header_detector.py # HTTP response header analysis

│ ├── html_detector.py # HTML body + cookie analysis

│ ├── phpinfo_detector.py # phpinfo endpoint probing

│ └── local_detector.py # Local PHP binary / package manager

│ └── html_report.py # Self-contained VAPT HTML report

## Known Limitations and Assessment Caveats

1. **Passive detection only.** The scanner reads headers and probes phpinfo endpoints. It cannot confirm in-memory conditions (heap layout, refcount values, OPcache state) that determine whether a UAF is actually exploitable on a specific request.

2. **Header suppression.** Many production environments suppress or spoof `X-Powered-By` and `Server` headers. A `NOT_VULNERABLE` or `UNKNOWN` result does not rule out a vulnerable PHP installation.

3. **Reverse proxy / CDN masking.** PHP version headers may reflect the CDN edge, not the origin server. Corroborate with phpinfo probing or local detection when possible.

4. **Vendor backport ambiguity.** PHP 8.1, 8.0, and 7.4 have no numbered upstream fix release. Distro vendors (Debian, Ubuntu, RHEL, etc.) may have applied source backports. The scanner reports `VENDOR_CHECK` (LOW severity) for these branches; always verify with `apt-cache policy php*` or `rpm -q php`.

5. **phpinfo exposure is itself a finding.** A publicly accessible phpinfo page at any of the 13 probed paths represents an information disclosure vulnerability regardless of PHP version. Restrict access or remove these files.

6. **CVE-2026-109619 mitigation (`fatal_error_backtraces=0`)** is only available in PHP 8.5. The scanner reports whether this mitigation is detected via phpinfo; it does not verify php.ini on disk.

This tool is designed for **authorized security assessments only**. Use it only on systems you own or have explicit written permission to test. Unauthorized scanning may violate the Computer Fraud and Abuse Act (CFAA), the Computer Misuse Act, or equivalent laws in your jurisdiction.

- [PHP Security Advisory — October 2026](

- [CISA Known Exploited Vulnerabilities Catalog](

- [Trail of Bits PHP UAF Research](

- [NVD CVE-2026-109618](

- [NVD CVE-2026-109619](

Extracted Entities

Companies (1)

CWE Weaknesses (1)

Platforms (2)

Tools (1)