Skip to content
Account takeover Write-up Beginner

[Responsible disclosure] How I could have booked movie tickets through other user accounts

Bharathvaj Ganesan Follow

Published on medium.com

{{media:0}}

Bharathvaj Ganesan, 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. 3 min read.

Context

AGS Cinemas is a theatre chain in Chennai, Tamil Nadu, which launched its own movie ticket booking website and apps in the year before this write-up. The feature at the centre of the report is the forgot password flow on www.agscinemas.com. When a user forgets their password, they open the forgot password popup and enter their phone number. AGS Cinemas then sends a 4 digit code to that phone number, and the user has to enter the code in order to set a new password.

Image for post
“Two CCTV cameras on a gray wall” by Scott Webb on Unsplash From the original on medium.com

The author notes at the top that the vulnerability has been reported and is now fixed.

Setup

The researcher tested against www.agscinemas.com and took over his own account to confirm the flow. No special tooling, roles or versions are described in the report. The precondition is that a target account exists, since the reset flow starts from the phone number entered in the popup.

Finding it

The researcher tried to brute force the 4 digit code (for example 3286) on www.agscinemas.com and was not blocked after even 5-6 invalid attempts. Rate limiting was missing from the forgot password endpoint. A 4 digit code has only 10,000 possible values, so an endpoint that accepts unlimited guesses is effectively guessable.

Exploitation

Step 1: Trigger a reset for the target phone number

Enter the victim's phone number in the forgot password popup. AGS Cinemas sends a 4 digit code to that phone number. The attacker does not need access to the phone; the code is what will be guessed.

Step 2: Brute force the code

The verification request observed by the researcher is:

HTTP
POST /php/otpverify.php HTTP/1.1
Host: www.agscinemas.com

mobile=XXXXXXXXXX&randomnums=XXXX

The request body contains the mobile and randomnums parameters. Because the endpoint did not rate limit, the researcher could keep submitting guesses. Brute forcing randomnums successfully allowed him to set a new password for any AGS Cinemas account.

Step 3: Set a new password and log in

The researcher first took over his own account and was successful in setting a new password for it. He could then use this same password to log into his own hacked account. The same sequence applied to another user gives full access to that account by setting a new password, with no interaction required from the victim.

Root cause

The reset flow uses a 4 digit code, and rate limiting was missing from the forgot password endpoint. With no cap on attempts, the 10,000 value space of a 4 digit code is small enough to exhaust. The report does not describe any expiry, attempt counter or lockout on the code.

Impact

An attacker could take over other users' accounts easily and without any user interaction, by setting a new password through the reset flow. With access to the account, the researcher was able to view ticket history, the credit wallet and other private information. The report does not quantify how many attempts were needed or how long a full brute force would take.

Fix

The issue was reported to MacAppStudio, the technology partner for AGS Cinemas. Suresh Kumar, the CEO, acknowledged the issue promptly and fixed it. The timeline lists the issue as resolved from their side on Feb 24th, 2018. The report does not describe the specific change made.

Disclosure timeline

Date Event
Feb 21st, 2018 Bug was discovered
Feb 22nd, 2018 Report sent to MacAppStudio team
Feb 23rd, 2018 Acknowledged by CEO
Feb 24th, 2018 Issue resolved from their side

Variants to test

  1. Password reset and OTP verification endpoints on other booking and e-commerce sites: submit repeated wrong codes for a single phone number and watch for a lockout, a delay or a block. A positive result is many consecutive invalid attempts accepted without any restriction.
  2. Short numeric codes in general (4 to 6 digits): check whether the code expires and whether a new code invalidates the previous one. A positive result is an old code still being accepted after a new one is issued.
  3. The mobile parameter itself: try changing it between requests while keeping the same code, to see whether the code is bound to the phone number it was issued for. A positive result is a code issued for one number being accepted for another.
  4. Response differences between a wrong code and a correct one: compare status codes, body length and messages. A positive result is a distinguishable response that lets an attacker confirm guesses quickly.

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

