Summary
PHP-FPM can include attacker-controlled request metadata without escaping it in the full status response. An unauthenticated attacker can place HTML or JavaScript in a worker’s scoreboard entry and execute it in the browser of an operator who later views the full HTML status page. The attacker does not need access to the status endpoint.
Product
Vulnerable versions:
-
>= 8.2.0, < 8.2.36
-
>= 8.3.0, < 8.3.37
-
>= 8.4.0, < 8.4.28
-
>= 8.5.0, < 8.5.13
Impact
Exploitation requires an enabled PHP-FPM status endpoint, a request path through which attacker-controlled metadata reaches the affected pool, and a user or tool that renders the full status data as HTML. For the authentication-user attack, the front end must forward the Basic authentication header to FPM. Restricting access to the status endpoint does not prevent an attacker from planting the payload through a separate application request.
Successful exploitation runs JavaScript in the status page’s origin. It can expose request URIs, query strings and other information shown on the status page. If the page shares an origin with the application, the script can also act with the viewing user’s session and read data available to that origin, including cookies that are not protected by HttpOnly. Malformed XML or JSON can additionally disrupt status parsing and monitoring.
Remediation
Upgrade to the fixed release for your PHP branch when it becomes available. As a temporary workaround, disable the PHP-FPM status endpoint or prevent use of its full HTML output. If full status data is required, use a consumer that validates the response and treats all field values as untrusted text. Restricting status access to trusted operators remains useful, but is not a complete mitigation because those operators can receive payloads planted by other clients.