Skip to content
Access control Write-up Beginner

30-Minute Heist: How I Bagged a $1500 Bounty in Just few Minutes!

A user whose administrator role was revoked could still change business details because the page was not refreshed and the server did not re-check permissions. An attacker with a previously elevated account could make unauthorised changes to the organisation.

Charlie : The Hacker Follow

Published on medium.com

Bounty$1,500 View original

It’s me, Charlie, the hacker, but my real name is Rajiv. After taking a break from my stock trading career, I decided to resume hunting for vulnerabilities in a few programs.

Charlie : The Hacker, 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. 4 min read.

Context

The target was a private Bugcrowd program, described as a brand new program to which only 18 to 20 researchers were invited. The researcher does not name the program and refers to it throughout as redacted.com. The product is a platform where a business can be hosted and its employees managed in one place: employees can start a shift or a meeting, and the owner can decide breaks for any employee directly from the owner account. The platform gives users different kinds of permission and benefits from the owner or admin account, and an admin can change the role of any other user among a few given roles with some extra allowance features.

From the original on medium.com

The researcher classifies the bug as broken access control.

Setup

The researcher's usual approach for logic bugs is to create two accounts with different email addresses and to work with multiple tabs and browsers. For this program he did the same:

  1. Two accounts, each registered with a different email address.
  2. Each account opened in a different browser, so that both sessions stay live at the same time.
  3. The first account acts as the business owner and main admin; the second is invited as a normal employee.

No specific tools or versions are mentioned beyond the two browsers.

Finding it

While exploring the platform the researcher noticed that the employee access level is enforced in the interface: as a normal employee you cannot change anything in the business, such as the business name and settings, and you only see some limited access. That is described as a feature.

When the admin promotes the employee to System administrator, the extra admin features appear after a page refresh, and the promoted user can change all the details in the business but still cannot invite anyone. The interesting question was what happens to that already rendered page when the admin takes the promotion away again. The answer was that the page keeps working with the old, higher privileges, so an employee whose access level has been reduced can still make changes to the organisation. The researcher classifies this as broken access control.

Exploitation

Step 1: create the business

Sign up and create a business profile in redacted.com. This account is the main admin and owner.

Step 2: invite a second user

Invite a second user to the business with the normal employee access level.

Step 3: accept the invitation in the second browser

Accept the invitation as the second user in the second browser. As an employee you cannot change anything in the business, such as the business name and settings; this is a feature. You can only see some limited access.

Step 4: promote the employee

Go to the admin account in browser 1 and change the employment level access of the second user to System administrator.

Step 5: refresh the employee page

Refresh the page of user 2. The extra admin features for this access level are now visible, and the user can change all the details in the business, but cannot invite anyone.

Step 6: demote the employee

Go back to the main admin account and change the access level back to the old employee access level. The user is set back to his original access level.

Step 7: act without refreshing

Do not refresh the page of the user 2 browser, and try to change the business name and save. The change succeeds: in the admin account the name is changed, and the admin can see that an unauthorised person from the business employees changed the business name.

From the original on medium.com

The report does not include the HTTP requests or responses for any of these steps, so the exact endpoints, parameters and status codes are not shown here.

Root cause

The report does not explain the underlying cause; it notes there is no time out session stuff in the second user account page. When the employee was promoted, the page was refreshed and picked up the System administrator capabilities. When the admin demoted the user, the server-side role changed, but the already loaded page in the second browser kept its elevated view and, apparently, its ability to submit changes. The researcher also notes that there is no time out session stuff in the second user account page. In other words, the demotion did not invalidate or downgrade the existing session or page state, and the change request was accepted without a fresh check of the user's current employment access level.

Impact

According to the researcher, this puts the business admin at major risk: an unauthorised person from the business employees can change the business name and, by extension, all other things in the business, which creates various impact in the organisation and in the business.

Fix

  1. Promote a user, let them load the admin page, then demote them and submit a change from the stale page. A positive result is the change being saved after the demotion.
  2. Remove a user from the business entirely while their page is open, then have them submit a business change. A positive result is the change being accepted for a user who is no longer a member.
  3. Change a role from one privileged role to another with different permissions and submit an action that only the old role allowed. A positive result is the action succeeding under the new role.
  4. Keep the stale page open for an extended period after the demotion and retry. A positive result is the change still being accepted, which would show the session is never revalidated.
  5. Repeat the same sequence on other objects the role controls, such as employee records or break settings, to see whether the stale authorisation applies beyond the business name.

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 a way for an employee to keep making changes to a company's account after the company owner had taken that employee's special permissions away. The employee only had to leave their browser tab open. The owner would promote them to administrator, the employee would load the admin page, then the owner would demote them back to a normal employee. Even after the demotion, the employee's still-open page could still save changes to the business, such as renaming it. The researcher found the bug on a private bug bounty program and says he earned around $1500.

