Open redirect Via X-Forwarded-Host
The link.omise.co service trusted the X-Forwarded-Host header, so a request carrying an attacker-chosen host value caused the site to redirect the visitor to that host. An attacker could use this to send users to a malicious website.
ndizon_ Follow with iamjohndevx
Originally disclosed on HackerOne
- Fixed in 23 days
- Disclosed after 2.8 years
Summary:
I have found this bug since feb. 8,2022, when my open redirect in https://dashboard.omise.co got duplicated here where I first bug report my bug( https://hackerone.com/reports/1470535 ) since nobody response that's why I made new report for it.
Steps To Reproduce:
[add details for how we can reproduce the
- Open https://link.omise.co
- Capture the request of the site
- Add this
X-Forwarded-Host: example.combelow Host - Now you will get redirected in the site
Supporting Material/References:
- [attachment / reference]
Impact
An attacker can use this to make the user go to malicious website.
What the report shows
The target is link.omise.co, a host in the Omise program on HackerOne. The researcher reports an open redirect triggered by a request header, and rates it low severity. The report was disclosed on 17 November 2024. It does not record a bounty amount or a fix.
The researcher says the bug was found on 8 February 2022, when an open redirect previously reported against https://dashboard.omise.co appeared to be duplicated on this host. That earlier report is referenced as https://hackerone.com/reports/1470535, and the researcher explains that the new report was filed because nobody responded to the first one.
The reproduction steps are short:
- Open
https://link.omise.co. - Capture the request of the site.
- Add the header below, under
Host:
X-Forwarded-Host: example.com
- The site then redirects to the value supplied in the header.
The report lists an attachment or reference under supporting material, and it gives no HTTP response, status code or Location header value. The concrete evidence given is the header and the stated outcome: the site redirects.
Root cause
The likely cause is that the application builds a redirect target from the X-Forwarded-Host request header instead of from a fixed, server-side value. X-Forwarded-Host is a de facto header used by proxies and load balancers to tell the backend which hostname the client originally requested. It is client-controlled unless a trusted proxy strips or overwrites it, so any code that reads it to construct a URL is reading attacker input. The report does not describe the application code, so the exact construction (for example, whether the value is concatenated into an absolute URL or used as the host of a redirect) is not shown.
Impact
The report states the impact plainly: an attacker can use this to make the user go to a malicious website. The report says an attacker can use this to make the user go to a malicious website. The report does not demonstrate any of those chains, and it does not claim account takeover or credential theft.
How this kind of bug works
An open redirect exists when an application takes a destination from the request and sends the user there without validating that the destination belongs to an allowed set. The destination can arrive as a query parameter, a path segment, a form field, or, as here, a header. Header-based variants are easy to miss because the header is not visible in a normal browser address bar: the attacker has to control the request, which usually means sending it directly or through an intermediary that forwards the header.
Host-header style redirects are common in applications that generate absolute URLs: login pages that redirect back to the "current host", canonicalisation redirects from HTTP to HTTPS, language or locale redirects, and and hosts whose name suggests link shortening, such as the link. subdomain here. Frameworks often read Host or X-Forwarded-Host to build these URLs, and developers assume the proxy has already validated the value. When the proxy passes the header through untouched, the assumption fails.
The defences are straightforward: never derive a redirect destination from request headers; keep an allowlist of permitted hosts and paths; if a relative redirect is possible, use only a path and reject anything that parses as an absolute URL or a protocol-relative URL; and configure proxies to overwrite X-Forwarded-Host rather than append to it.
How to test for it
Start by mapping every place the application issues a redirect: login and logout flows, short links, locale switches, trailing-slash and canonicalisation rules, and any endpoint that returns a 3xx. For each, capture the full request and note which headers and parameters influence the Location header.
Then test the inputs one at a time. Send the request with a modified Host header, then with X-Forwarded-Host, X-Forwarded-Server, X-Host and similar forwarding headers set to a domain you control, and observe whether the response redirects there. Try the same value in query parameters and path segments that look like destinations. A positive result is a 3xx response whose Location points at your domain, or a page that loads resources from it.
Common false positives: a redirect that only happens after authentication, a Location that reflects your value but is never followed by a browser, a response that is a 200 with your string echoed in the body, and cases where the header is only honoured when it comes from a trusted internal address. Confirm the behaviour from an ordinary client position, and check that the redirect actually fires in a browser rather than only in a proxy tool.
How it is fixed
Stop using request headers to build redirect targets. Where an absolute URL is required, construct it from configuration and compare the requested destination against an allowlist of hosts and paths, rejecting anything else. Prefer relative redirects. At the edge, have the proxy set X-Forwarded-Host to a known value and drop client-supplied copies, so the backend never sees attacker input in that header. Add tests that assert a redirect to an external host is refused.
Hunting notes
Header-driven redirects cluster around infrastructure that generates URLs: shorteners, SSO and OAuth callback handlers, multi-tenant dashboards, and anything sitting behind a CDN or load balancer. Recon signals include hosts named link., go., redirect. or sso., responses that contain absolute URLs built from the request host, and applications that behave differently when you change Host. Compare behaviour with and without forwarding headers to see whether the backend trusts them.
What happened, in plain words
This report is about a website called link.omise.co, part of the Omise program on HackerOne. HackerOne is a platform where security researchers report bugs to companies. The researcher, ndizon_, found an open redirect: a flaw that lets a website send visitors to another address, chosen by whoever sends the request, instead of to a page on the site itself. The report rates the bug as low severity and was disclosed on 17 November 2024. It does not record a bounty amount or a fix.
The researcher says the bug was found on 8 February 2022, when an open redirect already reported against https://dashboard.omise.co seemed to be duplicated on this host. That earlier report is referenced as https://hackerone.com/reports/1470535. The researcher explains that the new report was filed because nobody responded to the first one.
The reproduction steps
The steps are short. Each one matters because it builds up to the moment the site trusts something it should not.
- Open
https://link.omise.co. This loads the site in a browser, so you can see what it normally does. - Capture the request of the site. A request is the message your browser sends to a server to ask for a page. Capturing it means recording that message, usually with a tool that sits between the browser and the server, so you can look at it and change it before it is sent. Think of it as intercepting a letter before it goes in the postbox.
- Add this header below
Host:
X-Forwarded-Host: example.com
A header is a line of extra information attached to a request, such as which browser you use or which site you asked for. Host is the header that names the site you want. X-Forwarded-Host is a header normally used by proxies and load balancers (middle machines that pass traffic on to the real server) to tell the server which hostname the visitor originally asked for. Here the researcher sets it to example.com, a domain they do not own, to see whether the site believes it.
- Now you will get redirected in the site. The site sends the visitor to the value supplied in the header. In other words, the site takes the destination from a line the visitor controls.
The report lists an attachment or reference under supporting material. It gives no HTTP response, status code or Location header value. The concrete evidence given is the header and the stated outcome: the site redirects.
Why it happens
The likely cause is that the application builds a redirect target from the X-Forwarded-Host request header instead of from a fixed value set on the server. X-Forwarded-Host is only trustworthy if a proxy strips or overwrites it before the request reaches the backend. Otherwise it is input from the client, and any code that reads it to build a URL is reading attacker input. The report does not describe the application code, so the exact construction is not shown.
Impact
The report states the impact plainly: an attacker can use this to make the user go to a malicious website. The report says an attacker can use this to make the user go to a malicious website. The report does not demonstrate any of those chains and does not claim account takeover or credential theft.
In general, how this kind of bug works
An open redirect exists when an application takes a destination from the request and sends the user there without checking that the destination belongs to an allowed set. The destination can arrive as a query parameter (the part of a URL after the ?), a path segment, a form field, or, as here, a header. Header-based variants are easy to miss because the header is not visible in a normal browser address bar. The attacker has to control the request, which usually means sending it directly or through an intermediary that forwards the header.
Host-header style redirects are common in applications that generate absolute URLs: login pages that redirect back to the "current host", redirects from HTTP to HTTPS, language or locale redirects, and and hosts whose name suggests link shortening, such as the link. subdomain here. Frameworks often read Host or X-Forwarded-Host to build these URLs, and developers assume the proxy has already validated the value. When the proxy passes the header through untouched, the assumption fails.
The defences are straightforward: never derive a redirect destination from request headers; keep an allowlist of permitted hosts and paths; if a relative redirect is possible, use only a path and reject anything that parses as an absolute URL or a protocol-relative URL; and configure proxies to overwrite X-Forwarded-Host rather than append to it.
How to test for it
Start by mapping every place the application issues a redirect: login and logout flows, short links, locale switches, trailing-slash and canonicalisation rules, and any endpoint that returns a 3xx status (a redirect response). For each, capture the full request and note which headers and parameters influence the Location header, which is where a redirect response names its destination.
Then test the inputs one at a time. Send the request with a modified Host header, then with X-Forwarded-Host, X-Forwarded-Server, X-Host and similar forwarding headers set to a domain you control, and observe whether the response redirects there. Try the same value in query parameters and path segments that look like destinations. A positive result is a 3xx response whose Location points at your domain, or a page that loads resources from it.
Common false positives: a redirect that only happens after authentication, a Location that reflects your value but is never followed by a browser, a response that is a 200 with your string echoed in the body, and cases where the header is only honoured when it comes from a trusted internal address. Confirm the behaviour from an ordinary client position, and check that the redirect actually fires in a browser rather than only in a proxy tool.
How it is fixed
Stop using request headers to build redirect targets. Where an absolute URL is required, construct it from configuration and compare the requested destination against an allowlist of hosts and paths, rejecting anything else. Prefer relative redirects. At the edge, have the proxy set X-Forwarded-Host to a known value and drop client-supplied copies, so the backend never sees attacker input in that header. Add tests that assert a redirect to an external host is refused.
Hunting notes
Header-driven redirects cluster around infrastructure that generates URLs: shorteners, SSO and OAuth callback handlers, multi-tenant dashboards, and anything sitting behind a CDN or load balancer. Recon signals include hosts named link., go., redirect. or sso., responses that contain absolute URLs built from the request host, and applications that behave differently when you change Host. Compare behaviour with and without forwarding headers to see whether the backend trusts them.
Glossary
- Open redirect: a flaw where a site sends visitors to a destination taken from the request, without checking that the destination is allowed.
- Header: a line of extra information attached to an HTTP request or response, such as the browser type or the requested host.
- Host: the header that names the site the browser wants to reach.
- X-Forwarded-Host: a header used by proxies and load balancers to tell the backend which hostname the visitor originally requested; it is client-controlled unless a trusted proxy overwrites it.
- Proxy / load balancer: a middle machine that receives traffic and passes it on to the real server.
- Request: the message a browser sends to a server to ask for a page or resource.
- Response: the message a server sends back, which may contain a page or a redirect instruction.
- Status code / 3xx: a number in the response saying what happened; codes starting with 3 mean the browser should go somewhere else.
- Location header: the part of a redirect response that names the destination.
- Absolute URL: a full web address including the scheme and host, such as
https://example.com/page. - Relative redirect: a redirect to a path on the same site, such as
/login, with no host. - Protocol-relative URL: an address starting with
//that borrows the current page's scheme, such as//example.com. - Allowlist: a fixed list of values that are permitted, with everything else rejected.
- Query parameter: the part of a URL after the
?, carrying extra values. - Phishing: tricking someone into visiting a fake site or handing over information.
- SSO / OAuth: login systems where one service lets you sign in to another; they often redirect you back to a callback address.
- CDN: a network of servers that delivers content close to visitors.
- Recon: the early stage of research where you map a target's hosts and behaviour.
- False positive: a result that looks like a bug but is not exploitable in practice.
- Severity: a rating of how serious a bug is, here low.