What happened, in plain words

AGS Cinemas is a theatre chain in Chennai, Tamil Nadu. The year before this write-up it launched its own website and apps for booking movie tickets. The report looks at one small feature on that website, www.agscinemas.com: the "forgot password" flow.

When you forget your password on most websites, the site needs some way to check that you really are the owner of the account before it lets you choose a new password. AGS Cinemas did this with a phone number. You open the forgot password popup, type in your phone number, and the site sends a 4 digit code to that phone by SMS. You then type the code into the site, and only then can you set a new password.

The problem was that the page which checks the code did not limit how many times you could guess. A 4 digit code has only 10,000 possible values (0000 to 9999). If a website lets you try as many guesses as you like, a computer can simply try them all, one after another, until one works. That is called brute forcing: guessing by trying every possibility rather than by being clever.

With that, the researcher could take over other people's accounts without the victim doing anything at all. He could set a new password on someone else's account and then log in with it. Once inside, he could see the ticket history, the credit wallet and other private information belonging to that person.

The author notes at the top that the vulnerability has been reported and is now fixed.

Image for post
“Two CCTV cameras on a gray wall” by Scott Webb on Unsplash From the original on medium.com

The product and the feature

AGS Cinemas is a cinema chain, and its website lets people book movie tickets. The feature at the centre of the report is the forgot password flow on www.agscinemas.com.

Here is the flow in order:

  1. A user forgets their password and opens the forgot password popup.
  2. The user enters their phone number in the popup.
  3. AGS Cinemas sends a 4 digit code to that phone number by SMS.
  4. The user enters the code on the site.
  5. If the code is right, the user can set a new password.

The code is what the user must enter before setting a new password. If someone else can guess the code, they can pretend to be the owner.

Setting up the test

The researcher tested against www.agscinemas.com and took over his own account to confirm the flow. This is a sensible habit: if you can take over your own account with a technique, you understand the technique, and you have not touched anyone else's data yet.

The only precondition is that the target account exists, since the reset flow starts from the phone number entered in the popup. The report does not describe any special tools, user roles or software versions.

Finding the weakness

The researcher tried to brute force the 4 digit code (for example 3286) on www.agscinemas.com. He was not blocked after even 5-6 invalid attempts. In other words, he could keep sending wrong codes and the site did not block him. Rate limiting was missing from the forgot password endpoint.

Rate limiting is a cap on how often something can be done. Think of a cash machine that swallows your card after three wrong PINs: that is rate limiting. Without it, there is nothing to stop someone from trying again and again.

A 4 digit code has only 10,000 possible values. An endpoint that accepts unlimited guesses is therefore effectively guessable: 10,000 tries is nothing for a script running on a computer.

How the attack worked, step by step

Step 1: Trigger a reset for the target phone number

The attacker enters the victim's phone number in the forgot password popup. AGS Cinemas sends a 4 digit code to that phone number. The attacker does not need access to the phone. The code is what will be guessed.

Step 2: Brute force the code

The verification request the researcher observed is:

HTTP
POST /php/otpverify.php HTTP/1.1
Host: www.agscinemas.com

mobile=XXXXXXXXXX&randomnums=XXXX

Line by line, in plain words:

  • POST /php/otpverify.php HTTP/1.1 is the request the browser sends to the server. POST means "here is some data for you to process". /php/otpverify.php is the address of the page on the server that checks the code. HTTP/1.1 is the version of the language browsers and servers use to talk to each other.
  • Host: www.agscinemas.com tells the server which website the request is for. One server can host many websites, so the request has to say which one it wants.
  • The empty line separates the headers (the labels at the top) from the body (the data itself).
  • mobile=XXXXXXXXXX&randomnums=XXXX is the body. It is a list of name and value pairs joined by &. The body contains the mobile and randomnums parameters. The X characters stand in for the real values, which are not shown in the report.

