AzuraCast has Password Reset Poisoning via Untrusted X-Forwarded-Host Header that Leads to Account Takeover and 2FA Bypass
Date: 2026-05
Affected: composer/azuracast/azuracast
Attack vector: data-exfiltration
Category: vulnerability-disclosure
Severity: High
CVE: CVE-2026-42605
CVE-2026-42606
CWE: CWE-22
CWE-640
CVSS: 8.1 (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N)

## Summary The `ApplyXForwarded` middleware unconditionally trusts the client-supplied `X-Forwarded-Host` HTTP header with no trusted proxy allowlist. An unauthenticated attacker can poison the password reset URL sent to any user by injecting this header when triggering the forgot-password flow. When the victim clicks the poisoned link, their reset token is exfiltrated to the attacker's server. The attacker then uses the token on the real instance to reset the victim's password and destroy their 2FA configuration, achieving full account takeover. ## Details ### Root Cause 1: Unconditional X-Forwarded-Host Trust `backend/src/Middleware/ApplyXForwarded.php:35-40`: ```php if ($request->hasHeader('X-Forwarded-Host')) { $hasXForwardedHeader = true; $xfHost = Types::stringOrNull($request->getHeaderLine('X-Forwarded-Host'), true); if (null !== $xfHost) { $uri = $uri->withHost($xfHost); } } ``` There is no validation that the request originates from a trusted reverse proxy. Any direct client can set this header and it will be accepted. In the default Docker deployment, nginx's PHP location block (`util/docker/web/nginx/azuracast.conf.tmpl:150-171`) uses `fastcgi_pass` with `include fastcgi_params`. Standard nginx behavior passes all client HTTP headers through to PHP-FPM as `HTTP_*` parameters. The `proxy_params.conf` file — which explicitly sets `X-Forwarded-For`, `X-Forwarded-Proto`, and `X-Forwarded-Port` — only applies to `proxy_pass` directives (web


Mitigations:

Architectural layers (MAESTRO):