Skip to content
Open redirect Disclosed report Beginner

Host Header Injection leads to Open Redirect and Content Spoofing or Text Injection.

The dashboard trusted a client-supplied X-Forwarded-Host header, so the host used in generated links and pages could be swapped for an attacker's domain. An attacker could redirect a signed-in user to a malicious site and inject arbitrary text into a settings page under the trusted domain.

oblivionlight Follow

Originally disclosed on HackerOne

Bounty$300 Medium View original
  • Disclosed after 3 months

Summary:

1.) Open Redirection The https://dashboard.omise.co/test/dashboard website is vulnerable to an Open Redirection flaw if the server receives a crafted X-Forwarded-Host header.

Description: Open Redirect is a vulnerability in which the attacker manipulates a web page to redirect the users to unknown destinations (malicious/phishing destinations in most cases).

Steps To Reproduce:

  1. Visit https://dashboard.omise.co/signin and sign in with your credentials and make sure you have not verified your email.
  2. Once you log in, you will be on this page -- https://dashboard.omise.co/test/dashboard , send the request to Repeater and add X-Forwarded-Host: bing.com below Host: dashboard.omise.co
  3. Open the request in the browser and click on "here" inside --> Please check your mailbox (***********@gmail.com) to confirm your email address.

If you did not get an email from us, please click here to request another email. 4. It will redirect to a malicious page.

POC: Attached Video.

2.) Content Spoofing or Text Injection. The https://dashboard.omise.co/test/settings website is vulnerable to a Content Spoofing or Text Injection flaw if the server receives a crafted X-Forwarded-Host header. Description: Content spoofing, also referred to as content injection, "arbitrary text injection" or virtual defacement, is an attack targeting a user made possible by an injection vulnerability in a web application. When an application does not properly handle user-supplied data, an attacker can supply content to a web application, typically via a parameter value, that is reflected back to the user. This presents the user with a modified page under the context of the trusted domain.

Steps To Reproduce:

  1. Visit https://dashboard.omise.co/signin and sign in with your credentials and make sure you have not verified your email.
  2. Once you log in, go to Settings https://dashboard.omise.co/test/settings , send the request to Repeater and add X-Forwarded-Host: bing.com below Host: dashboard.omise.co
  3. Open the request in the browser and in the Settings option under Chains mark Enable account chaining CheckBox.
  4. Once you mark the check box it will show the URL, copy that URL and paste it in the browser.
  5. It will redirect.

POC: Attached Video.

Impact

Open Redirection Impact - An attacker can redirect users to malicious websites, which can lead to phishing attacks.

Content Spoofing or Text Injection Impact - An attacker can create a valid webpage with malicious recommendations and the user believes the recommendation as it was from the stock website.

Attachments

Open-Redirect-POC-1.webm From the original on HackerOne
Content-Spoofing-POC-2.webm

The original report as published on HackerOne, by oblivionlight. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 6 min read.

Context

Omise runs a dashboard at dashboard.omise.co where merchants sign in and manage their account. Two pages are central to this report: the post-login landing page at https://dashboard.omise.co/test/dashboard, and the account settings page at https://dashboard.omise.co/test/settings.

Both pages behave differently depending on the value of the X-Forwarded-Host request header. That header is normally set by a reverse proxy or load balancer to tell the backend which hostname the client originally asked for. When an application trusts it without validation and uses it to build links or URLs, an attacker who can set the header controls part of the page.

The report covers two consequences of that trust on the same asset: an open redirect on the dashboard page, and content spoofing (text injection) on the settings page. The program rated it medium severity and paid a 300 USD bounty; it was disclosed on 9 April 2022.

Setup

To reproduce either issue you need:

  1. A dashboard account whose email address has not been verified. This is a precondition for both findings, because the unverified state is what makes the dashboard page render the confirmation prompt with the clickable link.
  2. The ability to sign in at https://dashboard.omise.co/signin with those credentials.
  3. An intercepting proxy with a Repeater-style tool (the report uses Burp Suite terminology: "send the request to Repeater").
  4. A browser to replay the modified request and observe the result.

No special role or privilege is mentioned beyond a normal account in the unverified state.

Finding it

The report shows that the application reflects the X-Forwarded-Host header into the pages it serves. On the dashboard, the header value ends up in a link inside the email confirmation notice. On the settings page, it ends up in a URL shown after enabling account chaining. In both cases the value is attacker-controlled and is placed into a link the user is expected to click, which is the classic shape of a host header injection issue.

