Patching PHP comes first. After that, most PHP-FPM risk sits in a few pool settings: keep FPM on a Unix socket or localhost, give each site its own pool and user, leave FastCGI connection reuse and catch_workers_output off unless you need them, lock settings with php_admin_*, protect the status page, and restart after upgrades.
On this page
Why this checklist exists
PHP-FPM had a rough November. Three of the bugs fixed on 19 November live in FPM itself: request smuggling over reused connections, a local root escalation through worker output capture, and an XSS in the status page. Each one depended on a pool setting that many admins never look at.
None of the settings below replaces updating PHP. Get to 8.5.13, 8.4.28, 8.3.37 or 8.2.36 first (release details). Then work through this list once per server. Most items take a minute and they keep paying off when the next bug lands.
To see what FPM is actually running with, including defaults and every pool, dump the parsed config:
sudo php-fpm8.3 -tt 2>&1 | less
Use your binary name (php-fpm, php-fpm8.4, /opt/cpanel/ea-php83/root/usr/sbin/php-fpm and so on).
1. Keep PHP-FPM off the network
PHP-FPM speaks FastCGI, and FastCGI has no authentication. Anyone who can reach the port can ask FPM to run a script with whatever parameters they like. The listener should only be reachable by your web server.
On a single server, a Unix socket is the simplest answer:
listen = /run/php/php8.3-fpm-example.sock
listen.owner = www-data
listen.group = www-data
listen.mode = 0660
Set listen.owner and listen.group to the user your web server runs as, so only it can connect.
If FPM has to listen on TCP, bind it to localhost or a private address and allow only the web server:
listen = 127.0.0.1:9000
listen.allowed_clients = 127.0.0.1
listen.allowed_clients only applies to TCP listeners. Back it with a firewall rule if the web server is on another host.
Containers deserve a second look. The official Docker FPM images listen on port 9000, which is fine on a private container network and a problem the moment someone publishes that port. If a docker-compose.yml or Kubernetes Service exposes 9000 beyond the web container, remove it. Several write-ups of the November release repeat the same advice: never expose PHP-FPM listeners to untrusted networks.
2. One pool per site, each with its own user
A single www pool running every site as www-data means one compromised site can read every other site’s files and sessions. Give each site its own pool, its own Unix user and its own session directory:
[example]
user = example
group = example
listen = /run/php/php8.3-fpm-example.sock
php_admin_value[session.save_path] = /var/lib/php/sessions/example
Separate session directories matter more than they used to. CVE-2026-115560 needs two writers with different session serializers on the same store, and PHP’s advisory says that can happen across pools. Pools that don’t share a session directory can’t mix formats.
3. Leave FastCGI connection reuse off
By default nginx closes the connection to PHP-FPM after each response, and Apache’s mod_proxy_fcgi doesn’t reuse FastCGI connections unless told to. CVE-2026-129289 only works when that reuse is switched on: nginx fastcgi_keep_conn on, Apache enablereuse=on, HAProxy keep-conn or LSAPI.
Check both web servers:
sudo nginx -T 2>/dev/null | grep -n fastcgi_keep_conn
sudo grep -rniE 'enablereuse' /etc/apache2 /etc/httpd 2>/dev/null
Keep reuse off unless you’ve measured a real gain from it. If you do turn it on, do it on a patched PHP and write down why, so the next admin knows it’s deliberate.
4. Turn catch_workers_output off unless you need it
catch_workers_output = yes sends whatever workers print to stdout and stderr into the FPM log. It’s handy in containers, which is why the official Docker FPM images enable it. It was also a precondition for CVE-2026-129291, the local root escalation fixed in November.
FPM’s default is no. If you don’t read worker output, leave it there and point PHP’s error_log at a file or syslog instead. If you do rely on it, make sure PHP is patched.
5. Lock the settings applications mustn’t change
php_value in a pool sets a default that application code can override with ini_set(). php_admin_value and php_admin_flag set values that code can’t change, and that .user.ini files can’t override either. Use the admin form for anything security-related:
php_admin_flag[session.upload_progress.enabled] = off
php_admin_flag[display_errors] = off
php_admin_flag[log_errors] = on
php_admin_value[error_log] = /var/log/php/example-error.log
The first line is the PHP2Shell and CVE-2026-115560 stopgap that PHP recommended in October. PHP’s advisories stress that it has to be set before the request is processed, which is exactly what a pool-level admin flag does; ini_set() from the application is too late.
If you run PHP 8.5, add the backtrace settings from CVE-2026-129474 here too. For everything that belongs in php.ini itself, see the php.ini hardening checklist.
6. Protect the status and ping pages
pm.status_path and ping.path are useful for monitoring and should never be public. If you enable them, restrict them at the web server:
location = /fpm-status {
allow 127.0.0.1;
deny all;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass unix:/run/php/php8.3-fpm-example.sock;
}
That’s not the whole story this year. CVE-2026-129292 let anyone who could send requests to a pool plant HTML in the status data, which then ran in the browser of an operator viewing the full HTML status page. PHP’s advisory says restricting access to the page doesn’t stop the planting. On an unpatched PHP, have monitoring read the plain or JSON output (?json) rather than opening ?full&html in a browser, or switch the status page off until you’ve upgraded.
7. Only let FPM execute .php files
security.limit_extensions limits which file extensions FPM will run as the main script. Set it explicitly:
security.limit_extensions = .php
Pair it with a web server rule that only passes files that exist. In nginx, try_files $uri =404; inside the PHP location stops requests for a non-existent .php path (or an uploaded image with a .php suffix bolted on) from reaching FPM at all.
8. Put limits on time and on worker lifetime
request_terminate_timeout kills a worker stuck on one request for too long. It’s a blunt tool, but it stops a slow upstream or a hostile response from pinning every worker. PHP’s advisory for the folded-header bug fixed in November (CVE-2026-127960) mentions it as a way to limit how long workers stay busy.
request_terminate_timeout = 60s
pm.max_requests = 500
pm.max_requests recycles each worker after a number of requests. It’s a safety valve against memory leaks and state left behind by earlier requests. For CVE-2026-129481, PHP’s advisory mentions pm.max_requests = 1 as an emergency workaround. That spawns a fresh process for every request and costs a lot of performance, so treat it as a last resort while you schedule the upgrade, not a setting to keep.
Size pm.max_children to your RAM as well. A pool that can outgrow memory will get workers killed mid-request, and interrupted writes were part of how CVE-2026-126714 worked.
9. Keep the environment out of workers
clear_env = yes, the default, gives workers a clean environment instead of everything the master inherited. Some container setups switch it off so environment variables reach PHP. If you do that, every secret in the container’s environment is readable by any code running in a worker, including code you didn’t write. Pass only what the app needs with env[NAME] = value, or load secrets from a file with tight permissions.
10. Decide whether the master needs root
The master needs root to run pools as different users. On a server with several sites, that’s the price of isolation in item 2. In a container running one app as one user, it isn’t needed: starting PHP-FPM as the unprivileged user caps what a master-level bug can give an attacker. PHP’s advisory for CVE-2026-129291 makes the same point. Test it in staging, since sockets, logs and the app directory all need to be writable or readable by that user.
11. Log enough to investigate later
Turn on a per-pool access log. It’s off unless you set access.log:
access.log = /var/log/php/example-access.log
When something odd happens, comparing the FPM access log with the nginx or Apache access log for the same minutes shows requests that reached PHP without passing through the web server. That mismatch was one of the signs analysts reported for CVE-2026-129289. Rotate these logs like any other.
12. Restart, don’t just reload, after upgrades
After a PHP upgrade, restart every FPM service so no worker from the old binary survives:
sudo systemctl restart php8.3-fpm
Do it for each installed version, including ones you think nothing uses. Then confirm the version from the web runtime rather than php -v on the command line: how to find the PHP that serves your site. In containers, rebuild the image and redeploy; restarting an old container brings back the old PHP.
A quick self-audit
Run through this after any change:
# Which pools exist, and how do they listen?
sudo php-fpm8.3 -tt 2>&1 | grep -E '\[|listen|user =|catch_workers_output|status_path|limit_extensions'
# Is any FPM port reachable from outside?
sudo ss -ltnp | grep -E 'php-fpm|:9000'
# Is reuse on anywhere?
sudo nginx -T 2>/dev/null | grep -n fastcgi_keep_conn
For the full picture of what November fixed and which checks apply to your setup, start with am I affected by the November 2026 PHP flaws?.
Rather not do it yourself? We patch and verify one server, from €79, including a look at the pool settings above.
Sources
- php.net: PHP-FPM configuration directives
- PHP security advisory GHSA-qc49-hpvq-g2w6 (CVE-2026-129289, request smuggling)
- PHP security advisory GHSA-jm4m-qfqx-967m (CVE-2026-129291, epoll use-after-free)
- PHP security advisory GHSA-3mg3-cr28-46gc (CVE-2026-129292, status page XSS)
- nginx: ngx_http_fastcgi_module
- Red Hat: RHSB-2026-020, multiple PHP vulnerabilities