CVE-2025–50578: Exploiting Host Header Injection & Open Redirec
The application trusts the X-Forwarded-Host header to load page resources from an attacker-controlled domain, and reflects the Referer header in a redirect when updating a non-admin user, enabling open redirects. An attacker could redirect users to malicious sites or potentially load malicious JavaScript.
Published on medium.com
This post is to present CVE-2025–50578 discovered by me as Security Researcher, assigned by MITRE.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the application does not validate or restrict the X-Forwarded-Host and Referer headers before using them to construct resource URLs or redirect locations.
Impact
An attacker could redirect users to malicious domains for phishing or token leakage, and potentially load malicious JavaScript if the content type or context changes.
What the attacker needed
Ability to set custom headers; victim interacts with crafted request
The fix
The application should avoid trusting client-controlled headers for redirections or resource loading, validate against a whitelist of allowed domains, and use relative redirects.
How it was found
- Send a request to the home endpoint with a malicious X-Forwarded-Host header.
- Observe that the application loads resources from the attacker-controlled domain.
- Send a POST request to update a non-admin user with a malicious Referer header.
- Observe that the response contains a Location header pointing to the attacker's domain.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
The application uses information from the request (like the X-Forwarded-Host or Referer header) to decide where to load resources or redirect the user. An attacker can set these headers to a domain they control, so the application loads content from or redirects to the attacker's site. This can be used for phishing or to run malicious code if the content type allows.
What is Open redirect?
A trusted site forwards users to any address an attacker picks; rarely paid alone, often the missing link in a chain.