Because the endpoint did not rate limit, the researcher could keep submitting guesses. Brute forcing randomnums successfully allowed him to set a new password for any AGS Cinemas account.

An endpoint here just means one address on the server that does one job, like a service window in a building: you go to the window for code checks, and it either accepts or rejects what you hand over.

Step 3: Set a new password and log in

The researcher first took over his own account and was successful in setting a new password for it. He could then use this same password to log into his own hacked account. The same sequence applied to another user gives full access to that account by setting a new password, with no interaction required from the victim. The victim does not have to click a link or approve anything; the attacker does all of it from the outside.

Why it worked

The reset flow uses a 4 digit code, and rate limiting was missing from the forgot password endpoint. With no cap on attempts, the 10,000 value space of a 4 digit code is small enough to exhaust. The report does not describe any expiry, attempt counter or lockout on the code.

What an attacker could do with it

An attacker could take over other users' accounts easily and without any user interaction, by setting a new password through the reset flow. With access to the account, the researcher was able to view ticket history, the credit wallet and other private information. The report does not quantify how many attempts were needed or how long a full brute force would take.

How it was fixed

The issue was reported to MacAppStudio, the technology partner for AGS Cinemas. Suresh Kumar, the CEO, acknowledged the issue promptly and fixed it. The timeline lists the issue as resolved from their side on Feb 24th, 2018.

The author also remarks that not every company reacts this way, and that many people in his position would have been challenged for testing a site without permission. The post is framed as a responsible disclosure: the researcher reported the issue and it was fixed.

Disclosure timeline

Date Event
Feb 21st, 2018 Bug was discovered
Feb 22nd, 2018 Report sent to MacAppStudio team
Feb 23rd, 2018 Acknowledged by CEO
Feb 24th, 2018 Issue resolved from their side

Similar things to look for elsewhere

These are the same checks, written for someone who is learning. Each one is a question you can ask of a site you are allowed to test.

  1. Password reset and code verification pages on other booking and e-commerce sites: submit repeated wrong codes for a single phone number and watch for a lockout, a delay or a block. A positive result is many consecutive invalid attempts accepted without any restriction.
  2. Short numeric codes in general (4 to 6 digits): check whether the code expires and whether a new code invalidates the previous one. A positive result is an old code still being accepted after a new one is issued.
  3. The mobile parameter itself: try changing it between requests while keeping the same code, to see whether the code is bound to the phone number it was issued for. A positive result is a code issued for one number being accepted for another.
  4. Differences in the reply between a wrong code and a correct one: compare status codes, body length and messages. A positive result is a distinguishable reply that lets an attacker confirm guesses quickly.

Glossary

  • Brute force: guessing a secret by trying every possible value, usually with a script, instead of reasoning about it.
  • Rate limiting: a cap on how many requests a server will accept in a period of time, or after a number of failures.
  • Endpoint: one address on a server that performs one job, such as checking a code.
  • Forgot password flow: the sequence of pages a site shows when a user cannot log in and needs to set a new password.
  • OTP (one-time password): a short code, here 4 digits, sent to a phone and meant to be used once to prove ownership.
  • HTTP request: the message a browser sends to a server to ask for something or submit data.
  • POST: an HTTP method used to send data to the server for it to process.
  • Header: a label at the top of an HTTP request or response, such as Host, carrying information about the message.
  • Body: the part of an HTTP request that carries the actual data, here the mobile and randomnums values.
  • Parameter: a named value sent with a request, such as mobile or randomnums.
  • Account takeover: gaining control of someone else's account, for example by setting a new password on it.
  • Responsible disclosure: telling the owner of a system about a security problem privately and giving them time to fix it before publishing details.
  • Vulnerability: a weakness in a system that someone can use to make it behave in a way its owner did not intend.

Similar reports

View all

Same bug class and techniques, clearest first.

Account takeover

The lesson behind this report.

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.