Skip to content
Access control Write-up Intermediate

#BugBounty — Rewarded by securing vulnerabilities in Bookmyshow (India’s largest online movie & event booking portal)

The application was vulnerable to a Host Header attack, allowing redirection to a malicious site and web cache poisoning. Additionally, an access control flaw allowed any user to edit another user's experience by modifying the URL to include a 'create' parameter.

Avinash Jain Follow

Published on medium.com

#### Avinash Jain (@logicbomb1)

Avinash Jain (@logicbomb_1), 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

BookMyShow is described in the report as India's largest online movie and event booking portal. Two separate issues are covered: a Host header attack on the main site, and an access control flaw in the "experiences" feature.

The experiences feature lets a logged-in user share their experiences. Each experience has an ID, and the public URL for an experience follows this pattern:

Text
https://in.bookmyshow.com/national-capital-region-ncr/experiences/{Username}/test-hacked/5ab1284834e4ab0065ade267

In the example above the username segment is the author's handle and the trailing value is the experience ID. Because any visitor can read other users' experiences, the IDs of other users are visible in normal browsing, so no brute forcing is needed to obtain them.

Setup

The report does not describe any special tooling, accounts or versions. The researcher created his own experience to learn the parameters the application uses, and changed the Host header value in a request. The only precondition for the second issue is a logged-in account that can create an experience, plus the ID of a victim's experience, which is public.

Finding it

The first issue was noticed on the main site: the application built redirects from the value of the Host header in the request. Changing that header to an arbitrary domain produced a 301 whose Location followed the supplied value. The unvalidated value could also end up in the web cache, though the cache was flushed very quickly, so the poisoning was not persistent or effective.

The researcher notes that the cache was flushed very quickly, so the poisoning was neither persistent nor effective, and the issue did not get the expected attention from the BookMyShow security team. He resumed hunting and turned to the experiences feature, where the URL structure and the create parameter caught his attention.

Exploitation

Step 1: Host header redirection

The original request to the site was vulnerable to a Host header attack. The researcher changed the Host header value to goal.com. The response was a 301 redirection, and the location to which the application redirected depended on the value of the Host header in the request.

Image for post
Host Header Attack — Original Page From the original on medium.com

The screenshot shows the original page and request before modification.

Image for post
Host Header Attack — Changed host header value From the original on medium.com

The second screenshot shows the request with the changed host header value and the 301 response pointing at the supplied domain.

Image for post
Host Header Attack — Successful redirection From the original on medium.com

The third screenshot shows the successful redirection to goal.com.

Step 2: Web cache poisoning

Because the value was not validated on the server, the redirect could also be stored in the web cache. Whenever a user visited bookmyshow.com, they were redirected to the given malicious or phishing site. The researcher is explicit about the limitation: the web cache was flushed very quickly, so the poisoning was not persistent and not effective.

Step 3: Reaching another user's experience

The experiences feature exposes each experience under a URL containing its ID, and any user can see any other user's experience ID simply by reading their experiences. The researcher created his own experience to learn the parameters the application uses, and found the create parameter there. He then modified the link by adding that parameter in front of the victim's experience ID:

Text
https://in.bookmyshow.com/national-capital-region-ncr/experiences/create/{victim experience id}

Accessing that URL gave complete control over someone else's experience: he could edit the name, upload any image and write any description.

Image for post
User Experience page From the original on medium.com

The screenshot shows the user experience page that hosts the shared experiences.

Root cause

The Host header issue is a classic case of the application trusting a client-supplied header when constructing absolute URLs for redirects, without validating it against the expected hostname. The report does not describe any allow-list or other defence. The cache poisoning follows from the same missing validation: the unvalidated value ended up in a cached response.

The experience issue is an access control failure. The application allowed editing of an experience identified by the following segment.

Impact

With the Host header attack, an attacker could redirect visitors of bookmyshow.com to a malicious or phishing site, and the redirect could be served from the web cache. The practical impact was limited because the cache was flushed very quickly, so the poisoning was not persistent.

With the experience flaw, an attacker who knows a victim's experience ID, which is public, can take complete control of that experience: change its name, upload images and write descriptions.

Fix

The report states that the bug was marked fixed on 10-Jan-2018 and that the researcher re-tested and confirmed the fix on the same day. For the Host header issue, the fix would be to validate the header against the expected hostname before using it in redirects and before caching the response. For the experience issue, the fix would be to check on the server that the authenticated user owns the experience identified in the URL before allowing edits.

Variants to test

  1. Send a request with a modified Host header to any endpoint that issues redirects or builds absolute links, and look for a 301 or 302 whose Location reflects the supplied value. A positive result is a redirect to a domain you control.
  2. Repeat the same request against cacheable responses and then request the page without the modified header. A positive result is the poisoned redirect being served from the cache to a normal request.
  3. On features with object IDs in the URL, try inserting path segments seen in your own create or edit flows in front of another user's object ID, as with create/{id} here. A positive result is an edit form or write action for an object you do not own.
  4. Compare the URL used to create your own object with the URL used to view someone else's, and test whether the create or edit path accepts a foreign ID. A positive result is that the application loads or saves changes to the foreign object.