This article walks through the whole story from the beginning, assuming you have never done security testing before. You only need to know how to use a browser.

The setting: a private bug bounty program

A bug bounty program is an arrangement where a company invites people to look for security problems in its software and pays for good reports. Some programs are public, meaning anyone can join. Others are private: the company invites a small, chosen group of researchers. The researcher here, who writes under the name Charlie, says he was invited to a brand new private program on Bugcrowd, and that only 18 to 20 people were invited.

He does not name the program, and refers to it throughout as redacted.com. That is a placeholder, not a real website address.

From the original on medium.com

The product is a platform for businesses. A company can create a profile on it and manage its employees in one place. Employees can start a shift or a meeting, and the owner can decide breaks for any employee directly from the owner account. The platform gives users different kinds of permission and benefits from the owner or admin account. An admin can change the role of any other user among a few given roles, each with some extra allowance features.

In plain terms: think of a shared document where the owner can make someone an editor and later take that away. The question the researcher asked was: what happens to the person who already has the editor page open when the owner takes the editor rights away?

The kind of bug: broken access control and a logic flaw

Two terms appear here.

Access control is the part of a system that decides who is allowed to do what. When a normal employee cannot rename the business, that is access control working. Broken access control means that decision can be bypassed: someone does something they should not be allowed to do.

A logic flaw is a mistake in the rules of the application rather than in its technical plumbing. The program does what it was told, but the rules it was told are wrong. A simple comparison: a door that locks correctly is fine, but if the rule says "anyone holding yesterday's key can still enter", the lock is not broken, the rule is.

The report classifies the bug as broken access control.

Setting up: two accounts, two browsers

The researcher's usual method for hunting logic bugs is simple and needs no special tools:

  1. Create two accounts, each registered with a different email address.
  2. Open each account in a different browser, so that both stay logged in at the same time.
  3. Use the first account as the business owner and main admin, and invite the second as a normal employee.

Why two browsers rather than two tabs? Because a website often stores your login in a cookie, a small piece of data the browser keeps and sends back with every request. If you log into two accounts in the same browser, the second login can overwrite the first, and you end up acting as the wrong user without noticing. Two separate browsers keep the two logins apart. The researcher also mentions using multiple tabs and browsers generally, but for this program the setup was the two accounts above. No other tools or versions are mentioned.

Finding it

While exploring the platform, the researcher noticed that the employee access level is enforced in the interface. As a normal employee you cannot change anything in the business, such as the business name and settings, and you only see some limited access. The report calls that a feature, meaning it is intended behaviour, not a bug.

When the admin promotes the employee to System administrator, the extra admin features appear after a page refresh. The promoted user can then change all the details in the business, but still cannot invite anyone.

The interesting question was what happens to that already loaded page when the admin takes the promotion away again. The answer: the page keeps working with the old, higher privileges. An employee whose access level has been reduced can still make changes to the organisation. The researcher classifies this as broken access control.

Reproducing it, step by step

Each step below is followed by why it was taken.

Step 1: create the business

Sign up and create a business profile in redacted.com. This account is the main admin and owner. You need an owner account because only the owner can hand out and take back roles, and the whole test depends on doing both.

Step 2: invite a second user

Invite a second user to the business with the normal employee access level. Starting the second user as a plain employee gives you a baseline: you can first confirm what they cannot do, then watch what changes when their role changes.

Step 3: accept the invitation in the second browser

Accept the invitation as the second user in the second browser. As an employee you cannot change anything in the business, such as the business name and settings; this is a feature. You can only see some limited access. This confirms the normal, correct behaviour before you try to break it.

Step 4: promote the employee

Go to the admin account in browser 1 and change the employment level access of the second user to System administrator. This is the setup for the trick: the employee's page must first be loaded while they hold the higher role.

Step 5: refresh the employee page

Refresh the page of user 2. The extra admin features for this access level are now visible, and the user can change all the details in the business, but cannot invite anyone. The refresh matters because it makes the page pick up the new role. The page now contains the admin controls, and the browser holds whatever state goes with them.

Step 6: demote the employee

