CVE-2026-129291: PHP-FPM epoll use-after-free can lead to local privilege escalation
PHP-FPM contains a use-after-free in its epoll event handling when catch_workers_output is enabled. A local attacker who can execute PHP code in an FPM worker may crash the master process or execute code with its privileges, commonly root. Affected versions include PHP 8.2.7 through 8.2.35, 8.3. before 8.3.37, 8.4. before 8.4.28, and 8.5. before 8.5.13.
Overview
CVE-2026-129291 is a use-after-free vulnerability in PHP-FPM when the epoll event backend is used and catch_workers_output is enabled. In this configuration, the FPM master can close a worker's output pipe in fpm_child_close() without removing the associated epoll event. Delayed cleanup can then free the worker record while its epoll registration is still active, and a later event is dispatched through a pointer into freed memory.
A local attacker who can execute PHP code in an FPM worker can exploit this to crash the FPM master or execute arbitrary code with the master's privileges, which is commonly root.
catch_workers_output is disabled by default, but it is enabled in the official PHP-FPM Docker images.
Affected versions
- PHP 8.2.7 through 8.2.35 (fixed in 8.2.36) - PHP 8.3. before 8.3.37 - PHP 8.4. before 8.4.28 - PHP 8.5. before 8.5.13
Sources
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-129291 - PHP security advisory: https://github.com/php/php-src/security/advisories/GHSA-jm4m-qfqx-967m
What to do
1. Identify the PHP version running in your FPM environments, including containers and Docker images. Check with php -v or the image tag. 2. Upgrade PHP-FPM to a fixed release: 8.2.36, 8.3.37, 8.4.28, 8.5.13, or a later patched version. If you use the official PHP-FPM Docker images, update to an image containing one of these fixed versions. 3. If you cannot patch immediately, review your FPM pool configuration and ensure catch_workers_output is disabled unless it is explicitly required. Verify the vendor advisory before changing production configuration. 4. Review the NVD entry and the linked PHP security advisory for any additional mitigations or configuration guidance. 5. Test the upgrade in a staging environment first, then roll out to production. Restrict the ability to execute PHP code in FPM workers to trusted users to reduce local attack surface.