Exploitation

Step 1: Sign in with an unverified account

Visit https://dashboard.omise.co/signin, sign in with your credentials, and make sure the account's email address has not been verified. After login you land on:

Text
https://dashboard.omise.co/test/dashboard

That page shows the confirmation notice: "Please check your mailbox (***********@gmail.com) to confirm your email address. If you did not get an email from us, please click here to request another email." The word "here" is a link, and its target is built from the request's host information.

Step 2: Inject the header in Repeater

Send the request for the dashboard page to Repeater and add the following header directly below Host: dashboard.omise.co:

HTTP
X-Forwarded-Host: bing.com

The Host header still names the legitimate dashboard, so the request reaches the right virtual host. The added X-Forwarded-Host tells the backend, or whatever component reads it, that the original hostname was bing.com. If the application uses that value when constructing absolute URLs, the link on the page now points at bing.com instead of dashboard.omise.co.

Step 3: Open the modified request in the browser and click the link

Open the modified request in the browser and click "here" inside the confirmation notice. Because the link was generated from the injected header, the browser follows it to the attacker-chosen host rather than to the Omise dashboard. The report states that it redirects to a malicious page.

Open-Redirect-POC-1.webm From the original on HackerOne

The attached video, Open-Redirect-POC-1.webm, demonstrates this redirect.

Step 4: Content spoofing on the settings page

Sign in again with the same unverified account and go to Settings:

Text
https://dashboard.omise.co/test/settings

Send that request to Repeater and add the same header below Host: dashboard.omise.co:

HTTP
X-Forwarded-Host: bing.com

Step 5: Enable account chaining

Open the modified request in the browser. In the Settings page, under Chains, tick the Enable account chaining checkbox. Once the checkbox is ticked, the page displays a URL. That URL is built using the injected host value, so it points at bing.com rather than at the Omise domain.

Step 6: Paste the URL and observe the redirect

Copy the displayed URL and paste it into the browser. The report states that it redirects. Because the URL is presented inside the trusted dashboard page, a user reading it has no reason to suspect it leads somewhere else.

Content-Spoofing-POC-2.webm From the original on HackerOne

The attached video, Content-Spoofing-POC-2.webm, demonstrates the content spoofing behaviour.

Root cause

The application takes the value of the X-Forwarded-Host request header and uses it to construct absolute URLs that are rendered in the page: the confirmation link on the dashboard and the account chaining URL on the settings page. The header is client-supplied and is not validated against the set of legitimate hostnames, so any value the attacker sends is reflected into the page.

Likely, the backend sits behind a proxy that forwards the original host in X-Forwarded-Host, and the application framework or its URL helper trusts that header by default. Because the Host header itself is correct, any defence that only checks Host does not help. The report does not describe any validation, allowlist or canonical-host check that was in place.

Impact

For the open redirect, an attacker can redirect users to malicious websites, which can lead to phishing attacks. The link appears on the legitimate Omise dashboard, which can make the redirect more convincing.

For the content spoofing, an attacker can create a valid webpage with malicious recommendations, and the user believes the recommendation came from the stock website. In other words, the attacker-controlled URL is presented under the context of the trusted domain.

The report's reproduction steps use an account whose email address has not been verified. The report does not describe any exploitation against verified accounts.

Fix

The fix that follows from the root cause is to stop trusting the client-supplied X-Forwarded-Host header when building URLs: either ignore it entirely and derive the host from a configured canonical value, or validate it against an allowlist of legitimate hostnames before use. The same treatment should be applied to any other forwarding headers the application reads.

Variants to test

  1. Other forwarding headers. Try X-Forwarded-Host, X-Host, X-Forwarded-Server, Forwarded: host=... and X-Original-Host on the same endpoints. A positive result is a link or URL in the response that points at your chosen host.
  2. Other pages that build absolute URLs. Password reset emails, invitation links, OAuth callback URLs, webhook configuration screens and any page that shows a shareable link. A positive result is a generated URL whose host is the value you injected.
  3. Cached responses. If the injected host is reflected into a response that a cache stores, request the page without the header afterwards. A positive result is the poisoned link being served to a request that never sent the header.
  4. Host header itself. Where the proxy passes the Host header through unvalidated, try replacing it directly. A positive result is the same reflection without needing a forwarding header.
  5. Redirect chains. Follow the generated link and check whether the application issues a 3xx to the injected host or renders it as a clickable link. Either outcome confirms the injection point.

