Skip to content
IDOR Write-up Intermediate

A fever Worth 750$- [Accessing Private Projects ]

A share token for one project was accepted for any other project, and a GraphQL endpoint leaked private project IDs to any candidate. An attacker could use a shared project's token with a private project's ID to access that private project.

Shakti Mohanty Follow

Published on medium.com

Bounty$750 View original

Hello Champs, Shaktihere , I hope you all are having some good times. Usually i’m not a person who makes writeup for the findings, but i thought of doing it often now. #sharingiscaring

shakti mohanty, 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. 5 min read.

Context

The target was a single-scoped recruiting application where admins create projects and invite candidates to them. A project has a status of either Shared or Private. A private project is meant to be accessible only by the admin; a shared project is accessible to the individuals who were invited to it.

When an admin shares a project with a candidate, the invitation link has this shape:

Text
https://example.com/projects/alphanumeric_project_id_here?share_token_id=some_random_token_here

Access therefore depends on two values: the project_id in the path and the share_token_id query parameter. Both are described as alphanumeric and unpredictable. The application also exposed a GraphQL API, which becomes relevant later.

Setup

The researcher hunted on HackerOne and picked up a pending private invitation to a program that had previously invited top-ranked hackers. The scope was a single domain. No specific tool versions are given.

To model the feature, the researcher created two projects as an admin:

  • project-A, with project_id xxxxxxxxxxxxxxx
  • project-B, with project_id zzzzzzzzzzzzzzz

project-A was then shared with candidate-A, making its status shared, while project-B remained private. The share link received for project-A was:

The tool used for the second half of the work was Autorize, configured with the cookies and token headers of the candidate user and with scope filters set.

Finding it

The URL carries both the project_id and the share_token_id, and the researcher tried swapping the project_id while keeping a token obtained for another project. If the token were validated only as "a valid share token" rather than "a valid share token for this project", then swapping the project_id while keeping a token obtained legitimately for another project would cross the boundary.

The second observation came from considering how a candidate would obtain the private project_id. Even if the swap worked, a candidate does not know the private project_id of somebody else's project, and the researcher expected a report based only on the swap to be closed as informative or low with the argument that the alphanumeric private project_id cannot be predicted. Finding the private project_id therefore became a separate objective.

Exploitation

Step 1: swap the project_id and keep the shared token

Starting from the legitimate invitation URL for project-A, the researcher replaced the project_id of project-A with the project_id of the private project-B, leaving the share_token_id from project-A untouched:

Requesting that URL returned the private project. The share token issued for project-A was accepted for project-B, so a candidate holding a legitimate invitation to one project could read a project that was still in the private state and was meant to be visible only to the admin.

Step 2: find the private project_id through GraphQL

The remaining problem was obtaining zzzzzzzzzzzzzzz in the first place. The application used GraphQL, so the researcher ran Autorize with the candidate's cookies and token headers and manually browsed every endpoint inside the admin panel. Reviewing the Autorize logs afterwards showed two GraphQL endpoints that returned the private project_id because of a lack of authorisation. A candidate who was a member of project-A could therefore read the private project_id of project-B from those endpoints.

Step 3: the complete chain

The full attack, as the researcher lays it out:

  1. The admin invites candidate-A to project-A, while project-B remains private.
  2. Candidate-A is now a member of project-A.
  3. Through the GraphQL endpoints, candidate-A obtains the private project_id of project-B.
  4. Candidate-A changes the invitation URL from https://example.com/projects/project_id_of_A?share_token_id=some_random_token to https://example.com/projects/project_id_of_B?share_token_id=some_random_token.
  5. Candidate-A gains access to the private project-B without authorisation.

Root cause

The report names two causes:

  1. The share_token_id of project-A is validated as a valid share token for project-B. The token is checked for validity but not for the project it is being used against, so a token for one project was accepted for another.
  2. The private project_id is disclosed to the candidate through the GraphQL endpoints because those endpoints lack authorisation checks.

The token swap needed an identifier, and the identifier disclosure supplied it. Together they form a complete path from an ordinary candidate account to a private project.

Impact

