Skip to content
Subdomain takeover Write-up Beginner

How I was able to takeover the company’s LinkedIn Page

A company website linked to a LinkedIn company page that no longer existed, returning a 404. An attacker could register a LinkedIn page with the same company name and take over the link, posting malicious content under the company's name.

Vijaysimha Reddy Bathini Follow

Published on medium.com

Bounty$500 View original

Hi guys, this is my second blog post related to bug bounty. This vulnerability I have found recently and thought of sharing with the community.

Vijaysimha Reddy Bathini, on medium.com

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.

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. 5 min read.

Context

This write-up covers a broken link hijacking finding in a private bug bounty program on Bugcrowd. The company is not named in the report, so it is referred to here as company.com, and the subdomain where the work started is called subdomain.company.com.

The affected feature is not an application endpoint but an outbound link: the company's website, on that subdomain, contained a link to the company's LinkedIn page. That link pointed at a LinkedIn company URL that returned page not found, and the researcher was able to create a company page under the same name.

Broken link hijacking is closely related to subdomain takeover. Broken link hijacking is closely related to subdomain takeover: the report says the major difference is that one involves a subdomain while the other involves an expired link on a page. The report credits edoverflow for explaining the technique and links to the following post:

Text
https://edoverflow.com/2017/broken-link-hijacking/

Setup

The only precondition described is access to the private program: the researcher received an invitation to the Bugcrowd program and began by enumerating subdomains. That enumeration produced one subdomain, subdomain.company.com, which became the target of the link analysis.

The tool used is the broken-link-checker project by stevenvachon, available at:

Text
https://github.com/stevenvachon/broken-link-checker

According to the report, the tool collects all the links present in the source code of a website and reports those that return a 404 status when followed. No version number is given.

Finding it

After installing the tool, the researcher ran it against the subdomain. The command used checks for expired links up to the third level:

Bash
blc -rof --filter-level 3 https://example.com/

In the report the URL in the command is shown as https://example.com/; the actual target was the subdomain discovered during enumeration. The report says the command checks for expired links up to the third level.

Among the results was a link to the company's LinkedIn page that returned a 404 status code, page not found. The researcher opened the link manually to confirm, and it did indeed show page not found. The URL had this shape:

Text
https://www.linkedin.com/company/<company_name>=>404 Not found

So the site was still advertising a LinkedIn company page under a name that no longer existed on LinkedIn. That is the dangling reference: the link is live in the page source, but the resource behind it is gone.

Exploitation

Step 1: Register the abandoned company page name

The next step, as described, was to create a LinkedIn company page using the same company name that appeared in the dead URL. The next step, as described, was to create a LinkedIn company page using the same company name that appeared in the dead URL, in order to take over that page.

The report does not describe the LinkedIn registration flow, any verification steps LinkedIn required, or the responses returned during that process.

Step 2: Wait for a visitor to follow the link

Once the page existed, any user who clicked the company's LinkedIn link on the subdomain was taken to the attacker-controlled page instead of an error. No change to the target site was needed: the vulnerable link was already published there.

Root cause

The mistake is a stale outbound reference. The website hard-codes a link to a third-party resource, in this case a LinkedIn company page, and nobody re-checks that the resource still exists. When the LinkedIn page disappeared, the link kept pointing at a name that was free for anyone to claim.

Nothing described in the report validates outbound links. A 404 on a third-party site is invisible to the company's own monitoring unless someone actively crawls the pages and follows every link, which is exactly what the broken link checker does. The report does not say whether the company had any link monitoring in place; the finding itself shows that the dead link survived long enough to be found and claimed.

Impact

As the report puts it, a hacker can post all bad stuff in the name of the company. The company's own site links to that LinkedIn page, so a user who clicks the link is taken to a page controlled by the attacker, presented under the company's name. As the report puts it, a hacker can post all bad stuff in the name of the company, and a user who clicks the link is taken to the attacker's page.

Fix

Variants to test

  1. Crawl every page and JavaScript file of the target for outbound links and check each one for 404 or an unclaimed resource. A positive result is a link in the page source that returns page not found on the third-party service.
  2. Focus on social and brand properties: LinkedIn company pages, Twitter and Facebook handles, YouTube channels, and similar namespaces where a name can be re-registered after it lapses. A positive result is a dead profile URL on the target's site whose name is still available on the platform.
  3. Check for expired links generally, since the takeaway in the report is that expired links can be bought and used to host malicious files. A positive result is a link to a storage or CDN location that no longer exists and whose name can be claimed.
  4. Run the same crawl at greater depth than three levels, and against JavaScript files as well as HTML, because the report notes that expired links may sit in either. A positive result is a dead link that the shallower crawl missed.
  5. Repeat the crawl periodically rather than once, so that links which expire after the initial review are still caught. A positive result is a link that was live at the first pass and returns 404 at a later one.

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. 9 min read.