Timeline

Date Event
27-Nov-2017 Bug reported to the company
10-Jan-2018 Bug marked fixed
10-Jan-2018 Re-tested and confirmed the fix
22-Jan-2018 Rewarded by the company

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

What happened, in plain words

A security researcher found two separate problems in BookMyShow, described in the report as India's largest online movie and event booking portal. The first was a way to make the site send visitors to another website of the attacker's choosing, by changing a small piece of information that a browser normally sends with every request. The second was a way to take control of any other user's "experience" (a kind of shared post) by editing the web address used to view it. The researcher reported the issues, the bug was marked fixed, and he was rewarded.

This article walks through what he did, in the order he did it, explaining each idea from scratch. You only need to know how to use a browser and a computer to follow along.

Background: what BookMyShow and its "experiences" are

BookMyShow is a website where people book cinema tickets and events. The report focuses on two parts of it.

The first is the main website itself, which is what you see when you visit bookmyshow.com.

The second is a feature called "experiences". Any logged-in user can share an experience, which is a bit like a public post: it has a name, an image and a description. Each experience gets its own web address, and anyone can read anyone else's experience. That public nature matters later.

The first problem: Host header attack

What a request and a Host header are

When you type a web address into your browser and press Enter, your browser sends a request to a web server. Think of it like posting a letter: the request has an envelope with some information on it, and a body with the contents. One of the pieces of information on the envelope is the Host header. It tells the server which website name you were trying to reach, for example bookmyshow.com. A single server can host many websites, so the server uses this header to know which one to serve.

Normally your browser fills in the Host header automatically from the address you typed. But it is just text in the request, and someone using special tools can change it before the request is sent. That is what a proxy is for: a program that sits between your browser and the server, letting you see and edit requests. The report does not name any specific proxy tool.

What a redirect is

A redirect is the web's way of saying "not here, go there instead". When a server wants to send you to a different address, it replies with a status code, often 301 (permanent redirect) or 302 (temporary redirect), and a Location header containing the address to go to. Your browser then automatically requests that new address. This is normal and useful: for example, if a site moves to a new domain, it can redirect visitors.

What a Host header attack is

A Host header attack happens when a website trusts the Host header from the request without checking it. If the site builds a redirect or a link using whatever value is in that header, an attacker can put their own domain there and make the site send visitors to it. The everyday comparison: imagine a receptionist who forwards your call to whatever number you write on a sticky note, without checking whether the note is genuine. You could write any number and the receptionist would dial it.

What the researcher did

He sent a normal request to bookmyshow.com and then changed the Host header value to goal.com. The server responded with a 301 redirect, and the address it told the browser to go to was based on the Host header value he had supplied. In other words, the site was willing to redirect visitors to any domain written in that header.

Image for post
Host Header Attack — Original Page From the original on medium.com

The first screenshot shows the original page and the original request, before any change. This is the baseline: what a normal visit looks like.

Image for post
Host Header Attack — Changed host header value From the original on medium.com

The second screenshot shows the same request with the Host header changed, and the 301 response pointing at the domain he supplied.

Image for post
Host Header Attack — Successful redirection From the original on medium.com

The third screenshot shows the browser actually arriving at goal.com, confirming the redirect worked.

What web cache poisoning is

A web cache is a storage layer that sits in front of a website to make it faster. When many people ask for the same page, the cache keeps a copy and serves it to the next visitors without bothering the server each time. Think of it like a photocopy left by the printer: the next person who needs that page takes the copy instead of printing again.

Web cache poisoning is when an attacker manages to get a harmful response stored in that cache. Then every visitor who asks for the page gets the harmful copy, even if they did nothing wrong. In this case, because the redirect was built from the unvalidated Host header, the redirect could be stored in the cache. Whenever a user visited bookmyshow.com, they would be redirected to the malicious or phishing site.

A phishing site is a fake website that looks like the real one, designed to trick you into typing your password or payment details. Redirecting visitors there is the danger.

However, the researcher is clear about the limitation: the web cache was flushed (emptied) very quickly, so the poisoned copy did not last. The attack was not persistent and not effective, and it did not get the attention he expected from the BookMyShow security team. That is why he went looking for something else.

The second problem: taking over someone else's experience

What an ID is

An ID is a unique identifier. In a database, every item gets one so it can be told apart from all others. In a web address, an ID often appears as a long string of letters and numbers at the end. For example, in the address below, the last part is the ID of a particular experience:

Text
https://in.bookmyshow.com/national-capital-region-ncr/experiences/{Username}/test-hacked/5ab1284834e4ab0065ade267

