Executive brief
Nezha Monitoring, a dashboard for managing servers, is vulnerable to a security flaw in its login process. An attacker can trick a user into clicking a malicious link that redirects their login credentials to a server controlled by the attacker. This could allow the attacker to take over the user's account, potentially gaining full administrative control over all monitored servers and sensitive configuration data.
Technical details
A Host Header Injection vulnerability exists in the `getRedirectURL` function within `cmd/dashboard/controller/oauth2.go`. The application constructs the OAuth2 callback URL using the unvalidated `Host` header from the incoming HTTP request. By crafting a request with a malicious `Host` header and inducing a victim to initiate OAuth2 authentication, an attacker can cause the OAuth2 provider to send the authorization code to an attacker-controlled domain. This code can then be exchanged for an access token, leading to account takeover. The vulnerability is mitigated by the requirement for user interaction and the need for the OAuth2 provider to have loose redirect URI validation (e.g., wildcard support). The issue is fixed in version 2.2.0 by using a deterministic configured base URL.
Affected products
- nezhahq Nezha Monitoring Dashboard >= 1.0.0, < 2.2.0
Timeline
- 2026-06-05: disclosed
- 2026-06-12: advisory: NVD publication date
- 2026-06-26: patched: GitHub Advisory reviewed and updated