Skip to content
IDOR Write-up Beginner

Broken Object Level Authorization (BOLA / IDOR) in Linktree GraphQL API Allows Unauthorized Modification of Links

The GraphQL mutation for setting a digital download link context accepted a client-supplied link identifier without checking that the authenticated user owned that link. An attacker with a valid account could modify links belonging to other workspaces, potentially defacing them or redirecting visitors to attacker-controlled destinations.

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 exposes a GraphQL API that its clients use to manage Link objects: the entries that make up a user's link page. During security testing of that API, Ahemd ashraf found a Broken Object Level Authorization (BOLA/IDOR) issue that let an authenticated user modify a Link object outside their own authorised workspace.

The vulnerable functionality sits behind the GraphQL endpoint:

HTTP
POST https://graph.linktr.ee/graphql

The affected operations are the GraphQL mutations that manage Link objects. The report names one of them specifically, setDigitalDownloadLinkContext, which operates on Link-related properties:

Text
idtitleurlactivestatus

Setup

The testing required only an authenticated account with permission to manage Links in its own workspace. No victim credentials were needed at any point.

Finding it

While testing Link management functionality, the researcher noticed that requests carried a Link identifier supplied to the GraphQL API. That identifier is user-controlled input, and the question was whether the server checked that the caller actually owned the object it named.

The approach was to first perform the operation against a Link in the researcher's own workspace and capture the request, then change the Link identifier to that of a Link outside the authorised workspace. One of the tested object identifiers was:

Text
582743627

The application accepted the modified identifier and processed the request against the referenced Link. That showed the backend was not verifying whether the authenticated user was authorised to manage the referenced object.

Exploitation

Step 1: Legitimate request

The researcher authenticated with an account that had permission to manage Links in their own workspace and captured the GraphQL request responsible for modifying a Link. The request contained a Link/object identifier.

Step 2: Modify the object identifier

The original Link ID was replaced with the ID of a Link belonging to another workspace:

Text
Original Link ID:<my-authorized-link-id>
Text
Modified Link ID:582743627

No victim credentials were required for this step.

Step 3: Send the modified request

The modified GraphQL request was sent using the same authenticated session. Rather than rejecting the request because the Link belonged to a different authorisation scope, the server processed the operation against the supplied object. The operation was successfully performed against the referenced Link even though the authenticated account had no authorisation over it.

Root cause

The root cause is insufficient server-side object-level authorisation. The GraphQL resolver accepted a Link identifier supplied by the client but did not adequately verify that the authenticated user had permission to perform the requested operation on that specific Link.

The application authenticated the requester correctly, but authentication alone does not establish authorisation over every Link object. The server should have established a relationship along these lines:

Text
Authenticated User        ↓Authorized Workspace        ↓Requested Link        ↓Permission to modify that Link

Instead, the supplied Link identifier was trusted without sufficiently validating that relationship. A valid object ID should never be treated as proof that the requester is authorised to access or modify the object.

Impact

An attacker with a valid account could potentially manipulate Link objects outside their authorised workspace by supplying identifiers belonging to other users or workspaces. Depending on the affected Link, this could result in:

  • Unauthorised Link modification
  • Link defacement
  • Replacement of legitimate URLs
  • Redirecting visitors to attacker-controlled destinations
  • Phishing opportunities
  • Unauthorised modification of digital-product links
  • Cross-workspace integrity violations

The demonstrated security boundary violation is that authorisation was not properly enforced at the Link-object level.

Fix

Every GraphQL resolver or mutation that accepts a Link identifier should perform an explicit server-side authorisation check. Before modifying a Link, the backend should:

  1. Resolve the requested Link.
  2. Determine the workspace/account that owns the Link.
  3. Determine the authenticated user's workspace and permissions.
  4. Verify that the user has the required permission for the requested operation.
  5. Reject the request if the authorisation relationship does not exist.

The check should run server-side on every request and must not depend on frontend restrictions.