In this example, the {Username} part is the author's handle, and 5ab1284834e4ab0065ade267 is the experience ID. The report uses this pattern to show how experiences are addressed.

Because anyone can read anyone else's experience, the IDs of other users are visible in normal browsing. You do not need to guess them or use brute force (trying many possibilities until one works). You just look at the address of an experience you can already see.

What an access control flaw is

Access control is the part of a website that decides who is allowed to do what. For example, only the author of an experience should be able to edit it. An access control flaw is when that decision is made incorrectly, so someone who should not have permission can do the action anyway.

A common kind is called IDOR, short for Insecure Direct Object Reference. It means the website uses an ID from the address to find an item, but does not check whether the person making the request is allowed to access that item. The everyday comparison: a hotel gives you a key card for room 101. If the door lock only checks that the card is a valid hotel card, and not that it is for room 101, then any guest could open any room. The ID (room number) is in the address, and the check is missing.

How he found the parameter

The researcher created his own experience to learn how the feature works. He created his own experience and found that the application uses a parameter called create. A parameter is a piece of information in a request, often visible in the address, that tells the site what to do. He then modified the link by adding that parameter in front of the victim's experience ID:

Text
https://in.bookmyshow.com/national-capital-region-ncr/experiences/create/{victim experience id}

Here, {victim experience id} stands for the ID of the experience he wanted to access, which he could see from the public page. The create part is the parameter he learned from his own flow.

What happened when he visited that address

Accessing that URL gave him complete control over someone else's experience. He could edit the name, upload any image and write any description. In other words, the site let him edit an experience he did not own.

Image for post
User Experience page From the original on medium.com

The screenshot shows the user experience page where shared experiences are displayed. This is the feature he was targeting.

Why it worked

The Host header issue is a case of the application trusting a value supplied by the client (the Host header) when building absolute URLs for redirects, without checking it against the expected hostname. The report does not describe any allow-list or other defence. The cache poisoning follows from the same missing validation: the unvalidated value ended up in a cached response.

The experience issue is an access control failure. The application allowed editing of an experience identified by the following segment.

What the impact was

With the Host header attack, an attacker could redirect visitors of bookmyshow.com to a malicious or phishing site, and the redirect could be served from the web cache. The practical impact was limited because the cache was flushed very quickly, so the poisoning was not persistent.

With the experience flaw, an attacker who knows a victim's experience ID, which is public, can take complete control of that experience: change its name, upload images and write descriptions.

How it was fixed

The report states that the bug was marked fixed on 10-Jan-2018 and that the researcher re-tested and confirmed the fix on the same day. For the Host header issue, the fix would be to validate the header against the expected hostname before using it in redirects and before caching the response. For the experience issue, the fix would be to check on the server that the authenticated user owns the experience identified in the URL before allowing edits.

Similar things to test

  1. Send a request with a modified Host header to any endpoint that issues redirects or builds absolute links, and look for a 301 or 302 whose Location reflects the supplied value. A positive result is a redirect to a domain you control.
  2. Repeat the same request against cacheable responses and then request the page without the modified header. A positive result is the poisoned redirect being served from the cache to a normal request.
  3. On features with object IDs in the URL, try inserting path segments seen in your own create or edit flows in front of another user's object ID, as with create/{id} here. A positive result is an edit form or write action for an object you do not own.
  4. Compare the URL used to create your own object with the URL used to view someone else's, and test whether the create or edit path accepts a foreign ID. A positive result is that the application loads or saves changes to the foreign object.

Timeline

Date Event
27-Nov-2017 Bug reported to the company
10-Jan-2018 Bug marked fixed
10-Jan-2018 Re-tested and confirmed the fix
22-Jan-2018 Rewarded by the company

Glossary

  • Host header: A piece of information in a web request that tells the server which website name the browser is trying to reach.
  • Redirect: A response from a server that tells the browser to go to a different address instead.
  • 301: A status code meaning a permanent redirect.
  • 302: A status code meaning a temporary redirect.
  • Location header: The part of a redirect response that contains the address to go to.
  • Proxy: A program that sits between your browser and a server, letting you see and change requests.
  • Web cache: A storage layer that keeps copies of web pages so they can be served faster to many visitors.
  • Web cache poisoning: Tricking a web cache into storing a harmful response that is then served to other visitors.
  • Phishing site: A fake website that looks real, designed to steal information such as passwords.
  • ID: A unique identifier for an item, often a long string of letters and numbers.
  • Access control: The part of a website that decides who is allowed to do what.
  • IDOR (Insecure Direct Object Reference): A flaw where a website uses an ID from the address to find an item but does not check whether the requester is allowed to access that item.
  • Parameter: A piece of information in a request, often visible in the address, that tells the site what to do.
  • Brute force: Trying many possibilities until one works, such as guessing IDs.
  • Allow-list: A list of values that are explicitly permitted; anything not on the list is rejected.

More by Avinash Jain

View all

29 more disclosed reports, best first.

More from BookMyShow

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.