Go back to the main admin account and change the access level back to the old employee access level. The user is set back to his original access level. On the server, the employee is now a normal employee again. The question is whether the page still open in browser 2 knows that.

Step 7: act without refreshing

Do not refresh the page of the user 2 browser, and try to change the business name and save. The change succeeds: in the admin account the name is changed, and the admin can see that an unauthorised person from the business employees changed the business name.

From the original on medium.com

This is the moment the bug shows itself. The demotion was real, but the already loaded page in browser 2 kept its elevated view and, apparently, its ability to submit changes. The report does not include the HTTP requests or responses for any of these steps, so the exact endpoints, parameters and status codes are not shown here.

Why it happens

When you use a website, your browser sends requests to a server, the computer that holds the data and decides what to do with it. An API is the set of addresses on that server that the page talks to, for example "save the business name". Each request should be checked by the server against who you are right now.

The report does not explain the underlying cause; it notes there is no time out session stuff in the second user account page. When the employee was promoted, the page was refreshed and picked up the System administrator capabilities. When the admin demoted the user, the server-side role changed, but the already loaded page in the second browser kept its elevated view and, apparently, its ability to submit changes. The researcher also notes that there is no time out session stuff in the second user account page. In other words, the demotion did not invalidate or downgrade the existing session or page state, and the change request was accepted without a fresh check of the user's current employment access level.

A comparison: a hotel key card that is cancelled at the front desk still opens the door if the door's reader only checked the card when it was first issued. The fix is to check the card at the door, every time.

Impact

According to the researcher, this puts the business admin at major risk: an unauthorised person from the business employees can change the business name and, by extension, all other things in the business, which creates various impact in the organisation and in the business. The report does not describe any further actions beyond changing the business name.

Fix

Variants to test

  1. Promote a user, let them load the admin page, then demote them and submit a change from the stale page. A positive result is the change being saved after the demotion.
  2. Remove a user from the business entirely while their page is open, then have them submit a business change. A positive result is the change being accepted for a user who is no longer a member.
  3. Change a role from one privileged role to another with different permissions and submit an action that only the old role allowed. A positive result is the action succeeding under the new role.
  4. Keep the stale page open for an extended period after the demotion and retry. A positive result is the change still being accepted, which would show the session is never revalidated.
  5. Repeat the same sequence on other objects the role controls, such as employee records or break settings, to see whether the stale authorisation applies beyond the business name.

Glossary

  • Bug bounty program: an arrangement where a company pays researchers for reporting security problems in its software.
  • Private program: a bug bounty program open only to invited researchers.
  • Bugcrowd: a platform that hosts bug bounty programs.
  • Researcher: the person looking for security problems and reporting them.
  • Access control: the part of a system that decides who is allowed to do what.
  • Broken access control: a flaw where that decision can be bypassed, so someone does something they should not be allowed to do.
  • Logic flaw: a mistake in the rules of an application rather than in its technical plumbing.
  • Admin / administrator: a user with the highest level of permission in an account.
  • Role: a named set of permissions, such as normal employee or System administrator.
  • Promote / demote: to give a user a higher role, or to take it back and return them to a lower one.
  • Session: the period during which a website remembers that you are logged in, and the data it keeps about you for that period.
  • Cookie: a small piece of data a website stores in your browser and receives back with each request, often used to keep you logged in.
  • Server: the computer that holds the data and decides how to handle each request.
  • API: the set of addresses on a server that a page talks to, for example to save a change.
  • Endpoint: one specific address in that API.
  • Parameter: a named value sent with a request, such as a new business name.
  • Status code: a number in a server's reply saying how the request went, such as success or refusal.
  • Request / response: a message your browser sends to a server, and the reply it gets back.
  • State-changing request: a request that alters data, such as renaming a business, as opposed to one that only reads it.
  • Stale page: a page left open in the browser that still shows information or controls from an earlier moment.
  • Session invalidation: ending or downgrading an existing session so that it can no longer be used with old privileges.
  • Revalidation: checking again, at the moment of an action, that the user still has the permission they had before.
  • Time out: automatically ending a session after a period of inactivity.
  • Refresh: reloading a page in the browser so it fetches current data from the server.
  • Reproduce: to follow a set of steps and get the same result, confirming the bug is real.
  • Impact: the harm a bug could cause if someone abused it.
  • N/A: "not applicable", a report a program decides is not a valid or payable issue.
  • Duplicate: a report for a bug that someone else already reported first.

More by Charlie : The Hacker

View all

1 more disclosed report, best first.

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.