Skip to content
Access control Write-up Intermediate

Broken Function Level Authorization in Linktree GraphQL API Allows Lower-Privileged Admins to Invite Administrators

A GraphQL mutation used by the account Owner to add another user as an administrator did not check the caller's role, so a lower-privileged Admin session could invoke it directly and add an administrator. An attacker holding such an Admin account could create extra administrators and escalate or persist access.

Ahemd ashraf Follow

Published on medium.com

Bug Bounty

Ahemd ashraf, 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

Linktree's GraphQL API exposes administrative functions for managing an account's administrators. The account model has at least two privilege levels: an Owner, who can manage administrators and invite additional users, and a lower-privileged Admin, who cannot perform those operations. The UI distinguished between the roles, and the invitation function was hidden from the lower-privileged Admin. The question the researcher set out to answer was whether the backend enforced the same boundary when the mutation was called directly.

Setup

The researcher needed two authenticated sessions on the same account:

  1. An Owner session, used to capture the legitimate request that adds another user as an administrator.
  2. A lower-privileged Admin session, belonging to an account that did not have permission to add administrators.

No special tooling is described beyond the ability to inspect the application's GraphQL requests and replay them with a different authentication cookie.

Finding it

While inspecting the application's GraphQL traffic, the researcher identified a mutation used by the Owner to add another user as an administrator. The operation was reachable through the GraphQL API and accepted user and account related parameters. The expected behaviour was clear:

  • Owner session: the mutation should succeed.
  • Lower-privileged Admin session: the mutation should be rejected.

The UI already hid the function from the Admin, so the question was whether the mutation could still be called directly through the API.

Exploitation

Step 1: capture the Owner's request

The researcher authenticated as the account Owner and captured the request responsible for adding another administrator. Conceptually, the mutation looked like this:

Text
mutation {    <owner_admin_invitation_mutation>(        identifier: "<target-user>"        accountId: "<account-id>"    ) {        ...    }}

Conceptually, the mutation took an identifier for the target user and an accountId for the account. The researcher notes that the operation itself was accessible through the GraphQL API and accepted these user and account related parameters.

Step 2: confirm the Owner path works

Using the Owner's cookie, the flow behaved as expected:

Text
Request → Owner session → Mutation → Success

This was expected behaviour: the Owner session succeeded.

Step 3: replay with the lower-privileged Admin session

The researcher replaced the authentication cookie with the cookie belonging to the Admin account that did not have permission to add administrators. No Owner credentials were used for the second request. The important change was not the mutation itself; the only relevant change was the authenticated session.

The request was still accepted. The API performed the operation and added the target user as an administrator. The response indicated success, for example:

Text
<target-user> has been added as an admin

This showed that the backend was authorising the mutation based on authentication rather than verifying whether the authenticated user held the privilege required to execute that function.

Root cause

The GraphQL mutation did not enforce function-level authorisation. The backend appeared to verify that the request was associated with an authenticated account, but failed to verify that the authenticated user's role was authorised to execute that specific administrative mutation.

The distinction the researcher draws is between two questions:

  • Authentication: Who is this user?
  • Authorisation: Is this user allowed to perform this specific operation?

The second check was missing or insufficient. Hiding the function from the lower-privileged user's UI is not sufficient: the mutation remained callable directly through the GraphQL API. The application already had the privilege distinction (Owner is not the same as a lower-privileged Admin), but the backend did not enforce it for this mutation.

Impact

An attacker who compromises or controls a lower-privileged Admin account could use this flaw to perform administrative actions reserved for the Owner. In the demonstrated case, the attacker could add another user as an administrator despite not having the required permission.

Depending on the application's administrative capabilities, the researcher lists the following possible consequences:

  • Unauthorised administrator creation
  • Privilege escalation
  • Expansion of attacker-controlled access
  • Persistence through additional administrator accounts
  • Potential compromise of the entire workspace or account

The demonstrated impact was the unauthorised creation of an administrator using a session that did not have permission to perform that operation.

Fix

The server should enforce authorisation inside the resolver responsible for the mutation. Before performing the operation, the backend should verify:

  1. The requester is authenticated.
  2. The requester belongs to the relevant account or workspace.
  3. The requester's role has permission to invite or add administrators.
  4. The requested target account or resource belongs to the same authorised scope.
  5. The requested operation is permitted for that role.