A candidate invited to a shared project could read a private project once they learned its project_id, which the GraphQL endpoints supplied. The private state, described in the report as meaning the project is accessible only by the admin, did not stop this candidate. The report does not describe what a project page contains beyond the project itself, so the sensitivity of the exposed data is not stated.

Fix

The report does not say what was changed or recommend a fix.

Timeline

Event Time
Bug reported Sep 3 2021, 11.57 pm
Triaged and marked as High Sep 4 2021, 00:18 am
Rewarded 750 USD with a compliment Sep 4 2021, 00:35 am
From the original on medium.com

Variants to test

  • Token not bound to resource. On any application with share links of the form `/resource/<id>?[redacted] take a token issued for one resource and substitute the identifier of another resource you do not own. A positive result is a response containing the other resource's content instead of an error or a redirect.
  • Identifier disclosure through GraphQL. With a low-privileged account, replay every GraphQL operation the admin panel issues, using Autorize or a similar tool to compare responses between privilege levels. A positive result is an object identifier or object data returned to the low-privileged session that the UI never shows it.
  • Private versus shared state. Create two objects under your own account, share one and keep the other private, then attempt cross-access with the shared object's credentials. A positive result is any read of the private object.
  • Chained disclosure. Where an identifier is exposed by one endpoint and accepted by another, confirm the chain end to end rather than reporting the disclosure alone, since a disclosure without a usable sink is often triaged as low.

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

What happened, in plain words

A security researcher found a way to read projects on a recruiting website that were supposed to be visible only to the site's administrators. The trick had two parts. First, the website checked that a share link contained a valid share token, but it never checked that the token belonged to the project in the link. So a token handed out for one project could be pasted onto another project's address and it would still work. Second, the website had a hidden data interface (a GraphQL API) that handed out the internal identifier of private projects to ordinary candidates, even though those candidates had no right to see them. Put the two together and an invited candidate could open a private project once they learned its identifier. The researcher reported it, it was triaged as High, and it paid 750 USD.

The product and the feature

Before the technical detail, it helps to understand what the website was. It was a recruiting application: a place where an administrator creates projects and invites candidates to them. Think of it like a shared folder in a cloud drive. The owner creates a folder, and decides who gets to open it.

Each project had one of two states:

  • Shared: the project can be opened by the specific people who were invited to it.
  • Private: the project can be opened only by the administrator. Nobody else, invited or not, is supposed to see it.

When the admin shared a project with a candidate, the candidate received a link. That link looked like this:

Text
https://example.com/projects/alphanumeric_project_id_here?share_token_id=some_random_token_here

Let us take that address apart piece by piece, because every part matters later.

  • https://example.com is the website's address, the same kind of address you type into your browser's bar.
  • /projects/ is the path, telling the server which kind of thing you want: a project.
  • alphanumeric_project_id_here is the project identifier. It is a label made of letters and numbers that uniquely names one project, the way a house number names one house on a street. The report describes it as alphanumeric and unpredictable, meaning you cannot simply guess the next one.
  • ? starts the query string, the part of a web address that carries extra settings.
  • share_token_id=some_random_token_here is a token: a long random string that acts like a temporary key. The server gave it out when the project was shared, and it is meant to prove that whoever holds the link was actually invited.

So opening a shared project required two things at once: the right project identifier and the right share token. The report calls the project identifier alphanumeric and unpredictable.

There was also a GraphQL API. An API (Application Programming Interface) is the back door that a website's own pages use to talk to its server: the page asks the API for data, and the API answers with data. GraphQL is one particular style of API where the client sends a query describing exactly which fields it wants back. Think of it as a restaurant menu where you tick the exact ingredients you want on your plate, rather than ordering a fixed dish. If the kitchen does not check who you are, you can tick ingredients that were never meant for you.

Setting the scene

The researcher hunted on HackerOne, a platform where companies publish bug bounty programmes: they invite security researchers to test their systems and pay for confirmed problems. This particular programme was private, meaning it had previously invited top-ranked hackers only, and the researcher had a pending invitation. The scope was a single domain, so there was one website to look at.

To understand the feature, the researcher acted as an administrator and created two projects:

  • project-A, with project_id xxxxxxxxxxxxxxx
  • project-B, with project_id zzzzzzzzzzzzzzz

These are placeholder identifiers in the report, not real ones. Then project-A was shared with candidate-A, which made project-A's status shared. Project-B was left alone, so it stayed private. The share link the researcher received for project-A was:

Reading it in plain words: go to the projects area, open the project whose identifier is xxxxxxxxxxxxxxx, and prove you were invited with the token yyyyyyyyyyyyyyyy. The token yyyyyyyyyyyyyyyy is the key that was issued specifically for project-A.

For the second half of the work the researcher used a tool called Autorize. Autorize is a browser extension that watches the requests your browser sends while you click around a website, then automatically replays each one with a different set of credentials (for example, as a lower-privileged user) and compares the answers. It is a way of asking, for every single action, "would a less privileged person get the same response?" The researcher configured it with the cookies and token headers of the candidate user, and set scope filters so it only looked at the relevant site.

A cookie is a small piece of data your browser stores for a website and sends back with every request, which is how a site remembers that you are logged in. A header is extra information attached to a request, separate from the address itself, and authentication tokens are often carried there. Both are the digital equivalent of the wristband you get at an event: the door staff check it on every entry.

Finding it

There were two separate observations.

The address carried both the project identifier and the share token, and the researcher tried swapping the identifier while keeping a token obtained for another project. If the server only checked "is this a valid share token?" rather than "is this a valid share token for this project?", then swapping the project identifier while keeping a token obtained legitimately for a different project would cross the boundary. In everyday terms: imagine a cloakroom that checks your ticket is a real ticket, but never checks the ticket number against the coat you are asking for. Any real ticket would fetch any coat.

The second observation came from thinking like the attacker. Even if the swap worked, a candidate does not know the private identifier of somebody else's project. The researcher expected that a report based only on the swap would be closed as informative or low, with the argument that the alphanumeric private identifier cannot be predicted. So finding the private identifier became a goal in its own right. This is an important habit: a bug that needs a secret you cannot obtain is not yet a complete attack.

Exploitation

Step 1: swap the project_id and keep the shared token

Starting from the legitimate invitation link for project-A, the researcher replaced project-A's identifier with project-B's identifier, and left the share token from project-A exactly as it was:

Line by line, in plain words:

  • https://example.com/projects/ is the same website and the same projects area as before.
  • zzzzzzzzzzzzzzz is now project-B's identifier, the private project the researcher was not invited to.
  • ?share_token_id=yyyyyyyyyyyyyyyy is still the token that was issued for project-A.

Requesting that address returned the private project. The share token issued for project-A was accepted for project-B. In other words, a candidate holding a legitimate invitation to one project could read a project that was still private and was meant to be visible only to the administrator. The cloakroom ticket for one coat opened the cupboard for another.

Step 2: find the private project_id through GraphQL

The remaining problem was obtaining zzzzzzzzzzzzzzz in the first place. The application used GraphQL, so the researcher ran Autorize with the candidate's cookies and token headers and manually browsed every endpoint inside the admin panel. Browsing manually matters: the tool can only replay requests that the browser actually made, so the researcher had to visit each screen and press each button to generate traffic.

Reviewing the Autorize logs afterwards showed two GraphQL endpoints that returned the private project identifier because of a lack of authorisation. In plain words: when the candidate's session asked those endpoints for data, the server answered with project identifiers it should have kept to itself. A candidate who was a member of project-A could therefore read the private identifier of project-B from those endpoints. This is an information disclosure: the server reveals data to someone who is not entitled to it. When the disclosure happens because the server fails to check that the requester owns or may see the specific record being asked for, it is often called an IDOR (Insecure Direct Object Reference): the server takes an identifier supplied by the user and returns the matching object without checking permission.

Step 3: the complete chain

The full attack, as the researcher lays it out:

  1. The admin invites candidate-A to project-A, while project-B remains private.
  2. Candidate-A is now a member of project-A.
  3. Through the GraphQL endpoints, candidate-A obtains the private project_id of project-B.
  4. Candidate-A changes the invitation URL from https://example.com/projects/project_id_of_A?share_token_id=some_random_token to https://example.com/projects/project_id_of_B?share_token_id=some_random_token.
  5. Candidate-A gains access to the private project-B without authorisation.

Step 4 deserves a note. The two addresses differ only in the middle: project_id_of_A becomes project_id_of_B. The share_token_id value, written here as some_random_token, stays the same in both. That is the whole trick: one value changes, the other does not, and the server accepts the combination.

Root cause

The report names two causes.

  1. The share_token_id of project-A is validated as a valid share token for project-B. The token is checked for validity but not for the project it is being used against, so a token for one project was accepted for another.
  2. The private project_id is disclosed to the candidate through the GraphQL endpoints because those endpoints lack authorisation checks.

The token swap needed an identifier to aim at, and the identifier disclosure supplied it. Together they form a complete path from an ordinary candidate account to a private project. This is why chaining matters: two medium problems can add up to a high-severity one.

Impact

A candidate invited to a shared project could read a private project once they learned its identifier, which the GraphQL endpoints supplied. The private state, described in the report as meaning the project is accessible only by the administrator, did not stop this candidate. The report does not describe what a project page contains beyond the project itself, so the sensitivity of the exposed data is not stated.

Fix

The report does not say what was changed or recommend a fix. In the cloakroom comparison: check the ticket number against the coat, and do not hand out the list of everyone else's coat numbers.

Timeline

Event Time
Bug reported Sep 3 2021, 11.57 pm
Triaged and marked as High Sep 4 2021, 00:18 am
Rewarded 750 USD with a compliment Sep 4 2021, 00:35 am
From the original on medium.com

Variants to test

These are the same ideas applied more generally, so you can look for similar problems on other sites.

  • Token not bound to resource. On any application with share links of the form `/resource/<id>?[redacted] take a token issued for one resource and substitute the identifier of another resource you do not own. A positive result is a response containing the other resource's content instead of an error or a redirect.
  • Identifier disclosure through GraphQL. With a low-privileged account, replay every GraphQL operation the admin panel issues, using Autorize or a similar tool to compare responses between privilege levels. A positive result is an object identifier or object data returned to the low-privileged session that the UI never shows it.
  • Private versus shared state. Create two objects under your own account, share one and keep the other private, then attempt cross-access with the shared object's credentials. A positive result is any read of the private object.
  • Chained disclosure. Where an identifier is exposed by one endpoint and accepted by another, confirm the chain end to end rather than reporting the disclosure alone, since a disclosure without a usable sink is often triaged as low.

