# Nezha OAuth2 redirect_uri Host header injection regression

Source: https://junglewise.ai/threats/nezha-oauth2-redirect-uri-host-header-injection-regression-331e924a  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-09-15. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

Severity: low · CVSS 2.9 · Published 2026-09-15

Nezha v2.2.3 contains a regression in OAuth2 handling where forged HTTP Host headers are reflected into OAuth2 redirect URLs when the new `dashboard_host` configuration is left empty. An attacker can trick a victim into initiating OAuth2 login via a request with a malicious Host header, causing Nezha to send the victim's authorization code to an attacker-controlled server instead of the legitimate OAuth provider, potentially leading to account takeover if the OAuth provider accepts the forged redirect URL.

Technologies: [github.com/nezhahq/nezha (Go)](https://junglewise.ai/threats/technologies/github-com-nezhahq-nezha). Vendors: [Go](https://junglewise.ai/threats/vendors/go).

## Quick answers

**Is This vulnerability exploited in the wild?** No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.

**How severe is This vulnerability?** Low severity, with a CVSS score of 2.9, published 15 September 2026.

**Which products and versions are affected?** github.com/nezhahq/nezha (Go) = 2.2.3.

**Is there a fix for This vulnerability?** No fixed version is recorded yet. Check the vendor's advisory in the references below. If you run it, Junglewise drafts a mitigation that fits your setup and applies it once you approve, with senior security engineers behind it.

**How is This vulnerability attacked?** It is attacked over the network, in a web application.

**Am I affected?** Check whether you run github.com/nezhahq/nezha (Go) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## Technical details

This is a Host header injection vulnerability in the OAuth2 redirect URI construction logic in `cmd/dashboard/controller/oauth2.go`. The vulnerable code chooses the request Host header directly unless `DashboardHost` is explicitly configured as non-empty; when `DashboardHost` is empty (the default for v2.2.3), the request-supplied Host header is used to build the OAuth2 callback URL, even if `InstallHost` is configured. An attacker who can reach the Nezha instance with a forged Host header (via DNS spoofing, HTTP Host header manipulation, or misconfigured proxy) can make Nezha send an attacker-controlled redirect URI to the OAuth2 provider. If the provider accepts this URI, the victim's authorization code is exfiltrated to the attacker. This regresses a v2.2.0 fix that correctly fell back to `InstallHost`. The vulnerability requires the victim to initiate OAuth2 login and the OAuth provider to accept the forged redirect URI, but affects the realistic default/upgrade scenario where `dashboard_host` is a new optional field left unset.

## Affected products

- Nezha Nezha 2.2.3

## Timeline

- 2026-09-15: disclosed: Advisory published to GitHub Advisory Database

## References

- [https://api.github.com/users/DavidCarliez](https://api.github.com/users/DavidCarliez)
- [https://github.com/DavidCarliez](https://github.com/DavidCarliez)
- [https://api.github.com/users/DavidCarliez/gists%7B/gist_id%7D](https://api.github.com/users/DavidCarliez/gists%7B/gist_id%7D)
- [https://api.github.com/users/DavidCarliez/repos](https://api.github.com/users/DavidCarliez/repos)
- [https://avatars.githubusercontent.com/u/271374756?v=4](https://avatars.githubusercontent.com/u/271374756?v=4)
- [https://api.github.com/users/DavidCarliez/events%7B/privacy%7D](https://api.github.com/users/DavidCarliez/events%7B/privacy%7D)

## Related threats

- [Nezha monitoring dashboard denial of service via service deletion race](https://junglewise.ai/threats/cve-2026-100394-nezha-monitoring-whole-instance-dos-in-nezha-dashboard-a-member)
- [Nezha Host header injection in OAuth2 redirect endpoint](https://junglewise.ai/threats/cve-2026-101090-nezha-2-2-3-contains-a-host-header-injection-regression-in-the)
- [Nezha Monitoring insufficient stream authorization in websocket endpoints](https://junglewise.ai/threats/cve-2026-62283-nezha-monitoring-insufficient-stream-authorization-in-websocket)
- [Nezha Monitoring plaintext credential exposure in DDNS and Notification APIs](https://junglewise.ai/threats/cve-2026-59155-nezha-monitoring-plaintext-credential-exposure-in-ddns-and)
- [Nezha Monitoring Host Header Injection in OAuth2 callback](https://junglewise.ai/threats/cve-2026-53523-nezha-monitoring-host-header-injection-in-oauth2-callback)