Conceptually, the check should follow this order:

Text
Authenticated user        ↓Resolve account/workspace        ↓Resolve user's role        ↓Check permission for "invite administrator"        ↓Allow or reject mutation

The authorisation decision must happen server-side and must not depend on whether the operation is hidden from the frontend UI.

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

What happened, in plain words

Some of those people have more power than others. The Owner has permission to manage administrators and invite additional users. The people who are added are Admins, and they are not supposed to be able to add more administrators themselves.

The application's UI distinguished between the roles, so the function was not offered to the lower-privileged Admin. But the website's screens are only one half of the story. Behind the screens, the browser talks to a server, and the server is what actually does the work. The researcher found that the backend appeared to check only that the person was logged in, not whether their role allowed the operation. So an Admin could send the same request the Owner sends, and the server would happily add a new administrator.

This kind of mistake has a name: Broken Function Level Authorization. In plain words, the server let someone use a function (an action, like "add an administrator") that their role should not have allowed.

Some words you will need first

Before walking through the steps, here are the ideas the rest of the article relies on. Each one is explained from scratch.

  • Server and browser. Your browser (Chrome, Firefox, Safari) shows you pages. The server is a computer somewhere else that stores the data and decides what happens. When you click something, your browser sends a message to the server and the server replies.
  • API. An API is the set of messages a server accepts. Think of a restaurant: the menu is the API. You can only order what is on the menu, and the kitchen only cooks what you ordered. A website's buttons are just a convenient way of ordering from that menu; the menu itself still exists even if a particular customer is never shown a certain dish.
  • GraphQL. GraphQL is a style of API where the browser sends a description of exactly what it wants, in a small text format. The two main kinds of GraphQL messages are queries (asking for data) and mutations (changing data, such as adding a person). A mutation is like a written instruction: "add this user to this account".
  • Cookie. When you log in, the server gives your browser a small piece of text called a cookie. Your browser sends that cookie back with every request, and the server uses it to recognise you. It works like a wristband at an event: show the wristband, and staff know you are inside. If someone copies your wristband, they can walk in as you.
  • Session. The logged-in state that a cookie represents is called a session. Two different people logged in at the same time have two different sessions, and therefore two different cookies.
  • Authentication. Authentication answers the question who are you? Logging in with a password is authentication.
  • Authorization. Authorization answers a different question: what are you allowed to do? A hotel key card authenticates you as a guest, but authorization decides whether your card opens your own room or every room.
  • Role. A role is a label attached to a user that says what they may do. Here there are at least two: Owner and Admin.
  • Privilege. Privilege simply means power or permission. A higher-privileged user can do more than a lower-privileged one.
  • Broken Function Level Authorization (BFLA). This is when the server fails to check whether the logged-in user's role is allowed to run a particular function. The user is genuinely logged in, so authentication passes, but the authorization check for that specific action is missing.
  • Resolver. In GraphQL, each mutation is handled by a small piece of server code called a resolver. The resolver is where the server decides whether to carry out the instruction. If the permission check is missing there, it is missing everywhere.
  • Frontend and backend. The frontend is what you see in the browser (pages, buttons, menus). The backend is the server code behind it. Hiding a button is a frontend change; it does not stop anyone from sending the request by other means.
  • Replay. Replaying a request means sending the exact same message again, perhaps with one detail changed. It is like recording a form submission and submitting it a second time.

The setup the researcher needed

To test the rule, the researcher needed two logged-in sessions on the same Linktree account:

  1. An Owner session, to capture the legitimate request that adds another user as an administrator.
  2. A lower-privileged Admin session, belonging to an account that did not have permission to add administrators.

The only tooling described is the ability to look at the GraphQL requests the application sends and to send them again with a different authentication cookie.

Finding the mutation

While inspecting the application's GraphQL traffic, the researcher identified a mutation used by the Owner to add another user as an administrator. The operation was reachable through the GraphQL API and accepted user and account related parameters.

The expected behaviour was clear:

  • Owner session: the mutation should succeed.
  • Lower-privileged Admin session: the mutation should be rejected.

