Repository navigation
Status on 19 November: PHP released 8.5.13, 8.4.28, 8.3.37 and 8.2.36 today. Of its seven critical advisories, six can be closed from outside the engine, and 3.3.0 and 3.3.1 do, on every PHP of the affected branches; the seventh, CVE-2026-115560, has been covered since the first version. The release also fixes the SimpleXML double free and CVE-2026-115560; the
unserialize()use-after-free (php-src#24481) is still not in a release. Keep the module installed, also after you upgrade PHP.
A PHP extension that mitigates php2shell (CVE-2026-109618 / CVE-2026-109619) on PHP 5.4 to 8.5, for Linux (x86_64, arm64) and Windows (x64, x86), without rebuilding PHP. On PHP builds without the official fix it mirrors that fix component by component; on builds that have it, those layers step aside. Install the official PHP release where you can. This module protects the hosts that cannot be upgraded yet, and adds protections PHP itself does not ship yet.
What it protects against
- php2shell (CVE-2026-109618 / -109619): hardened multipart parser with a memory-headroom guard, immediate worker exit on an out-of-memory during request startup, request-state reset at request end, and the session upload-progress handler detached.
- CVE-2026-126714 (19 November, critical): session files truncated before every write. Since 3.3.1.
- CVE-2026-129289, CVE-2026-129496, CVE-2026-129481, CVE-2026-129182, CVE-2026-129474 (19 November, critical): see below. Since 3.3.0.
- CVE-2026-115560, session upload progress (advisory):
session.upload_progress.enabledforced to0and locked, on every PHP version, patched or not. Fixed in the 19 November releases. unserialize()use-after-free (php-src#24481, fixed in PHP's source on 30 October, still not in a release), and the further routes to the same bug PHP has found since (php-src#24674: destructors run by the garbage collector, error handlers,__toString(),session_decode(), fibers; the fix is still under review and aimed at the next major PHP version): nestedunserialize()/session_decode()calls get their own state. Since 3.2.0, per fiber since 3.2.6.- SimpleXML double free in the garbage collector, introduced by 8.4.27 and 8.5.12 (php-src#24488, fixed in 8.4.28 and 8.5.13): PHP's fix applied from inside the module, on 8.4.27 and 8.5.12 only. Since 3.2.1.
What's new in 3.3.1
CVE-2026-126714, partially overwritten session files (all versions; GHSA-fm2m-fjf5-v3cp), the last critical advisory of PHP's 19 November release. PHP's default files session handler truncated a session file before writing only when the new data was shorter; an interrupted longer write left the new data followed by the tail of the old session, which can unserialize into attacker-chosen objects. The fix truncates before every write, and so does the module now: it gives the handler a copy of the files module whose write makes PHP's own check always truncate. Redis, Memcached and user handlers are untouched; SessionHandler subclasses are covered. The handler's private struct is mirrored for its three layouts (the same in every release of 5.4–5.6, 7.0–8.1 and 8.2–8.5), and a worker only uses it after matching it against a real session file. hp_uploadprogress_guard.session_files_truncate = 0 switches it off.
Tested on 8.5, 8.4, 8.1, 7.4, 7.0 and 5.6: a 200 KB session overwritten with 300 KB, the write stopped at 100 KB, left 102,388 bytes of new data followed by 97,612 bytes of the old session without the module, and only the new data with it (also through a SessionHandler subclass). Shrinking and growing sessions, session_regenerate_id(), read_and_close, lazy write and SessionHandler subclasses behave identically with and without the module; 40 parallel PHP-FPM requests on one session keep an exact counter; PHP's session, serialize, SPL and fiber suites give the same results as 3.3.0 on 8.3 and 8.5.
What's new in 3.3.0
Five critical advisories of PHP's 19 November security release, closed by the module. Upgrade recommended on every PHP version, urgently where nginx runs with fastcgi_keep_conn on or Apache with enablereuse=on.
-
CVE-2026-129289, FastCGI request smuggling (5.6 to 8.5; GHSA-qc49-hpvq-g2w6). When an application opens
php://inputwithout reading it to the end, PHP skips draining the rest of the body; on a kept FastCGI connection PHP-FPM then runs the rest of the body as a new request, with the attacker's ownSCRIPT_FILENAME,REMOTE_ADDRandPHP_ADMIN_VALUE. No memory corruption needed. The module now drains the unread body before the SAPI finishes the request, as the fix does. -
CVE-2026-129496, timezone cache use-after-free (all versions; GHSA-gr4f-wgx5-jpfv). A warning written to a PHP error log file during startup leaves ext/date's timezone cache pointing into freed memory; the first warning of a worker's first request uses it. The module clears that pointer at the end of startup and of every request.
-
CVE-2026-129481, interrupted session shutdown (8.3, 8.4, 8.5; GHSA-g3vh-838c-65v7). A fatal error in a callback that runs while the session shuts down leaves ext/session pointing at a script filename in freed memory; a later request on the same worker frees it again. The module now clears that pointer at the end of every request, as the fixed release does at the next session start.
-
CVE-2026-129182, fatal-error backtrace after shutdown (8.5; GHSA-2fjv-p558-g82m). A fatal error while PHP restores INI settings after the request saves a backtrace that outlives the request's memory. The module now clears it at the end of every request on every 8.5, also on 8.5.12.
-
CVE-2026-129474,
__call()/__callStatic()backtraces (8.5 before 8.5.13; remote code execution demonstrated; GHSA-8mjj-2r7p-4hg2). The bug is inside the engine, so the module applies the advisory's own workaround:fatal_error_backtracesforced to0and locked. Fatal errors are still reported, without the stack trace 8.5 added to them.hp_uploadprogress_guard.disable_fatal_backtraces = 0keeps them. -
The SimpleXML workaround now applies to 8.4.27 and 8.5.12 only.
Not covered, because a module cannot reach the code or the fix needs PHP's own internals: CVE-2026-129291 (PHP-FPM master, only with catch_workers_output = yes), CVE-2026-128064 (mixed-case HTTPS:// / FTPS://), CVE-2026-127960 (folded HTTP response headers), CVE-2026-128090 (PHAR signatures), CVE-2026-129506 and CVE-2026-15353 (SOAP), CVE-2026-129501 (DOM), CVE-2026-129538 (PHP-CGI), CVE-2026-129292 (PHP-FPM status page) and CVE-2026-129438 (8.5 URI). Each advisory lists its workaround.
Tested before release in the official PHP-FPM images: on 8.5.12, 8.4.26 and 7.4.33 a forged FastCGI request hidden after a partly read body ran without the module and does not run with it; on 8.5.12 and 8.4.26 a fresh worker started with a stale timezone cache pointer without the module and a clean one with it; with PHP's own reproducers for the other three, reading the worker's memory after the triggering request: on 8.5.12 and 8.4.26 the dangling session filename stays behind without the module and is NULL with it; on 8.5.12 the saved backtrace survives the request without the module and is cleared with it; on 8.5.12 the __callStatic() reproducer prints wrong arguments read from stale slots without the module, and builds no backtrace with it. PHP's serialize, session, SPL and fiber suites give the same results as with 3.2.7 on 8.3 and 8.5 (on 8.5 the three fatal_error_backtraces tests fail, as intended). Builds 5.4 to 8.5 for x86_64 and arm64 pass the glibc check; thread-safe 8.4 builds with -Wall -Werror; Apache mod_php serves forms, uploads and a keep-alive request after a partly read body normally.
Changes since 3.1.0
- 3.3.1: CVE-2026-126714 closed (session files truncated before every write).
- 3.3.0: CVE-2026-129289, CVE-2026-129496, CVE-2026-129481, CVE-2026-129182 and CVE-2026-129474 closed (above); SimpleXML workaround limited to 8.4.27 and 8.5.12.
- 3.2.7: cached memory released before the headroom guard decides (8.1+), ext/filter's copy emptied on a refusal,
session_start()/session_reset()isolated. - 3.2.6:
unserialize()state per fiber. - 3.2.5: parser fixes from @NewEraCracker (#25): per-thread stop flag on thread-safe PHP, stopped reads never processed, legacy parser hardening. Bundle refresh:
install_guard.shworks on hosts with anoexec/tmp(#28). - 3.2.4: phpinfo status fixes (#18, #19); upload-progress detach on patched PHP documented (#17).
- 3.2.3: on thread-safe PHP with a threaded SAPI (Apache
mod_phpwith mpm_winnt, worker or event, which includes every WindowstsDLL), the multipart handler is now installed in every thread. - 3.2.2: PHP 5.4 to 5.6 thread-safe builds compile (Linux ZTS, Windows TS).
- 3.2.1: SimpleXML double-free workaround for 8.4.27 and 8.5.12.
- 3.2.0:
unserialize()re-entrancy isolation. - New downloads: Windows DLLs for PHP 5.4 (VC9, x86) and 5.6 (VC11) and 32-bit DLLs for 7.2 to 8.5;
install_guard.shfor Debian / Ubuntu.
Download
hp_uploadprogress_guard-3.3.1.zip (or .tar.gz, same content) holds everything: an INSTALL.txt with the steps per platform, the installer for Debian / Ubuntu, the ini files, the source, and a SHA256SUMS for all of it.
| Folder | Contents | PHP |
|---|---|---|
linux/ |
hp_uploadprogress_guard-<X.Y>.so (x86_64, glibc 2.3+) and -aarch64.so (arm64, glibc 2.17+) |
5.4 to 8.5 |
windows/ |
php_hp_uploadprogress_guard-<X.Y>-<nts|ts>-<compiler>-<x64|x86>.dll |
5.4 (vc9, x86), 5.6 (vc11), 7.2 to 7.4 (vc15), 8.0 to 8.3 (vs16), 8.4 and 8.5 (vs17) |
ini/ |
ini for Debian / Ubuntu mods-available, and for cPanel / DirectAdmin php.d |
|
src/ |
source, for anything not prebuilt |
The Linux .so files are NTS builds, which is what php-fpm, CGI and almost every distribution and panel ship; thread-safe Linux builds compile from src/ in one step. The Windows DLL must match your PHP's version, thread safety, compiler and architecture: php -i shows all four.
Install
- Debian / Ubuntu (Sury / Ondrej packages):
tar xzf hp_uploadprogress_guard-3.3.1.tar.gz && sudo bash hp_uploadprogress_guard-3.3.1/install_guard.sh --reloadinstalls the module for every PHP version on the host, from the bundle, with no download. It reloads PHP-FPM and Apache only with--reload, and then checks that the running services really loaded it.--removeundoes everything. - cPanel EA4, DirectAdmin, other Linux, Windows: see Install in the README.
- Check through the web server: a
phpinfo()page shows thehp_uploadprogress_guardblock withversion => 3.3.1.php --rishows the command-line configuration, which is often not what the site runs with.
Upgrading from an earlier version: replace the file and reload PHP-FPM / Apache. No ini change is needed; the newer switches unserialize_isolation, simplexml_gc_fix, disable_fatal_backtraces and session_files_truncate default to on.