Variants to test

  • A positive result is the server processing the operation against an object outside your workspace.
  • A positive result is a change reflected on an object you do not own.
  • A positive result is data from another workspace being returned.
  • A positive result is any form that bypasses the ownership check.
  • A positive result is partial success on the foreign objects.

The general test case the researcher recommends: capture a legitimate request, identify the object-level identifiers, and replay it with an identifier belonging to another authorisation scope. If the server processes the request instead of rejecting it, that may indicate a BOLA/IDOR vulnerability.

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

Linktree is a service that gives a person one short web address (a "link page") that holds a list of links to everything else they want to share: their shop, their videos, their newsletter, and so on. Each of those entries on the page is called a Link object. The person who owns the page can add links, rename them, change the web address they point to, switch them on or off, and so on.

Those changes are not made by clicking around a website that quietly does the work behind the scenes in a way you can see. They are made by the Linktree app talking to a Linktree server through an API: a programming interface that accepts structured requests and sends structured answers back. The particular API here is a GraphQL API, which is a way of asking a server for exactly the data or the action you want, using a request written in a small query language.

While testing that API, the researcher Ahemd ashraf found that the server would let a logged-in user change a Link object that belonged to somebody else. The server checked who you are (you really are a logged-in Linktree user) but not whether this particular link is yours to change. That class of mistake is called Broken Object Level Authorization, or BOLA for short. It is also often called IDOR, short for Insecure Direct Object Reference. Both names describe the same idea: the server takes an identifier that the client sends, looks up the object with that identifier, and acts on it without checking that the caller is allowed to touch that object.

An everyday comparison: imagine a hotel where the receptionist checks your name at the door, then hands you a master key because you asked for "room 214". You are a genuine guest, so the front door check passed. Nobody asked whether room 214 is the room you booked. The lock worked; the question of ownership was never asked.

The report describes the endpoint, the mutation involved, one identifier that was tested, the three steps of the test, why the server behaved the way it did, what damage it could cause, and how it should be fixed.

The endpoint and the operations involved

The vulnerable functionality is reached through this address:

HTTP
POST https://graph.linktr.ee/graphql

Line by line:

  • POST is the HTTP method. When your browser loads a page it usually uses GET, which means "give me this". POST means "here is some data, do something with it". API calls that change things normally use POST.
  • https:// means the connection is encrypted, so nobody sitting between your computer and the server can read or alter the traffic.
  • graph.linktr.ee is the host name of the server that answers API requests. It is a different host from the one that serves the ordinary Linktree website.
  • /graphql is the path. It tells the server which part of its software should handle the request. A single GraphQL address usually handles every operation the API offers; the request body says which one you want.

The operations that manage Link objects are GraphQL mutations. A mutation is the GraphQL word for an operation that changes data, as opposed to a query, which only reads data. The report names one mutation specifically: setDigitalDownloadLinkContext. It also lists the Link-related properties that this mutation works with:

Text
idtitleurlactivestatus

That block is the four property names run together as they appear in the report: id, title, url, active, status. In plain terms, a Link object has an identifier (id), a display name (title), the web address it points to (url), whether it is switched on (active), and some kind of state (status). The mutation changes some of these on a link. The report does not explain what "digital download" means in Linktree's product beyond the mutation name, so treat it as the feature that this particular mutation belongs to.

What the tester needed to start

The setup was minimal. The researcher needed one ordinary account with permission to manage links on its own page. No password, session or any other credential belonging to a victim was needed at any point. The report does not name any specific tool; the only capability required was being able to capture an API request and send it again with a change.

That last point is worth unpacking for a beginner, because it is the whole basis of this kind of testing. When your browser or the Linktree app talks to a server, it sends an HTTP request. Tools built into browsers (the developer tools, usually opened with F12) and separate proxy programs let you look at those requests, copy one, edit a value, and send it again. Nothing magic is involved: you are doing by hand what the app does automatically.

How the problem was found

While testing the link management features, the researcher noticed that the requests contained a Link identifier: a number or string that tells the server which link the request is about. That identifier is supplied by the client, which means the person sending the request controls it. The natural question follows: does the server check that the caller actually owns the object that the identifier points to?