The UI already hid the function from the Admin, so the question was whether the mutation could still be called directly through the API.

Why start here? Because the whole question is about the difference between what the screen offers and what the server permits. If the screen hides the action, the only way to learn whether the server also refuses it is to send the request yourself.

Step 1: capture the Owner's request

The researcher logged in as the account Owner and captured the request responsible for adding another administrator. Conceptually, the mutation looked like this:

Text
mutation {    <owner_admin_invitation_mutation>(        identifier: "<target-user>"        accountId: "<account-id>"    ) {        ...    }}

Line by line, in plain words:

  • mutation { opens a GraphQL instruction that will change something on the server, as opposed to just reading data.
  • <owner_admin_invitation_mutation> is a placeholder for the name of the specific action, the one the Owner uses to invite an administrator. The angle brackets mean the real name has been replaced here.
  • identifier: "<target-user>" says which user should be added. Again the real value is replaced by a placeholder.
  • accountId: "<account-id>" says which account the person is being added to.
  • { ... } is where the server's reply format would be described; the dots stand for details left out.
  • The final } closes the mutation.

Conceptually, the mutation took an identifier for the target user and an accountId for the account. The researcher notes that the operation itself was accessible through the GraphQL API and accepted these user and account related parameters.

Capturing the request first matters because it gives you a known-good example. You are not guessing at the format; you are taking a message the application itself sent and keeping a copy.

Step 2: confirm the Owner path works

Using the Owner's cookie, the flow behaved as expected:

Text
Request → Owner session → Mutation → Success

Reading this left to right: a request is sent, it carries the Owner's session (the Owner's cookie), it contains the mutation, and the server answers with success.

This was expected behaviour: the Owner session succeeded. A baseline is important because if the request failed even for the Owner, you would be debugging a broken request rather than testing permissions.

Step 3: replay with the lower-privileged Admin session

The researcher replaced the authentication cookie with the cookie belonging to the Admin account that did not have permission to add administrators. No Owner credentials were used for the second request. The important change was not the mutation itself; the only relevant change was the authenticated session.

Think of it as taking a signed permission slip, keeping the wording exactly the same, and swapping only the signature at the bottom. If the office accepts it, the office was checking that there was a signature, not whose it was.

The request was still accepted. The API performed the operation and added the target user as an administrator. The response indicated success, for example:

Text
<target-user> has been added as an admin

This is the server's reply, in words: the user named in the placeholder has been added as an administrator. The reply is the proof that the action actually happened, not merely that the request was received.

This showed that the backend was authorising the mutation based on authentication rather than verifying whether the authenticated user held the privilege required to execute that function. In other words, the server asked "is this person logged in?" and never asked "is this person allowed to do this?".

Why this is a security issue

The important point is that this was not simply an API endpoint being exposed. The application already had a privilege distinction: Owner ≠ lower-privileged Admin. The lower-privileged Admin was intentionally not supposed to have the ability to invite or add administrators. However, the backend accepted the same privileged operation when it was called directly through GraphQL.

A useful comparison is a building with a staff-only door. Painting over the sign on the door does not lock it. If the door still opens for anyone with a general building pass, the restriction was decoration, not security. Hiding the button in the UI is the painted-over sign; the resolver is the lock.

Root cause

The GraphQL mutation did not enforce function-level authorisation. The backend appeared to verify that the request was associated with an authenticated account, but failed to verify that the authenticated user's role was authorised to execute that specific administrative mutation.

The distinction the researcher draws is between two questions:

  • Authentication: Who is this user?
  • Authorisation: Is this user allowed to perform this specific operation?

The second check was missing or insufficient. Hiding the function from the lower-privileged user's UI is not sufficient: the mutation remained callable directly through the GraphQL API. The application already had the privilege distinction (Owner is not the same as a lower-privileged Admin), but the backend did not enforce it for this mutation.

Impact

An attacker who compromises or controls a lower-privileged Admin account could use this flaw to perform administrative actions reserved for the Owner. In the demonstrated case, the attacker could add another user as an administrator despite not having the required permission.