Hunting notes

This class of bug tends to hide wherever an application generates absolute URLs: email confirmation links, password reset links, account chaining or SSO setup screens, and any page that displays a URL for the user to copy. During recon, look for responses that echo the request host or a forwarding header into the body, into Location headers, or into links. Sending a harmless marker value such as a domain you control in X-Forwarded-Host and searching the response for it is a quick signal.

The report attaches two videos as proof of concept. The precondition of an unverified account is worth noting: it narrows the affected population, but

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 12 min read.

What happened, in plain words

Omise is a payment company. It gives its business customers (called merchants) a website called a dashboard, at dashboard.omise.co, where they sign in and manage their account. Think of it as the online banking area of a shop: you log in, you see your details, you change your settings.

Two pages of that dashboard are at the centre of this report:

  • https://dashboard.omise.co/test/dashboard, the page you land on after signing in.
  • https://dashboard.omise.co/test/settings, the page where you change your account settings.

Both pages have the same weakness. When your browser asks a website for a page, it sends a small bundle of text along with the request, called headers. Headers are like the label on an envelope: they tell the server who is asking, what they want and how. One of those headers is Host, which says which website name you typed in. There is another header, X-Forwarded-Host, that is normally added by an intermediate machine (a proxy) sitting between you and the real server. The proxy uses it to tell the server the name the visitor originally asked for.

The problem: the dashboard believed whatever value was in X-Forwarded-Host and used it to build links and URLs shown on the page. If an attacker puts a different website name in that header, the links on the page point to the attacker's website instead of Omise's. The report shows two results of this:

  1. An open redirect on the dashboard page: a link that should keep you on Omise sends you somewhere else.
  2. Content spoofing (also called text injection) on the settings page: a URL shown inside the trusted Omise page actually points elsewhere.

The report was rated medium severity and paid a 300 USD bounty. It was disclosed on 9 April 2022.

The ideas you need first

Before the steps, a few words that come up constantly. Each one is explained from zero.

  • Request and response. Your browser asks a server for something (a request) and the server answers (a response). Every click, every page load is a request and a response.
  • Header. Extra information attached to a request or response, written as Name: value. The Host header, for example, carries the website name.
  • Proxy / load balancer. A machine that sits in front of the real server, receives visitors first and passes their requests on. It is like a receptionist who takes your name and tells the person inside who is visiting.
  • X-Forwarded-Host. A header the proxy adds to tell the server the original website name the visitor used. The X- prefix is a convention for custom headers.
  • Host header injection. When a website takes a hostname from a header the visitor can control and uses it without checking it, an attacker can put their own hostname there. That is the whole bug class here.
  • Open redirect. A link on a trusted website that sends you to a website the attacker chose. You trust the first site, so you follow the link without thinking.
  • Content spoofing / text injection. When an attacker's text or URL appears inside a genuine page, so it looks like the real site is saying it. Also called virtual defacement.
  • Repeater. A feature of an intercepting proxy tool (the report uses Burp Suite) that lets you capture one request, edit it by hand and send it again as many times as you like. It is like being able to rewrite a letter before posting it.
  • Intercepting proxy. Software that sits between your browser and the server so you can see and change requests in flight.
  • Absolute URL. A full web address including the site name, such as https://dashboard.omise.co/test/dashboard, as opposed to a relative one like /test/dashboard that only works on the current site.
  • Account chaining. A dashboard feature that links accounts together. When you enable it, the page shows you a URL to use.

Setup: what you need

To reproduce either issue you need:

  1. A dashboard account whose email address has not been verified. This matters for both findings: the unverified state is what makes the dashboard page show the confirmation notice with the clickable link.
  2. The ability to sign in at https://dashboard.omise.co/signin with those credentials.
  3. An intercepting proxy with a Repeater-style tool (the report says "send the request to Repeater").
  4. A browser to replay the modified request and see the result.

No special role or privilege is mentioned beyond a normal account in the unverified state.

How the researcher found it

The report shows that the application copies the X-Forwarded-Host header into the pages it serves. On the dashboard, the value ends up in a link inside the email confirmation notice. On the settings page, it ends up in a URL shown after enabling account chaining. In both cases the value comes from the visitor and is placed into a link the user is expected to click. That is the classic shape of a host header injection issue.