To answer it, the researcher first performed the operation on a link in their own workspace and captured the request. A workspace here is the account area that owns links; the report uses the word to mean the boundary of what a user is allowed to manage. Capturing the request first matters because it gives you a known-good example: a request you know the server accepts, from an account you know is allowed to make it. Any later failure or success can then be compared against that baseline.

Then the researcher changed the Link identifier to the identifier of a link outside their own workspace. One of the identifiers tested was:

Text
582743627

That is a single number, an object identifier for a Link that did not belong to the tester. The server accepted the modified identifier and carried out the operation on the referenced link. In other words, the backend never verified that the logged-in user was allowed to manage that object. The ownership question was skipped entirely.

The proof of concept, step by step

The test itself was simple, and the report sets it out in three steps.

Step 1: Make a legitimate request

The researcher logged in with an account that had permission to manage links in its own workspace, then captured the GraphQL request that modifies a link. That request contained a Link identifier. The purpose of this step is to obtain a request that is known to be valid: correct authentication, correct shape, correct operation. Everything after this is a controlled change to one value.

Step 2: Change the object identifier

The original Link ID was replaced with the ID of a link belonging to another workspace:

Text
Original Link ID:<my-authorized-link-id>
Text
Modified Link ID:582743627

Line by line:

  • The first block shows the placeholder the report uses for the tester's own link. <my-authorized-link-id> stands for whatever number the tester's own link had; it is a stand-in, not a literal value.
  • The second block shows the value that replaced it: 582743627, a link the tester had no rights over.
  • The identifier was replaced with one belonging to another workspace. That is what makes the test meaningful: if the server behaves differently, the identifier is the only possible cause.

No victim credentials were required for this step. The tester stayed logged in as themselves the whole time.

Step 3: Send the modified request

The modified GraphQL request was sent using the same authenticated session. A session is the server's memory of "this person is logged in". It is usually carried by a cookie or a token, a small piece of data that the client sends with every request so the server can recognise the user. Because the session was unchanged, the server still knew exactly who was calling; the only new thing was the identifier in the body.

The server did not reject the request on the grounds that the link belonged to a different authorisation scope. Instead it processed the operation against the supplied object. The change was successfully applied to the referenced link even though the authenticated account had no authorisation over it.

That is the finding: the server authenticated the caller correctly and then failed to authorise the action on that specific object.

Why it happens

The application authenticated the requester correctly. Authentication answers "who are you?" and it worked. But authentication alone does not establish authorisation, which answers "are you allowed to do this particular thing to this particular object?". Those are two separate checks, and only the first one was being made properly.

The server should have established a chain of relationships along these lines:

Text
Authenticated User        ↓Authorized Workspace        ↓Requested Link        ↓Permission to modify that Link

Read it as a sequence of questions the server should ask itself, top to bottom:

  1. Who is this user? (answered by the session)
  2. Which workspace does that user belong to, and what may they do there?
  3. Which link does the request name, and which workspace owns that link?
  4. Does the user's workspace match the link's workspace, and does the user hold the permission needed for this operation?

Only if every link in that chain holds should the change go ahead. Instead, the supplied Link identifier was trusted without sufficiently validating the relationship. The server took the number at face value. A valid object ID should never be treated as proof that the requester is authorised to access or modify the object; an identifier is just a name, and names can be guessed or copied from anywhere.

What an attacker could do with it

An attacker with a valid account could potentially manipulate Link objects outside their own workspace by supplying identifiers belonging to other users or workspaces. Depending on which link was affected, the report lists these possible consequences:

  • Unauthorised Link modification
  • Link defacement
  • Replacement of legitimate URLs
  • Redirecting visitors to attacker-controlled destinations
  • Phishing opportunities
  • Unauthorised modification of digital-product links
  • Cross-workspace integrity violations

In plain terms: a link page is a public shop window. If someone else can change the address a link points to, every visitor who clicks it is sent wherever the attacker chooses. That is why "replacement of legitimate URLs" and "phishing" appear in the list: a trusted page can be turned into a stepping stone to a fake login page or a malicious download. "Cross-workspace integrity violations" means data that belongs to one account was changed by another, so the account owner can no longer trust that what they see is what they set.

