PHP-FPM local privilege escalation in epoll worker output handling
PHP Group PHP
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| PHP Group PHP |
| No fix yet |
Original description
PHP-FPM epoll use-after-free can lead to local privilege escalation.
When catch_workers_output is enabled and the epoll event backend is used, the PHP-FPM master can close a worker's output pipe in fpm_child_close() without removing the associated event, and the delayed cleanup can free the worker record while its epoll registration is still active. A later event is then dispatched through a pointer into freed memory. A local attacker who can execute PHP code in an FPM worker can crash the master or execute code with its privileges, commonly root. catch_workers_output is disabled by default but enabled in the official PHP-FPM Docker images.