Exploitation

Step 1: Sign in with an unverified account

Visit https://dashboard.omise.co/signin, sign in with your credentials, and make sure the account's email address has not been verified. After login you land on:

Text
https://dashboard.omise.co/test/dashboard

That page shows the confirmation notice: "Please check your mailbox (***********@gmail.com) to confirm your email address. If you did not get an email from us, please click here to request another email." The word "here" is a link, and its target is built from the request's host information.

Why this step: the unverified account is what makes the page show the notice with the link. Without that notice there is no link to hijack.

Step 2: Inject the header in Repeater

Send the request for the dashboard page to Repeater and add the following header directly below Host: dashboard.omise.co:

HTTP
X-Forwarded-Host: bing.com

Line by line:

  • X-Forwarded-Host: bing.com is the header name, a colon, and the value. Here the value is bing.com, a well-known search engine, used as a harmless stand-in for an attacker's domain.

The Host header still names the legitimate dashboard, so the request reaches the right virtual host. The added X-Forwarded-Host tells the backend, or whatever component reads it, that the original hostname was bing.com. If the application uses that value when building absolute URLs, the link on the page now points at bing.com instead of dashboard.omise.co.

Why this step: you are testing whether the server trusts a header you can set. If the link changes, the server is using your value.

Step 3: Open the modified request in the browser and click the link

Open the modified request in the browser and click "here" inside the confirmation notice. Because the link was generated from the injected header, the browser follows it to the attacker-chosen host rather than to the Omise dashboard. The report states that it redirects to a malicious page.

Open-Redirect-POC-1.webm From the original on HackerOne

The attached video, Open-Redirect-POC-1.webm, shows this redirect happening.

Why this step: seeing the browser actually leave the trusted site is the proof. A changed link in the page source is a clue; a real redirect is the impact.

Step 4: Content spoofing on the settings page

Sign in again with the same unverified account and go to Settings:

Text
https://dashboard.omise.co/test/settings

Send that request to Repeater and add the same header below Host: dashboard.omise.co:

HTTP
X-Forwarded-Host: bing.com

This is the same trick on a different page. The header line means exactly what it did before: you are telling the server the original hostname was bing.com.

Why this step: the first finding showed one page trusts the header. The researcher now checks whether another page does too, which would mean the problem is wider than a single link.

Step 5: Enable account chaining

Open the modified request in the browser. In the Settings page, under Chains, tick the Enable account chaining checkbox. Once the checkbox is ticked, the page displays a URL. That URL is built using the injected host value, so it points at bing.com rather than at the Omise domain.

Why this step: the checkbox is what makes the page generate and show the URL. You are checking whether that generated URL uses the hostname you supplied.

Step 6: Paste the URL and observe the redirect

Copy the displayed URL and paste it into the browser. The report states that it redirects. Because the URL is presented inside the trusted dashboard page, a user reading it has no reason to suspect it leads somewhere else.

Content-Spoofing-POC-2.webm From the original on HackerOne

The attached video, Content-Spoofing-POC-2.webm, shows the content spoofing behaviour.

Why this step: the URL being shown on a genuine Omise page is the spoofing part. Following it shows where it really goes.

Root cause

The application takes the value of the X-Forwarded-Host request header and uses it to build absolute URLs that appear in the page: the confirmation link on the dashboard and the account chaining URL on the settings page. The header comes from the visitor and is not checked against the list of legitimate hostnames, so any value the attacker sends ends up in the page.

Most likely, the backend sits behind a proxy that forwards the original host in X-Forwarded-Host, and the application framework or its URL helper trusts that header by default. Because the Host header itself is correct, any defence that only checks Host does not help. The report does not describe any validation, allowlist or canonical-host check that was in place.

Impact

For the open redirect, an attacker can redirect users to malicious websites, which can lead to phishing attacks. The link appears on the legitimate Omise dashboard, which can make the redirect more convincing.

For the content spoofing, an attacker can create a valid webpage with malicious recommendations, and the user believes the recommendation came from the stock website. In other words, the attacker-controlled URL is shown under the trusted domain's name.

The report's reproduction steps use an account whose email address has not been verified. The report does not describe any exploitation against verified accounts.

Fix