The demonstrated security boundary violation is that authorisation was not properly enforced at the Link-object level.

How to fix it

Every GraphQL resolver or mutation that accepts a Link identifier should perform an explicit server-side authorisation check. A resolver is the piece of server code that runs when a particular field or mutation is requested; it is where the actual work happens, and therefore where the check belongs. Before modifying a link, the backend should:

  1. Resolve the requested Link.
  2. Determine the workspace/account that owns the Link.
  3. Determine the authenticated user's workspace and permissions.
  4. Verify that the user has the required permission for the requested operation.
  5. Reject the request if the authorisation relationship does not exist.

The check should run server-side on every request and must not depend on frontend restrictions. Frontend means the part of the software running on the user's own device, such as the app or the web page. Anything enforced only there can be bypassed by anyone who edits the request, which is exactly what happened in this test.

Other places to try the same test

The general lesson extends beyond this one mutation.

  • A positive result is the server processing the operation against an object outside your workspace.
  • A positive result is a change reflected on an object you do not own.
  • A positive result is data from another workspace being returned.
  • A positive result is any form that bypasses the ownership check.
  • A positive result is partial success on the foreign objects.

The general test case the researcher recommends: capture a legitimate request, identify the object-level identifiers, and replay it with an identifier belonging to another authorisation scope. If the server processes the request instead of rejecting it, that may indicate a BOLA/IDOR vulnerability.

Glossary

  • API: a defined way for one piece of software to ask another for data or actions, using structured requests and responses.
  • Authentication: the process of proving who you are, usually by logging in.
  • Authorisation: the process of deciding whether an identified user is allowed to perform a particular action on a particular object.
  • BOLA (Broken Object Level Authorization): a flaw where the server acts on an object named by the client without checking that the client is allowed to touch that object.
  • Cookie: a small piece of data a browser stores for a site and sends back with later requests, often used to carry a session.
  • Cross-workspace integrity violation: a change made to data in one account's area by someone from another account's area.
  • Endpoint: the address and method of a specific API operation, such as POST https://graph.linktr.ee/graphql.
  • Frontend: the part of an application that runs on the user's device, such as a web page or mobile app.
  • GraphQL: a query language and API style where the client sends a structured request naming the exact fields or operations it wants.
  • GraphQL mutation: a GraphQL operation that changes data, as opposed to a query that only reads it.
  • GraphQL query: a GraphQL operation that only reads data.
  • HTTP method: the verb at the start of a request, such as GET (fetch) or POST (submit data).
  • IDOR (Insecure Direct Object Reference): another name for the same class of flaw as BOLA; the server uses an identifier supplied by the client without an ownership check.
  • Identifier (ID): a value that names a specific object, such as the number 582743627 for a link.
  • Link object: one entry on a Linktree page, with properties such as its identifier, title, URL, active flag and status.
  • Linktree: a service that gives a user one short web address holding a list of links to share.
  • Mutation: see GraphQL mutation.
  • Phishing: tricking people into visiting a fake page or handing over information by making the destination look trustworthy.
  • POST: an HTTP method used to send data to a server, typically for an operation that changes something.
  • Property / field: a named piece of data belonging to an object, such as title or url on a link.
  • Resolver: the server-side function that runs when a particular GraphQL field or mutation is requested, and where the actual work and checks should happen.
  • Server-side: happening on the server, where the user cannot alter it, as opposed to frontend.
  • Session: the server's record that a particular client is logged in, usually referenced by a cookie or token sent with each request.
  • Token: a piece of data, often a long string, that proves identity or grants access when presented to a server.
  • URL: a web address, such as the destination a link points to.
  • Workspace: the account area that owns objects such as links, and the boundary of what a user is allowed to manage.

More by Ahemd ashraf

View all

5 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Insecure direct object reference (IDOR)

The lesson behind this report.

One user can read or change another user's data, usually by changing an identifier the server trusts without checking who is asking. One of the most paid bug classes on web programs.