What happened, in plain words

A security researcher was invited to test a company's systems as part of a private bug bounty program on Bugcrowd. A bug bounty program is a scheme where a company pays people to look for security weaknesses in its systems and report them privately, instead of those weaknesses being found by criminals. "Private" means only invited researchers can take part, and the company's name is kept secret. In this write-up the company is called company.com, and the one subdomain the researcher worked on is called subdomain.company.com.

A subdomain is a smaller part of a company's website, a name that sits in front of the main domain, like shop.example.com next to example.com. Companies often have many of them, for different services, regions or old projects.

The weakness the researcher found was not in a login form or a database. It was in a link. The company's website, on that subdomain, contained a link to the company's LinkedIn page. That link pointed at a LinkedIn address that no longer existed. The researcher was able to create a new LinkedIn company page under the same name that appeared in the dead link. So the dead link could be claimed by anyone who noticed it, and the researcher did exactly that to prove the point.

This kind of weakness is called broken link hijacking. It is closely related to a better-known one, subdomain takeover. In a subdomain takeover, the company has a DNS record (the entry that tells the internet where a name points) aimed at an outside service that no longer holds that name, so someone else can register the name at that service and receive the traffic. In broken link hijacking, the dangling thing is not a DNS record but a hyperlink on a page, pointing at an outside resource that has expired. The report credits a researcher called edoverflow for explaining the technique and links to this post:

Text
https://edoverflow.com/2017/broken-link-hijacking/

That address is a blog post explaining the idea in more detail.

Setup

The only precondition described is access to the private program. The researcher received an invitation to the Bugcrowd program and started by gathering all the subdomains of the company. This is a common first step: the more names a company owns, the more places there are to look. That search produced one subdomain, subdomain.company.com, and that became the target of the link analysis.

The tool used is the broken-link-checker project by stevenvachon, available here:

Text
https://github.com/stevenvachon/broken-link-checker

A link checker is a program that reads a web page, collects every link in it, and then visits each link to see whether it still works. According to the report, this tool collects all the links present in the source code of a website and reports the ones that return a 404 status when followed. A 404 status is the standard answer a web server gives when the page you asked for does not exist: it is the "page not found" message you sometimes see in a browser. No version number of the tool is given.

Finding it

After installing the tool, the researcher ran it against the subdomain. The command used checks for expired links up to the third level:

Bash
blc -rof --filter-level 3 https://example.com/

Line by line, in plain words:

  • blc is the short name of the broken link checker program. Typing it tells the computer to run that tool.
  • -rof is a bundle of short options. The report does not spell out what each letter means, so the safest reading is that they are the tool's own switches for how it runs and reports. You do not need to know them to follow the story.
  • --filter-level 3 is the option that limits how deep the crawl goes. A crawl is the tool following links from page to page, like a person clicking from one page to the next. Level 1 is the page you start on, level 2 is the pages it links to, level 3 is the pages those link to. So this setting tells the tool to look three steps out from the starting page and no further.
  • https://example.com/ is the address to start from. In the report the URL in the command is shown as https://example.com/; the actual target was the subdomain discovered during the earlier search.

Among the results was a link to the company's LinkedIn page that returned a 404 status code, page not found. The researcher opened the link manually to confirm, and it did indeed show page not found. Opening it by hand matters: a tool can be wrong, and a person seeing the error page with their own eyes is stronger evidence. The URL had this shape:

Text
https://www.linkedin.com/company/<company_name>=>404 Not found

Reading that line: https://www.linkedin.com/company/ is the part of LinkedIn's address where company pages live, <company_name> stands for the name of the company as it appeared in the link, and =>404 Not found is the report's note that this address returned the page-not-found answer. So the site was still advertising a LinkedIn company page under a name that no longer existed on LinkedIn. That is the dangling reference: the link is live in the page source, but the resource behind it is gone.

Exploitation

Step 1: Register the abandoned company page name

The next step, as described, was to create a LinkedIn company page using the same company name that appeared in the dead URL. The next step, as described, was to create a LinkedIn company page using the same company name that appeared in the dead URL, in order to take over that page. "Resolve" here simply means what the visitor ends up seeing after clicking: before, an error; after, the researcher's page.