Depending on the application's administrative capabilities, the researcher lists the following possible consequences:

  • Unauthorised administrator creation
  • Privilege escalation
  • Expansion of attacker-controlled access
  • Persistence through additional administrator accounts
  • Potential compromise of the entire workspace or account

A few of those terms deserve a plain explanation. Privilege escalation means moving from a lower level of power to a higher one, like a guest finding a way to get a staff badge. Persistence means keeping access for later, so that even if one route is closed, another remains open; adding extra administrator accounts is a way of doing that. The demonstrated impact was the unauthorised creation of an administrator using a session that did not have permission to perform that operation.

How it should be fixed

The server should enforce authorisation inside the resolver responsible for the mutation. Before performing the operation, the backend should verify:

  1. The requester is authenticated.
  2. The requester belongs to the relevant account or workspace.
  3. The requester's role has permission to invite or add administrators.
  4. The requested target account or resource belongs to the same authorised scope.
  5. The requested operation is permitted for that role.

Conceptually, the check should follow this order:

Text
Authenticated user        ↓Resolve account/workspace        ↓Resolve user's role        ↓Check permission for "invite administrator"        ↓Allow or reject mutation

Read the diagram from top to bottom. First the server works out who the user is. Then it works out which account or workspace the request concerns. Then it looks up that user's role. Then it checks whether that role is allowed to invite an administrator. Only then does it allow or reject the mutation. Each arrow is a step that must happen before the next, and the decision at the bottom depends on all of them.

The authorisation decision must happen server-side and must not depend on whether the operation is hidden from the frontend UI.

Once you understand the pattern, you can look for it in other places. The researcher lists five variations.

Enumerating means listing things one by one, the way you would read every item on a menu rather than only the dishes you usually order.

Key takeaway for beginners

When testing role-based authorization, don't only test:

"Can this user access this page?"

Also test:

"Can this user directly invoke functions that belong to a higher privilege level?"

For GraphQL applications, enumerate mutations and compare their behaviour across different roles. A useful methodology is to capture the same privileged operation using an Owner account and then replay it using a lower-privileged account. If the lower-privileged session can successfully execute the operation, you may have a Broken Function Level Authorization vulnerability.

Glossary

  • Admin: a user with some administrative power over an account, but less than the Owner.
  • API: the set of messages a server accepts; the menu of things you can ask it to do.
  • Authentication: the check of who a user is, usually by logging in.
  • Authorization: the check of what a logged-in user is allowed to do.
  • Backend: the server-side code that stores data and carries out actions.
  • Baseline: a known-good result used for comparison, here the Owner's successful request.
  • Broken Function Level Authorization (BFLA): a flaw where the server does not check whether the user's role may run a particular function.
  • Cookie: a small piece of text the server gives your browser at login and your browser sends back with each request so the server recognises you.
  • Enumeration: listing items one by one, such as every mutation a GraphQL API offers.
  • Frontend: what you see and interact with in the browser, such as pages and buttons.
  • GraphQL: an API style where the browser sends a description of exactly what it wants; it uses queries to read and mutations to change data.
  • Header: extra information attached to a request, separate from its main content.
  • Mutation: a GraphQL instruction that changes data on the server.
  • Owner: the highest-privileged user on an account, able to manage administrators and invite users.
  • Payload: the main content of a request, such as the mutation and its values.
  • Persistence: keeping access over time, for example by creating extra administrator accounts.
  • Privilege: power or permission attached to a user.
  • Privilege escalation: moving from a lower level of permission to a higher one.
  • Query: a GraphQL instruction that only reads data.
  • Replay: sending a captured request again, possibly with one detail changed.
  • Resolver: the server code that handles a particular GraphQL query or mutation and decides whether to carry it out.
  • Role: a label on a user that defines what they may do, such as Owner or Admin.
  • Scope: the boundary of what a request is allowed to touch, such as one account rather than another.
  • Server: the remote computer that stores data and performs actions on the website's behalf.
  • Session: the logged-in state represented by a cookie.
  • UI (user interface): the screens, buttons and menus a person sees and uses.
  • Variables: named values passed alongside a GraphQL operation, such as the target user and account identifiers.
  • Workspace: a shared space, such as an account, that a group of users work in together.

More by Ahemd ashraf

View all

5 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.