How i found 8 vulnerabilities in 24h?
The report describes eight access-control flaws in a team collaboration platform, where lower-privileged roles could perform actions reserved for the team owner, such as changing subscription plans, editing or deleting other users' comments, duplicating maps, modifying customisations and settings, sending insights despite being disabled, and reading feature data. An attacker with a low-privilege account could abuse these gaps to manipulate data and access information they should not have.
Published on 0xm5awy.medium.com
Bug Bounty
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
This write-up covers eight logic and broken access control issues found in a single web application during a 24-hour period. The researcher, Mohamed Anani (@0xM5awy), describes it as the second part of an earlier write-up on business logic and broken access control bugs; the first part only listed bug titles, while here every vulnerability is explained with reproduction steps.
The product is a team-based application with maps, plans/subscriptions, comments, customisations, team settings, insights and a feature board. The report refers to the target as the "0xM5awy.com program" and uses that host in its example URLs. The application has a free three-month trial during which a team can switch between plans freely, after which a plan is purchased.
Setup
The report describes four roles on the program. The numbering in the original is inconsistent (it says "3 roles" and then lists four), but the roles themselves are clear:
- admin with access: can edit, delete and post everything.
- admin without access: can do the same things as admin with access but less.
- assistant: can access fewer endpoints than admin without access but can post some things.
- Viewer: can access fewer endpoints than the Contributor and can only view.
The tooling is an intercepting proxy: requests are captured and replayed in Repeater. The core precondition for most of the bugs is having two accounts with different roles, one privileged account to capture a legitimate request and one lower-privileged account to replay it.
Finding it
The researcher's method is consistent across all eight bugs: perform an action with the privileged role, capture the exact method, endpoint and body, then replay the same request from a lower-privileged account. The bugs looked wrong because the UI hides or blocks the action for the lower role, but the server-side endpoint does not enforce the same restriction. In several cases the lower role gets a blank page or a 401/403 when browsing to the feature, yet the underlying API still accepts the request.
Exploitation
1. Changing the subscription plan as admin without access or assistant
Only the admin with access is supposed to be able to edit the team's plan. The researcher captured the plan change from the privileged account and replayed it from the lower roles.
- Open the admin with access account and change the plan to another plan (there are three plans).
- Copy the endpoint and the body of the request:
PUT /api/plans
{"plan_id":1}
- Open the admin without access or assistant account, make any request, intercept it and send it to Repeater.
- Replace the request with the
PUT /api/plansmethod and endpoint and the body above. - The plan change succeeds. By changing the
plan_idvalue, the assistant and admin without access can move the team between plans.
2. Editing and deleting other users' comments
Comments behave like Facebook comments: only the owner of a comment should be able to edit or delete it. The researcher found that changing the comment ID in the request to another user's comment ID let him delete and edit that comment.
- Open two accounts with any roles (admin with or without access, or assistant).
- Create two comments, one with each account.
- From the attacker account, delete your own comment and intercept the request.
- Change the ID of your comment to the victim's comment ID.
- The victim's comment is deleted.
- Using the
PUTmethod instead of the delete method allows editing the victim's comment in the same way.
3. Creating more than one map on the Pro Plan
The Pro Plan allows only one map; creating more requires an upgrade. The researcher captured a map creation request from an account on the professional plan and replayed it from an account on the Pro Plan.
- Open the account with the professional plan, create a map and intercept the request.
- Copy the method, endpoint and body of the request.
- Open the account with the Pro Plan and make any request.
- Replace the method, endpoint and body with the professional plan request.
- The request succeeds, so the Pro Plan account can create as many maps as it wants rather than only one.
4. Duplicating maps as admin without access or assistant
Only the admin with access should be able to duplicate maps. The researcher turned the map retrieval request into a duplication request.
-
Open the map to duplicate with either of the two lower roles.
-
Make a GET request, intercept it and send it to Repeater.
-
Add the word
Duplicateto the endpoint before/api/map/20500, giving/api/map/20500/duplicate, change the GET method to POST and add{}as the body: -
Send the request and the map is duplicated.
5. Managing customisations as admin without access
When the admin without access opens the /customization endpoint, the application returns a blank page or a 401 Unauthorized. The researcher captured the customisation requests from the privileged account and replayed them.
- Open the admin with access account, create a new customisation and edit, rename and delete it, saving all these requests in Repeater.
- Open the admin without access account and try all these endpoints, methods and bodies with it.
- The lower role can add, edit, rename and delete customisations.
6. Editing team settings as admin without access
The admin without access can see the team settings but cannot edit them. The researcher captured the settings requests from the privileged account and replayed them.
- From the admin with access account, edit the team settings, intercept the requests and send them to Repeater.
- From the admin without access account, make any request and send it to Repeater.
- Try all the settings endpoints saved from the privileged account.
- The lower role can edit, rename and delete the settings.
7. Sending insights when the feature is disabled, and as other users or organisations
The admin can turn off the option that lets Viewers submit user insights about maps. With the option off, the Viewer role should not be able to send insights. The researcher captured a legitimate insight submission and modified its body.
- From the Viewer account, open any map where the admin allows insights, send an insight, intercept the request and send it to Repeater.
- The endpoint and body look like this:
POST /api/maps/1626
{"note":{"name":"0xM5awy","content":"i can send nots","owner_id":null,"customer_id":11501634}}
- Changing
customer_idallows sending insights as any user, changingorganization_idallows sending them as any organisation, and changing the map ID in/api/maps/1626allows sending insights on maps where the admin has not allowed them.
8. Reading features as the Viewer role
The Viewer role can only see the maps endpoint; accessing feature-board returns 403. The researcher found that knowing the feature ID is enough to read its activities, name and description.
- Open the admin with access account and create a new feature.
- Open the feature; the URL looks like:
https://0xM5awy.com/feature/5711304/
- The Viewer uses the feature ID
16264795to access the activities, name and description of the feature. The endpoints used are:
GET /api/features/16264795
GET /api/activities?trackable=Feature
- Make any request with the Viewer account, intercept it and send it to Repeater.
- Use the endpoints above in the request.
- The Viewer can read the activities, name and description of the feature.
All eight vulnerabilities were accepted. The researcher notes that business logic and broken access control issues "always win".
Root cause
The pattern across all eight bugs is that authorisation is enforced in the UI and not, or not consistently, on the API. In each of the eight cases, a request captured from a privileged role was accepted when replayed from a lower-privileged account. Object-level checks also appear to be missing: changing comment IDs, map IDs, customer IDs and organisation IDs in requests produced actions on other users' objects. The 401 on /customization and the 403 on feature-board show that the page refuses the lower role, yet the API requests captured from the privileged account still succeeded. The report does not describe the server-side code, so the exact implementation is not shown.
Impact
A lower-privileged team member can perform actions reserved for the team owner: change the subscription plan, create maps beyond the plan limit, duplicate maps, manage customisations and team settings, and post insights even when the admin has disabled them. Comment editing and deletion affects other users' content. The insight bug also allows sending data as another user or organisation and targeting maps where insights are not allowed. The report does not state bounty amounts or CVSS scores.
Fix
Enforce role and ownership checks on the server for every endpoint, not only in the UI: verify the caller's role for plan changes, map creation and duplication, customisations, settings and insights, and verify that comment, map, customer and organisation IDs belong to the caller.
Variants to test
- Capture every privileged action and replay it from each lower role. A positive result is a 2xx response or a visible state change where the UI previously blocked the action.
- Change object IDs in comment, map and insight requests to IDs belonging to another account. A positive result is a successful edit, delete or creation against the other object.
- Try adding sub-resources to existing endpoints, as with
/api/map/20500/duplicate, and switch GET to POST with an empty JSON body. A positive result is a new object being created. - Look for endpoints that return 401 or 403 in the browser but accept the same request when replayed directly. A positive result is a successful response from the API.
- Change
customer_id,organization_idand similar ownership fields in request bodies. A positive result is data being created or attributed to another user or organisation.
What happened, in plain words
A security researcher named Mohamed Anani, who goes by the handle 0xM5awy, spent a day testing a web application and found eight separate security problems in it. He wrote them up as the second part of an earlier article about business logic and broken access control bugs. The first part only listed the names of the bugs; this one explains each one, how he found it, and how to repeat it.
The application is a team tool. Teams can have maps, subscription plans, comments, customisations, team settings, insights and a feature board. The report calls the target the "0xM5awy.com program" and uses that host in its example URLs. New teams get a three-month free trial during which they can switch plans freely; after that they buy a plan.
Almost every bug here comes from the same idea. The application has several roles, and the screen hides or blocks certain actions for the lower roles. But when the same request is sent from a weaker account, the server still carries it out. So if you capture a request made by a powerful account and send the same request from a weaker account, the server happily does the work. This class of problem is called broken access control: the rules about who may do what exist, but they are not enforced where it counts.
To follow along you only need to understand a few ideas:
- API: the part of a website that the page talks to behind the scenes. When you click a button, your browser sends a small message to the server, for example "create a map", and the server replies. That message is a request, and the address it goes to is an endpoint.
- Endpoint: the address of one specific action on the server, such as
/api/plans. Think of it as a counter in an office: each counter handles one kind of paperwork. - HTTP method: the verb at the start of a request.
GETmeans "give me something",POSTmeans "create something",PUTmeans "replace or update something", andDELETEmeans "remove something". - Request body: the extra data sent with a request, usually in JSON, a simple text format of names and values in curly braces.
- Intercepting proxy: a tool that sits between your browser and the server. It lets you pause a request, look at it, change it, and send it again. The report uses one with a feature called Repeater, which resends a request as many times as you like with edits.
- Role: the level of permission an account has. Here there are four.
The four roles
The report says there are "3 roles" and then lists four. The roles themselves are clear:
- admin with access: can edit, delete and post everything.
- admin without access: can do the same things as admin with access, but less.
- assistant: can reach fewer endpoints than admin without access, but can post some things.
- Viewer: can reach fewer endpoints than the Contributor and can only view.
The Contributor is mentioned only in that comparison; the report does not describe it further.
The setup for nearly every bug is the same: have two accounts with different roles. Use the powerful one to perform an action legitimately and capture the exact request. Then send that same request from the weaker account. If the server answers with success, the weaker account has just done something it was never meant to do.
Finding it
The method is the same eight times. Do the action with the privileged role, capture the method, endpoint and body, then replay it from a lower-privileged account. The bugs looked wrong because the interface hides or blocks the action for the lower role, yet the server-side endpoint does not enforce the same restriction. In several cases the lower role gets a blank page or a 401 or 403 when browsing to the feature, but the underlying API still accepts the request.
A quick note on those two numbers, because they appear below. 401 Unauthorized means the server does not accept who you are, or you have not proved it. 403 Forbidden means the server knows who you are but refuses this particular action. Both are refusals; the difference is whether the problem is identity or permission.
Exploitation
1. Changing the subscription plan as admin without access or assistant
Only the admin with access is supposed to be able to edit the team's plan. A plan is the subscription level a team pays for; the report says there are three. The researcher captured the plan change from the privileged account and replayed it from the lower roles.
- Open the admin with access account and change the plan to another plan (there are three plans).
- Copy the endpoint and the body of the request:
PUT /api/plans
{"plan_id":1}
- Open the admin without access or assistant account, make any request, intercept it and send it to Repeater.
- Replace the request with the
PUT /api/plansmethod and endpoint and the body above. - The plan change succeeds. By changing the
plan_idvalue, the assistant and admin without access can move the team between plans.
Line by line: PUT /api/plans says "update the plans resource at this address". The body {"plan_id":1} is a JSON object with one field, plan_id, set to the number 1. That number is the identifier of one of the three plans. The server switches the team to that plan, even though the request came from a role that is not allowed to change plans. Step 3 matters because you cannot simply type this request into the browser's address bar: the browser only sends GET there. The proxy lets you take a harmless request the weaker account is allowed to make, then rewrite it into the powerful one.
2. Editing and deleting other users' comments
Comments behave like Facebook comments: only the owner of a comment should be able to edit or delete it. The researcher found that changing the comment ID in the request to another user's comment ID let him delete and edit that comment. An ID is a unique number the database gives each item, so comment 500 and comment 501 are different rows in a table.
- Open two accounts with any roles (admin with or without access, or assistant).
- Create two comments, one with each account.
- From the attacker account, delete your own comment and intercept the request.
- Change the ID of your comment to the victim's comment ID.
- The victim's comment is deleted.
- Using the
PUTmethod instead of the delete method allows editing the victim's comment in the same way.
The logic is: your own comment gives you a valid, working request, and swapping the number points it at someone else's comment, which is then deleted or edited. Your own comment gives you a valid, working request; swapping the number points it at someone else's. Step 6 shows the same flaw on the edit path, because editing and deleting are two different endpoints with the same missing check.
3. Creating more than one map on the Pro Plan
The Pro Plan allows only one map; creating more requires an upgrade. A map here is a piece of content the team builds inside the product. The researcher captured a map creation request from an account on the professional plan and replayed it from an account on the Pro Plan.
- Open the account with the professional plan, create a map and intercept the request.
- Copy the method, endpoint and body of the request.
- Open the account with the Pro Plan and make any request.
- Replace the method, endpoint and body with the professional plan request.
- The request succeeds, so the Pro Plan account can create as many maps as it wants rather than only one.
The report does not print the map creation endpoint or body, so there is nothing to copy here beyond the description. The point is that the limit is a rule about the account's plan, and replaying the professional plan request from the Pro Plan account still created a map. The interface probably hides the "new map" button once you have one, but the endpoint behind it does not care.
4. Duplicating maps as admin without access or assistant
Only the admin with access should be able to duplicate maps. Duplicating means making a copy of an existing map. The researcher turned the map retrieval request into a duplication request.
-
Open the map to duplicate with either of the two lower roles.
-
Make a GET request, intercept it and send it to Repeater.
-
Add the word
Duplicateto the endpoint before/api/map/20500, giving/api/map/20500/duplicate, change the GET method to POST and add{}as the body: -
Send the request and the map is duplicated.
Line by line: the original request was GET /api/map/20500, which means "show me map number 20500". The researcher added a path segment, /duplicate, so the address now names a different action on the same map. He changed the verb from GET to POST, because creating a copy is a creation, not a read. The body {} is an empty JSON object: the server needs no extra information, since the map number is already in the address. This is a good reminder that endpoints are not always linked from the interface; sometimes you can guess a sub-address by adding a word to one you already know.
5. Managing customisations as admin without access
When the admin without access opens the /customization endpoint, the application returns a blank page or a 401 Unauthorized. A customisation is a visual or content change to the product, such as a theme or layout. The researcher captured the customisation requests from the privileged account and replayed them.
- Open the admin with access account, create a new customisation and edit, rename and delete it, saving all these requests in Repeater.
- Open the admin without access account and try all these endpoints, methods and bodies with it.
- The lower role can add, edit, rename and delete customisations.
The 401 on the page is the interesting part. It shows that some check exists at the page or route level, so the browser is refused. But the customisation requests captured from the privileged account still succeeded when replayed from the admin without access account. Saving the requests in Repeater first means you have a ready-made list of exact requests to try, rather than guessing.
6. Editing team settings as admin without access
The admin without access can see the team settings but cannot edit them. Team settings are the configuration of the team, such as its name or preferences. The researcher captured the settings requests from the privileged account and replayed them.
- From the admin with access account, edit the team settings, intercept the requests and send them to Repeater.
- From the admin without access account, make any request and send it to Repeater.
- Try all the settings endpoints saved from the privileged account.
- The lower role can edit, rename and delete the settings.
This is the same pattern as bug 5, applied to a different feature. The interface lets the lower role read the settings, which is why the page is not blank, but it does not let them change anything. The replayed settings requests from the admin without access account succeeded.
7. Sending insights when the feature is disabled, and as other users or organisations
An insight is a note a user submits about a map, which then gets added to roadmaps and maps. The admin can turn off the option that lets Viewers submit insights. With the option off, the Viewer role should not be able to send insights. The researcher captured a legitimate insight submission and modified its body.
- From the Viewer account, open any map where the admin allows insights, send an insight, intercept the request and send it to Repeater.
- The endpoint and body look like this:
POST /api/maps/1626
{"note":{"name":"0xM5awy","content":"i can send nots","owner_id":null,"customer_id":11501634}}
- Changing
customer_idallows sending insights as any user, changingorganization_idallows sending them as any organisation, and changing the map ID in/api/maps/1626allows sending insights on maps where the admin has not allowed them.
Line by line: POST /api/maps/1626 means "create something on map number 1626". The body has one field, note, which is itself an object with four fields. name is the display name attached to the note, content is the text, owner_id is null (empty), and customer_id is the number of the account the note is attributed to. A customer ID is the database number for a user account. Because changing customer_id in the body lets you send insights as any user, you can put someone else's number there and the note is attributed to them. The same applies to organization_id, which the report mentions but does not show in the body. And because the map number is in the address, changing it targets a different map, including one where insights are switched off. This bug combines three separate missing checks in one request.
8. Reading features as the Viewer role
The Viewer role can only see the maps endpoint; accessing feature-board returns 403. A feature is an item on a board, with a name, a description and a list of activities. The researcher found that knowing the feature ID is enough to read its activities, name and description.
- Open the admin with access account and create a new feature.
- Open the feature; the URL looks like:
https://0xM5awy.com/feature/5711304/
- The Viewer uses the feature ID
16264795to access the activities, name and description of the feature. The endpoints used are:
GET /api/features/16264795
GET /api/activities?trackable=Feature
- Make any request with the Viewer account, intercept it and send it to Repeater.
- Use the endpoints above in the request.
- The Viewer can read the activities, name and description of the feature.
Line by line: the first endpoint asks for feature number 16264795 directly. The second asks for activities, with a query string ?trackable=Feature that filters the list to activities attached to features. A query string is the part of a URL after the question mark; it passes extra settings to the server. The 403 on feature-board is the refusal again, yet the feature and activities endpoints returned the data when replayed from the Viewer account. Note that the URL in step 2 shows feature 5711304 while step 3 uses 16264795; the report does not explain the difference, so treat the numbers as they are written.
All eight vulnerabilities were accepted. The researcher notes that business logic and broken access control issues "always win".
Root cause
The pattern across all eight bugs is that requests captured from a privileged role were accepted when replayed from a lower-privileged account. The server accepts a request from any authenticated role as long as the request is well formed. Object-level checks also appear to be missing: changing comment IDs, map IDs, customer IDs and organisation IDs in requests produced actions on other users' objects. The 401 on /customization and the 403 on feature-board show that some checks exist at the page or route level, but the underlying API endpoints do not repeat them.
Impact
A lower-privileged team member can perform actions reserved for the team owner: change the subscription plan, create maps beyond the plan limit, duplicate maps, manage customisations and team settings, and post insights even when the admin has disabled them. Comment editing and deletion affects other users' content. The insight bug also allows sending data as another user or organisation and targeting maps where insights are not allowed.
Fix
Enforce role and ownership checks on the server for every endpoint, not only in the interface: verify the caller's role for plan changes, map creation and duplication, customisations, settings and insights, and verify that comment, map, customer and organisation IDs belong to the caller.
Variants to test
- Capture every privileged action and replay it from each lower role. A positive result is a 2xx response or a visible state change where the interface previously blocked the action.
- Change object IDs in comment, map and insight requests to IDs belonging to another account. A positive result is a successful edit, delete or creation against the other object.
- Try adding sub-resources to existing endpoints, as with
/api/map/20500/duplicate, and switch GET to POST with an empty JSON body. A positive result is a new object being created. - Look for endpoints that return 401 or 403 in the browser but accept the same request when replayed directly. A positive result is a successful response from the API.
- Change
customer_id,organization_idand similar ownership fields in request bodies. A positive result is data being created or attributed to another user or organisation.
Glossary
- API: the set of addresses and rules a website's pages use to talk to its server behind the scenes.
- Endpoint: one specific address on the server that performs one action, such as
/api/plans. - HTTP method: the verb at the start of a request (
GET,POST,PUT,DELETE) that says what kind of action is wanted. - Request body: the data sent along with a request, often in JSON.
- JSON: a plain text format for structured data, using curly braces, names and values.
- Intercepting proxy: a tool placed between browser and server that can pause, inspect and change requests.
- Repeater: a feature of such a tool that resends a captured request, with edits, as many times as you like.
- Role: the permission level of an account, such as admin or Viewer.
- Broken access control: a flaw where the rules about who may do what are not enforced by the server.
- Business logic flaw: a flaw where the application's own rules, such as plan limits, can be bypassed.
- Object-level check: verifying that a specific item (a comment, a map) belongs to the person asking for it.
- ID: a unique number the database assigns to each item, used to refer to it.
- Customer ID: the database number identifying a user account.
- Organisation ID: the database number identifying an organisation.
- 401 Unauthorized: the server does not accept who you are, or you have not proved it.
- 403 Forbidden: the server knows who you are but refuses this action.
- Query string: the part of a URL after
?, used to pass extra settings to the server. - Plan: the subscription level a team pays for, which sets limits and features.
- Insight: a note a user submits about a map, added to roadmaps and maps.
- Feature: an item on a feature board with a name, description and activities.
- Customisation: a visual or content change to the product, such as a theme.
- Map: a piece of content a team builds inside the product.
- CVSS: a standard scoring system for the severity of a vulnerability.