Glossary

  • API (Application Programming Interface): the interface a website's pages use to ask its server for data or actions, separate from the visible page itself.
  • Authorisation: the check that a logged-in user is allowed to do or see a particular thing, as opposed to merely being logged in.
  • Autorize: a browser extension that records requests and replays them with different credentials to compare what each privilege level receives.
  • Bug bounty programme: a scheme where an organisation invites researchers to test its systems and pays for confirmed security problems.
  • Cookie: a small piece of data stored by the browser for a site and sent back with each request, commonly used to keep you logged in.
  • Endpoint: a specific address on a server that accepts requests, for example one particular API operation.
  • GraphQL: a style of API where the client sends a query naming exactly the fields it wants returned.
  • Header: extra information attached to a web request or response, separate from the address, often carrying authentication tokens.
  • HackerOne: a platform that hosts bug bounty programmes and handles reports between researchers and organisations.
  • IDOR (Insecure Direct Object Reference): a flaw where the server accepts an identifier supplied by the user and returns the matching object without checking that the user is allowed to see it.
  • Information disclosure: a flaw where the server reveals data to someone who is not entitled to it.
  • Private project: in this application, a project meant to be accessible only by the administrator.
  • Project identifier (project_id): the alphanumeric label in the URL that uniquely names one project.
  • Query string: the part of a URL after ?, carrying extra settings such as a token.
  • Scope: the set of domains or systems a programme permits researchers to test.
  • Shared project: in this application, a project accessible to the specific candidates who were invited to it.
  • Share token (share_token_id): a random string issued when a project is shared, meant to prove the holder was invited.
  • Token: a random string used as a key to prove identity or permission.
  • Triaged: the stage where a programme reviews a report, confirms the issue and assigns it a severity.
  • Vulnerability class: a category of security flaw, such as IDOR or information disclosure, grouping problems that share a cause.

More by Shakti Mohanty

View all

3 more disclosed reports, best first.

More from Mozilla

View all

The newest disclosed reports for this program.

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.