The fix that follows from the root cause is to stop trusting the visitor-supplied X-Forwarded-Host header when building URLs: either ignore it entirely and take the host from a configured canonical value, or check it against an allowlist of legitimate hostnames before use. The same treatment should be applied to any other forwarding headers the application reads.

Variants to test

  1. Other forwarding headers. Try X-Forwarded-Host, X-Host, X-Forwarded-Server, Forwarded: host=... and X-Original-Host on the same endpoints. A positive result is a link or URL in the response that points at your chosen host.
  2. Other pages that build absolute URLs. Password reset emails, invitation links, OAuth callback URLs, webhook configuration screens and any page that shows a shareable link. A positive result is a generated URL whose host is the value you injected.
  3. Cached responses. If the injected host ends up in a response that a cache stores, request the page without the header afterwards. A positive result is the poisoned link being served to a request that never sent the header.
  4. Host header itself. Where the proxy passes the Host header through unchecked, try replacing it directly. A positive result is the same reflection without needing a forwarding header.
  5. Redirect chains. Follow the generated link and check whether the application sends a 3xx (a redirect response) to the injected host or shows it as a clickable link. Either outcome confirms the injection point.

Hunting notes

This class of bug tends to hide wherever an application generates absolute URLs: email confirmation links, password reset links, account chaining or SSO setup screens, and any page that displays a URL for the user to copy. During recon, look for responses that echo the request host or a forwarding header into the body, into Location headers, or into links. Sending a harmless marker value such as a domain you control in X-Forwarded-Host and searching the response for it is a quick signal.

The report attaches two videos as proof of concept. The precondition of an unverified account is worth noting: it narrows the affected population, but

Glossary

  • Absolute URL: a full web address that includes the site name, such as https://dashboard.omise.co/test/dashboard.
  • Account chaining: a dashboard feature that links accounts together; enabling it makes the page show a URL.
  • Allowlist: a list of values that are explicitly permitted; anything not on the list is rejected.
  • Backend: the server-side part of a website that does the real work behind the pages you see.
  • Bounty: a reward paid by a company to someone who reports a security problem to it.
  • Browser: the program you use to visit websites, such as Chrome or Firefox.
  • Burp Suite: a tool used by security testers to capture and change web requests; it includes Repeater.
  • Cache: a store of saved responses so they can be served again quickly without asking the server.
  • Canonical host: the one official hostname a site should use.
  • Credentials: the username and password used to sign in.
  • CVSS: a scoring system for rating the severity of a security issue.
  • Dashboard: the signed-in area of a website where a user manages their account.
  • Endpoint: a specific address on a server that accepts requests, such as a particular page.
  • Host header: the header that carries the website name the browser asked for.
  • Host header injection: a flaw where a site uses a visitor-supplied hostname without checking it.
  • Intercepting proxy: software placed between browser and server so requests can be seen and edited.
  • Load balancer: a machine in front of servers that spreads incoming requests across them.
  • Location header: a response header that tells the browser to go to another address (a redirect).
  • Merchant: a business that uses Omise to take payments.
  • Open redirect: a link on a trusted site that sends the visitor to a site the attacker chose.
  • OAuth callback URL: the address a site sends you back to after you sign in through another service.
  • Phishing: tricking someone into visiting a fake site or giving away details by pretending to be a trusted party.
  • Proxy: a machine that sits between visitor and server and passes requests along.
  • Recon: the information-gathering phase before testing, where you look at how a site behaves.
  • Redirect (3xx): a response that tells the browser to load a different address.
  • Reflection: when a value you sent comes back in the server's response.
  • Repeater: a Burp Suite feature that lets you edit and resend a single captured request.
  • Request: the message a browser sends to a server asking for something.
  • Response: the message a server sends back.
  • Reverse proxy: a proxy that sits in front of a website's servers and forwards visitors' requests to them.
  • Severity: how serious a security issue is judged to be, often low, medium, high or critical.
  • SSO: single sign-on, signing in once to use several services.
  • URL helper: a function in a web framework that builds web addresses for the programmer.
  • Virtual host: one of several websites served by the same server, told apart by the hostname in the request.
  • Webhook: an automatic message one system sends to another when something happens.
  • X-Forwarded-Host: a header a proxy adds to tell the server the original hostname the visitor used.

More by oblivionlight

View all

1 more disclosed report, best first.

More from Omise

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Open redirect

The lesson behind this report.

A trusted site forwards users to any address an attacker picks; rarely paid alone, often the missing link in a chain.