The report does not describe the LinkedIn registration flow, any verification steps LinkedIn required, or the responses returned during that process.

Step 2: Wait for a visitor to follow the link

Once the page existed, any user who clicked the company's LinkedIn link on the subdomain was taken to the attacker-controlled page instead of an error. No change to the target site was needed: the vulnerable link was already published there.

Root cause

The mistake is a stale outbound reference. The website hard-codes a link to a third-party resource, in this case a LinkedIn company page, and nobody re-checks that the resource still exists. "Hard-codes" means the address is written directly into the page rather than looked up fresh each time. When the LinkedIn page disappeared, the link kept pointing at a name that was free for anyone to claim.

Nothing described in the report validates outbound links. A 404 on a third-party site is invisible to the company's own monitoring unless someone actively crawls the pages and follows every link, which is exactly what the broken link checker does. The report does not say whether the company had any link monitoring in place; the finding itself shows that the dead link survived long enough to be found and claimed.

Impact

As the report puts it, a hacker can post all bad stuff in the name of the company. The company's own site links to that LinkedIn page, so a user who clicks the link is taken to a page controlled by the attacker, presented under the company's name. As the report puts it, a hacker can post all bad stuff in the name of the company, and a user who clicks the link is taken to the attacker's page. In other words, the trust a visitor places in the company's website is passed on to whatever the link points at, and in this case that trust was misplaced.

Fix

"Repoint" means changing the link so it goes to a page that does exist, for example the company's current LinkedIn page.

Variants to test

  1. Crawl every page and JavaScript file of the target for outbound links and check each one for 404 or an unclaimed resource. A positive result is a link in the page source that returns page not found on the third-party service. JavaScript files are the program files a website runs in your browser; they can contain links too, which is why they are worth checking alongside ordinary pages.
  2. Focus on social and brand properties: LinkedIn company pages, Twitter and Facebook handles, YouTube channels, and similar namespaces where a name can be re-registered after it lapses. A positive result is a dead profile URL on the target's site whose name is still available on the platform.
  3. Check for expired links generally, since the takeaway in the report is that expired links can be bought and used to host malicious files. A positive result is a link to a storage or CDN location that no longer exists and whose name can be claimed. A CDN is a network of servers that delivers files and pages to users on a company's behalf.
  4. Run the same crawl at greater depth than three levels, and against JavaScript files as well as HTML, because the report notes that expired links may sit in either. A positive result is a dead link that the shallower crawl missed.
  5. Repeat the crawl periodically rather than once, so that links which expire after the initial review are still caught. A positive result is a link that was live at the first pass and returns 404 at a later one.

Glossary

  • Bug bounty program: a scheme where a company pays researchers to find and privately report security weaknesses.
  • Private program: a bug bounty program open only to invited researchers, with the company's identity kept secret.
  • Bugcrowd: the platform that hosted the private program in this report.
  • Subdomain: a smaller name in front of a main domain, such as shop.example.com next to example.com.
  • Subdomain enumeration: the process of finding all the subdomains a company owns.
  • Broken link hijacking: claiming an expired third-party resource that a website still links to, so the link now leads to a page the attacker controls.
  • Subdomain takeover: registering a name at an outside service that a company's DNS record still points at, so traffic for that subdomain goes to the attacker.
  • DNS record: the entry that tells the internet which service a domain name points to.
  • Hyperlink: clickable text or an image on a page that takes you to another address.
  • Dangling reference: a link or record that still exists but points at something that no longer does.
  • 404 status code: the standard web server answer meaning the requested page does not exist, shown to users as "page not found".
  • Link checker: a program that collects the links on a page and visits each one to see whether it still works.
  • Crawl: following links from page to page automatically, the way a person would click through a site.
  • Crawl depth: how many steps away from the starting page a crawl is allowed to go.
  • Hard-coded link: an address written directly into a page rather than looked up fresh each time.
  • Outbound link: a link on a site that points to a different site.
  • JavaScript file: a program file a website runs in your browser, which can also contain links.
  • CDN: a network of servers that delivers files and pages to users on a company's behalf.
  • Repoint: change a link so it goes to a resource that still exists.
  • Impact: the harm that could come from a weakness if someone abused it.

More by Vijaysimha Reddy Bathini

View all

3 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Subdomain takeover

The lesson behind this report.

A company's DNS still points at a cloud service it no longer uses, so anyone can claim it and serve content on the company's domain.