Описание
PHP-FPM status endpoint XSS via unescaped user and script fields
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.
Details
The earlier fix for CVE-2026-6735 escaped the request URI and query string, but left the request method, authentication user and script filename unescaped in the per-process status output. These values are stored in the PHP-FPM scoreboard and later inserted into HTML, XML and JSON responses without the encoding required by each format.
The most direct attack uses the username from an HTTP Basic authentication header. When the front end forwards this header to PHP-FPM, PHP can decode and store the supplied username even if the application does not use Basic authentication. The scoreboard retains up to 31 bytes of the username, which is enough for an HTML element with a JavaScript event handler. A request to an ordinary PHP script in the pool can therefore plant a payload that runs when another user opens the status endpoint with full&html. The value remains in that worker's scoreboard entry until it is replaced by a later request.
The script filename provides another injection path when an attacker can influence the filename recorded by FPM, including configurations using cgi.fix_pathinfo=0. Ordinary web servers restrict the characters accepted in request methods, so the request-method field does not by itself establish the same HTTP attack path. Unescaped quotes or markup in these fields can also corrupt JSON or XML status responses and interfere with monitoring consumers.
The fix applies a common, format-appropriate escaping helper to the request method, request URI, query string, authentication user and script filename before rendering the full status response. A separate client-side injection issue in the bundled status.html dashboard is tracked in GHSA-q8fm-p8fx-h6r6.
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.
Affected versions
The affected status output has been present since PHP 5.3.9. This is based on code inspection.
Mitigation
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.
Пакеты
php
>=5.3.9, <8.2.36
8.2.36
php
>=8.3.0, <8.3.37
8.3.37
php
>=8.4.0, <8.4.28
8.4.28
php
>=8.5.0, <8.5.13
8.5.13
Связанные уязвимости
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.
PHP-FPM status endpoint XSS via unescaped user and script fields. The PHP-FPM full status output includes the request method, authentication user and script filename of each worker without escaping them for the HTML, XML or JSON format. When the status endpoint is enabled, an unauthenticated remote attacker can store markup in a worker's scoreboard entry with an ordinary request, for example through the username of an HTTP Basic authentication header that the web server forwards to PHP-FPM, or through the script filename where the attacker can influence it. When a user views the full status page as HTML, the injected JavaScript runs in the origin of that page. The attacker does not need access to the status endpoint. Malformed XML or JSON output can also disrupt monitoring tools. This issue affects PHP versions before 8.2.36, 8.3.* before 8.3.37, 8.4.* before 8.4.28 and 8.5.* before 8.5.13.
PHP-FPM status endpoint XSS via unescaped user and script fields. The PHP-FPM full status output includes the request method, authentication user and script filename of each worker without escaping them for the HTML, XML or JSON format. When the status endpoint is enabled, an unauthenticated remote attacker can store markup in a worker's scoreboard entry with an ordinary request, for example through the username of an HTTP Basic authentication header that the web server forwards to PHP-FPM, or through the script filename where the attacker can influence it. When a user views the full status page as HTML, the injected JavaScript runs in the origin of that page. The attacker does not need access to the status endpoint. Malformed XML or JSON output can also disrupt monitoring tools. This issue affects PHP versions before 8.2.36, 8.3.* before 8.3.37, 8.4.* before 8.4.28 and 8.5.* before 8.5.13.
PHP-FPM status endpoint XSS via unescaped user and script fields. The ...