Skip to content

fix(roles/apache_httpd): refuse the HTML view of the PHP-FPM status page - #787

Open
markuslf wants to merge 1 commit into
mainfrom
fix/apache-httpd-fpm-status-html
Open

markuslf wants to merge 1 commit into
mainfrom
fix/apache-httpd-fpm-status-html

Conversation

@markuslf

Copy link
Copy Markdown
Member

What

The localhost vHost of apache_httpd only passes the full, json, openmetrics and xml flags to /fpm-status and answers every other query with 403. This keeps out the HTML view (?html), which prints request fields that any client of the pool controls unescaped, so a planted payload runs in the browser of whoever opens the page (GHSA-3mg3-cr28-46gc, CVE-2026-129292). The php role enables the status page on every pool (pm.status_path = /fpm-status), which upstream leaves off.

Why an allowlist

php-fpm decides on the HTML view by looking for the key html in the decoded $_GET (sapi/fpm/fpm/fpm_status.c), so ?%68tml selects it as well. A blocklist on the decoded string does not hold either: Apache's unescape() returns an empty string for %00 or a broken escape such as %zz (server/util_expr_eval.c, server/util.c). Raw flags without any escape mean the same to Apache and php-fpm.

Verification

  • Podman, Rocky 8 (httpd 2.4.37) and Rocky 9 (httpd 2.4.62) with php-fpm: empty query, ?json, ?json&full, ?full, ?xml and ?openmetrics answer 200. ?full&html, ?html, ?%68tml, ?+html, ?html%00, ?json&%zz&html, ?html[], ?jsonhtml and ?full=1 answer 403. Control run without the guard: ?%68tml returns text/html.
  • molecule test --scenario-name apache_httpd passes on all 8 platforms, including the new assertions in verify.yml.
  • The php-fpm-status check of the Monitoring Plugins asks for ?json&full and is not affected.

Notes

  • A Location an admin adds by hand for further pools needs the same <If> block. Both role READMEs describe this.

The HTML view of /fpm-status prints request fields that any client of
the pool controls unescaped (CVE-2026-129292, GHSA-3mg3-cr28-46gc).
The localhost vHost now only passes the full, json, openmetrics and
xml flags. The allowlist works on the raw query string, because
php-fpm decodes the query before it looks for `html`, so a blocklist
on `html` is bypassed by `?%68tml`, and Apache's unescape() returns an
empty string for %00 or a broken escape. Verified with httpd 2.4.37
and 2.4.62 on Rocky 8 and 9, and by the apache_httpd Molecule scenario
on all supported platforms.
@markuslf
markuslf requested a review from NavidSassan November 19, 2026 14:46

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant