Skip to main content

PHP-FPM epoll use-after-free can lead to local privilege escalation

Publication Date 2026-11-19
Severity High
Type Privilege Escalation
Affected PHP Versions
  • 7.2.0-7.2.34
  • 7.3.0-7.3.33
  • 7.4.0-7.4.33
  • 8.1.0-8.1.34
  • 8.2.0-8.2.35
  • 8.3.0-8.3.36
  • 8.4.0-8.4.27
  • 8.5.0-8.5.12
Fixed Product Versions
  • ZendPHP 7.2
  • ZendPHP 7.3
  • ZendPHP 7.4
  • ZendPHP 8.1
  • ZendPHP 8.2
  • ZendPHP 8.3
  • ZendPHP 8.4
  • ZendPHP 8.5
  • ZendServer 2021.4.10

CVE Details

PHP-FPM contains a use-after-free vulnerability in its worker output capture mechanism. When catch_workers_output is enabled, the FPM master monitors pipes connected to worker stdout and stderr via epoll. The vulnerability occurs when a worker exits and fpm_child_close() attempts to drain output pipes. If a helper process still holds a pipe's write end open, the read returns EAGAIN instead of EOF. The master then closes the pipe's read descriptor without removing its epoll event or invalidating the stored descriptor number, deferring cleanup for one second. An attacker can exploit this by stopping a newly forked sibling worker after it drops to the pool user but before closing inherited descriptors, keeping the original pipe readers and epoll descriptor alive. This causes the delayed cleanup to use a descriptor number that has been reused, resulting in a use-after-free condition.

There is no evidence of a public proof-of-concept or exploitation at this time.

Recommendations

Disable catch_workers_output in your PHP-FPM configuration if it is enabled. Update to a known patched version of PHP when possible.