Hijacking tons of Instapage expired users Domains & Subdomains
Expired or misconfigured Instapage accounts left domains and subdomains still pointing at the service, and the publish endpoint accepted any target URL, so an attacker could publish their own landing page content onto those domains. The author demonstrated this against a HackerOne-owned domain and claimed many other sites were similarly exposed.
so this post is about how I was able to hijack ton’s of domains/subdomains who using Instapage if there service got expired.
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.
Context
Instapage is a service for building landing pages for online marketing and promotion campaigns. It offers A/B testing, management of multiple campaigns, easy page building and more. Importantly for this write-up, it also lets users map its templates onto their own domains or subdomains.
The target here is not Instapage itself but the domains and subdomains of Instapage customers. When a customer's Instapage service expires, or when a domain or subdomain is not linked properly, the mapped hostname stops serving the customer's page and instead shows an Instapage error. The researcher found that this error state can be abused to publish his own template on those hostnames, taking over domains and subdomains belonging to Instapage users.
Setup
The researcher was working as a researcher on the HackerOne platform and wanted to earn the "Hacking Hackers" badge on his profile. To that end he was looking for something on HackerOne itself. He found that hacker.one, one of the official websites of HackerOne, was in scope.
No special accounts, tools or versions are described beyond a browser and the Instapage builder interface. The precondition for the attack is a hostname that a customer has mapped to Instapage but whose service has expired or whose link to Instapage is misconfigured, so that the Instapage error page is served.
Finding it
While visiting hacker.one, the researcher saw an error that caught his eye. After investigating, he recognised it as an Instapage error, the one that occurs when the service has expired or when a domain or subdomain is not linked properly.
The write-up labels this image as the Instapage error on Hacker.One. It took him only a few minutes to work out that he could publish his own template to any misconfigured and expired domain or subdomain of Instapage, and HackerOne turned out to be one of Instapage's users.
Exploitation
Step 1: Identify a hostname in the error state
The starting point is a hostname mapped to Instapage that returns the Instapage error instead of a customer page. In this case it was hacker.one.
Step 2: Publish a template to that hostname
The researcher used the Instapage builder's publish request, sending the target hostname in the url parameter:
POST /ajax/builder2/publish/2340488 HTTP/1.1
Host: app.instapage.com
User-Agent: Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/36.04
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
X-Requested-With: XMLHttpRequest
Referer: http://app.instapage.com/builder2?id=2340488
Content-Length: 31
Cookie: cookie_value
Connection: close
version=1&url=www.hacker.one
The Referer points at the builder page builder2?id=2340488. The body carries two parameters: version=1 and url=www.hacker.one. The url parameter is the important one: it holds the domain or subdomain to which the template is published. The request is sent to app.instapage.com with an X-Requested-With: XMLHttpRequest header and a cookie.
Step 3: Observe the takeover
The write-up includes a screenshot of the HackerOne domain takeover.
The write-up labels this image as the Hacker.One domain takeover.
Step 4: Reproduce at scale
A video proof of concept accompanies the write-up:
Using Google dorks together with the Instapage error, the researcher found many websites vulnerable to the same takeover, each of which anyone could take over with their own content.
Root cause
The publish request carries the target hostname in the url parameter, and the report does not describe what checks the server performed on it. A hostname whose Instapage service has expired, or whose link to Instapage is misconfigured, is still accepted as a publish target, so any Instapage user can attach their own template to it. The error page is the visible symptom of a hostname that is still pointed at Instapage but no longer owned by an active customer, and that gap is what the request exploits. The report does not describe the server-side checks in more detail.
Impact
Anyone could publish their own content on misconfigured and expired Instapage domains and subdomains. The researcher found many such websites with the help of Google dorks, and states that anyone could take them over with their own content. The affected parties are Instapage customers whose service has expired or whose DNS or mapping is misconfigured, and the impact is limited to hostnames in that state. The report does not quantify the number of affected domains.
Fix
The researcher contacted Instapage through HackerOne. HackerOne fixed it next of report by removing the CNAME entry pointing to Instapage. Instapage later fixed the issue completely, and the fix was confirmed through the HackerOne report thread, #159156.
Variants to test
- Other hostnames showing the same expired-service error page. A positive result is a hostname that still resolves to the service and returns the error, after which a publish request naming it in
urlsucceeds. - Other publish or mapping endpoints in the same builder that take a hostname parameter. A positive result is a request that attaches content to a hostname the caller does not own.
- Hostnames found through search-engine dorks for the service's error text. A positive result is a list of candidate hostnames that can be checked one by one for the error state.
- Hostnames whose DNS still points at the service after the customer left. A positive result is a hostname that serves attacker content after a publish request, as happened with
www.hacker.one.
What happened, in plain words
A security researcher found a way to put his own web page on websites that belonged to other people. The websites were all built with a service called Instapage. When a customer stops paying for Instapage, or when their domain is set up incorrectly, their website shows an error page from Instapage instead of their own content. The researcher discovered that he could use Instapage's own publishing feature to attach his page to those broken websites, so anyone visiting them would see his content instead of the owner's. One of the affected websites belonged to HackerOne, the company that runs a well-known bug bounty platform. The researcher reported it there, HackerOne fixed its own site, and Instapage later fixed the underlying problem for everyone.
What Instapage is
Instapage is a service that lets people build landing pages for online marketing and promotion campaigns. A landing page is a single web page you send people to, for example after they click an advert. Instapage offers features such as A/B testing (showing two versions of a page to see which works better), management of multiple campaigns, easy page building, and more.
The part that matters here is that Instapage also lets users map its templates onto their own domain or subdomain. A domain is the name you type in the browser, like example.com. A subdomain is a name in front of it, like shop.example.com. Mapping means telling the internet that when someone visits your domain, the content should come from Instapage rather than from a server you run yourself. Think of it like putting a forwarding address on your post: the post still arrives at your name, but someone else handles the delivery.
The target: customers' domains, not Instapage itself
The target here is not Instapage's own website. It is the domains and subdomains of Instapage's customers. When a customer's Instapage service expires, or when a domain or subdomain is not linked properly, the mapped hostname stops serving the customer's page and instead shows an Instapage error. A hostname is simply a name for a machine or website on the internet, such as www.hacker.one.
The researcher found that this error state can be abused. He could publish his own template on those hostnames, taking over domains and subdomains that belonged to Instapage users. Taking over a name like this is called subdomain takeover: someone else's name now points at content you control.
How he got started
The researcher was working as a researcher on the HackerOne platform. HackerOne runs a bug bounty programme, where companies invite people to look for security problems in their systems and report them. Researchers earn reputation and badges for good reports. He wanted to earn the "Hacking Hackers" badge on his profile, so he was looking for something on HackerOne itself.
He found that hacker.one, one of the official websites of HackerOne, was in scope. In scope means the company has said that this particular system is fair game to test. That matters: testing systems that are not in scope is not allowed.
No special accounts, tools or versions are described beyond a browser and the Instapage builder interface. The builder is the part of Instapage where you design and publish a page. The precondition for the attack is a hostname that a customer has mapped to Instapage but whose service has expired, or whose link to Instapage is misconfigured, so that the Instapage error page is served.
Finding it
While visiting hacker.one, the researcher saw an error that caught his eye. After investigating, he recognised it as an Instapage error, the one that occurs when the service has expired or when a domain or subdomain is not linked properly.
The write-up labels this image as the Instapage error on Hacker.One. It took him only a few minutes to work out that he could publish his own template to any misconfigured and expired domain or subdomain of Instapage. HackerOne turned out to be one of Instapage's users.
Exploitation
Step 1: Identify a hostname in the error state
The starting point is a hostname mapped to Instapage that returns the Instapage error instead of a customer page. In this case it was hacker.one. In this case it was hacker.one, which he had found in scope and showing the error.
Step 2: Publish a template to that hostname
The researcher used the Instapage builder's publish request, sending the target hostname in the url parameter:
POST /ajax/builder2/publish/2340488 HTTP/1.1
Host: app.instapage.com
User-Agent: Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/36.04
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
X-Requested-With: XMLHttpRequest
Referer: http://app.instapage.com/builder2?id=2340488
Content-Length: 31
Cookie: cookie_value
Connection: close
version=1&url=www.hacker.one
This is an HTTP request, the message a browser sends to a web server to ask it to do something. Here is what each line means.
POST /ajax/builder2/publish/2340488 HTTP/1.1: the method is POST, which is used to send data that changes something on the server. The path/ajax/builder2/publish/2340488identifies the page being published in the builder, andHTTP/1.1is the version of the protocol. The number2340488is the identifier of the page in the builder.Host: app.instapage.com: the server the request is addressed to.app.instapage.comis the Instapage application.User-Agent: Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/36.04: tells the server which browser and operating system the request comes from.Accept: */*: the client will accept any kind of response.Accept-Language: en-US,en;q=0.5: the preferred language is US English.Accept-Encoding: gzip, deflate: the client can handle compressed responses.Content-Type: application/x-www-form-urlencoded; charset=UTF-8: the body is sent in the classic form format, as key=value pairs joined by&, encoded in UTF-8.X-Requested-With: XMLHttpRequest: marks the request as coming from JavaScript in the page rather than from typing a URL in the address bar. An XMLHttpRequest is the browser feature that lets a page fetch data in the background without reloading.Referer: http://app.instapage.com/builder2?id=2340488: the page the request was made from. It points at the same builder page, which is consistent with a real publish action.Content-Length: 31: the length of the body in bytes.Cookie: cookie_value: the session cookie. A cookie is a small piece of data the browser stores for a site and sends back with each request. A session cookie identifies the logged-in user, so the server knows whose account is making the request. Here the value is shown ascookie_valuerather than a real one.Connection: close: the connection should be closed after this request.- The blank line separates the headers from the body.
version=1&url=www.hacker.one: the body. It carries two parameters:version=1andurl=www.hacker.one. Theurlparameter is the important one: it holds the domain or subdomain to which the template is published. The request is sent as an XMLHttpRequest toapp.instapage.comwith the researcher's session cookie.
He sent this request because the builder's publish action is what attaches a template to a hostname. By putting a hostname he did not own into url, he was asking Instapage to publish his page there. The report does not describe the server's response to this request.
Step 3: Observe the takeover
The write-up includes a screenshot of the HackerOne domain takeover.
The write-up labels this image as the Hacker.One domain takeover.
Step 4: Reproduce at scale
A video proof of concept accompanies the write-up:
A proof of concept is a demonstration that the problem is real, usually by showing it working. Using Google dorks together with the Instapage error, the researcher found many websites vulnerable to the same takeover. A Google dork is a search query that uses advanced search operators to find pages with particular characteristics, for example pages containing a specific error message. Each of those websites could be taken over by anyone with their own content.
Root cause
The publish request carries the target hostname in the url parameter, and the report does not describe what checks the server performed on it. An endpoint is a specific address on a server that performs an action when you send a request to it. A hostname whose Instapage service has expired, or whose link to Instapage is misconfigured, is still accepted as a publish target, so any Instapage user can attach their own template to it.
The error page is the visible symptom of a hostname that is still pointed at Instapage but no longer owned by an active customer, and that gap is what the request exploits. An ownership check means the server confirms that the account making the request actually controls the hostname it is naming.
Impact
Anyone could publish their own content on misconfigured and expired Instapage domains and subdomains. The researcher found many such websites with the help of Google dorks, and states that anyone could take them over with their own content. The affected parties are Instapage customers whose service has expired or whose DNS or mapping is misconfigured, and the impact is limited to hostnames in that state. DNS is the system that translates names like example.com into the addresses computers use to find each other. The report does not quantify the number of affected domains.
Fix
The researcher contacted Instapage through HackerOne. HackerOne fixed it next of report by removing the CNAME entry pointing to Instapage. A CNAME entry is a DNS record that says one name is an alias for another; removing it stops the name from pointing at Instapage at all. Instapage later fixed the issue completely, and the fix was confirmed through the HackerOne report thread, #159156. A report thread is the conversation on the platform where the researcher and the company discuss the report.
Variants to test
- Other hostnames showing the same expired-service error page. A positive result is a hostname that still resolves to the service and returns the error, after which a publish request naming it in
urlsucceeds. - Other publish or mapping endpoints in the same builder that take a hostname parameter. A positive result is a request that attaches content to a hostname the caller does not own.
- Hostnames found through search-engine dorks for the service's error text. A positive result is a list of candidate hostnames that can be checked one by one for the error state.
- Hostnames whose DNS still points at the service after the customer left. A positive result is a hostname that serves attacker content after a publish request, as happened with
www.hacker.one.
Glossary
- A/B testing: showing two versions of a page to different visitors to see which performs better.
- Bug bounty programme: a scheme where a company invites people to find and report security problems in its systems, often with rewards.
- Builder: the part of Instapage where a user designs and publishes a landing page.
- CNAME entry: a DNS record that makes one name an alias for another name.
- Cookie: a small piece of data a browser stores for a website and sends back with each request.
- DNS: the system that translates names like
example.cominto the addresses computers use to find each other. - Domain: the main name of a website, such as
example.com. - Endpoint: a specific address on a server that performs an action when a request is sent to it.
- Google dork: a search query using advanced operators to find pages with particular characteristics, such as a specific error message.
- Hostname: a name for a machine or website on the internet, such as
www.example.com. - HTTP request: the message a browser sends to a web server to ask it to do something.
- In scope: a system the company has explicitly allowed researchers to test.
- Landing page: a single web page used for marketing, often the destination of an advert.
- Mapping: telling the internet that a domain should serve content from a particular service.
- Ownership check: a server-side check that the account making a request actually controls the resource it names.
- Parameter: a named value sent with a request, such as
url=www.hacker.one. - Proof of concept: a demonstration that a problem is real, usually by showing it working.
- Report thread: the conversation on a bug bounty platform where a researcher and a company discuss a report.
- Session cookie: a cookie that identifies a logged-in user to the server.
- Subdomain: a name in front of a domain, such as
shop.example.com. - Subdomain takeover: gaining control of a subdomain by claiming a service it still points at but that its owner no longer uses.
- XMLHttpRequest: a browser feature that lets a page fetch data in the background without reloading.