A Case Study of API Vulnerabilities
A chain of API flaws let an unauthenticated attacker obtain a Parent entity's UUID from pre-auth requests, then use an IDOR in account creation to assign themselves an admin role and create accounts in any Parent whose ID was known. A further unauthenticated endpoint leaked API keys and administrator details, and a weak JWT secret allowed account takeover by changing the Child ID in a token.
This writeup details a series of vulnerabilities I encountered a few months ago on a single private program. The company did specify that they would like to read the writeup before publication to approve it first.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Context
This write-up covers a chain of API vulnerabilities found on a single private bug bounty program. The company asked to review the write-up before publication, but the program was later shut down and the email account the researcher had been corresponding with was disabled, so the write-up is published in good faith without any identifiable information.
To keep the affected parties private, the report refers to the entities involved as Grandparent, Parent and Child. A Grandparent entity oversees several Parent entities, and a Parent entity manages Child entities (end users). Each entity has an ID value.
The product has a dashboard for managing a Parent, an account creation system, and an API. The Parent ID is the pivot point of the whole chain: it is a UUID, but as the report notes, a UUID is only as safe as the places it leaks.
Setup
The work was done against a private program, so the report does not name the target, the tooling or any versions. The only precondition that matters for the chain is that the attacker starts unauthenticated: the first leaks are reachable by a pre-auth user, and the later steps build on what those leaks return.
Finding it
The researcher noticed that the Parent entity's ID value was a very powerful piece of information. It was a UUID, so it could not be guessed, but it was leaked inside API requests sent by a pre-auth user. A Grandparent ID also leaked in a request that fetched content from an AWS bucket, although on its own that leak is useless pre-auth.
From there the researcher looked at the account creation system and found an IDOR: the request allowed the caller to assign arbitrary roles (such as Admin) in the Parent entity, and it also allowed the caller to create accounts in any Parent whose ID was known. Separately, an endpoint called GetParentById took the Parent ID as a parameter, required no authentication, and returned API keys, administrator details, the Grandparent ID and more sensitive data.
Exploitation
Step 1: obtain the Parent ID pre-auth
The Parent ID is leaked within the API requests sent by a pre-auth user. No request is reproduced in the report for this step; the point is that the value appears in traffic an unauthenticated visitor can already generate. The Grandparent ID also leaks in a request fetching content from an AWS bucket, but the report states this is useless pre-auth.
Step 2: abuse the IDOR in account creation
The account creation system has an IDOR with two effects:
- The caller can assign arbitrary roles, such as Admin, in the Parent entity.
- The caller can create accounts in any Parent, provided the Parent ID is known.
With the Parent ID from step 1, the attacker can therefore escalate to administrator in the Parent entity. The report does not reproduce the request body for this step.
Step 3: call GetParentById unauthenticated
The endpoint GetParentById takes the Parent ID as a parameter and requires no authentication. Given the Parent ID, it leaks API keys, administrator details, the Grandparent ID and more sensitive data. The report does not show the raw request or response.
Step 4: list every Parent under the Grandparent
The Grandparent ID from step 3, combined with the API keys, can be used to list all of the Parent entities for that Grandparent, along with their corresponding Parent IDs.
Step 5: repeat the privilege escalation across the Grandparent
The account creation IDOR from step 2 is then reused to create arbitrary administrator Child accounts in any Parent of the Grandparent. The end user could effectively take over other Parent entities pre-auth, and the report describes the data at play as incredibly sensitive.

Step 6: account takeover through a weak JWT secret
A separate issue arose from the endpoint that generated links sent to Child entities so they could authenticate. The JWT secret used to sign those tokens was weak, so the token could be compromised. With a forged or modified token, account takeover was possible by changing the Child ID inside it.
Step 7: create Grandparent entities without approval
There was also an issue in account creation that let a user create Grandparent entities without the company's approval.
Step 8: find the program's own Grandparent ID
The private program's Grandparent ID leaked in two places: in the company's official GitHub repository, within the commit history, and in a JavaScript file used in the main web application. Chained with the earlier issues, that ID could be used to create admin accounts in the private program's own Parent entities.
Step 9: exploit default endpoint behaviour
Removing the Parent ID value from a specific endpoint caused the API to return an arbitrary production customer's Parent ID. That Parent ID was then used to obtain both the API key and critical PII from the Parent through various API endpoints.
The Parent entity had a dashboard for managing the Parent. From that dashboard it was possible to send a link to someone externally, who would have limited access and could only reach certain features, a common role-based access control pattern in SaaS. By reusing the cookies of that limited-access user against the API rather than the dashboard, it was possible to retrieve the API key and perform almost any high-privilege action.
Root cause
The chain comes from several independent mistakes that reinforce each other:
- Identifiers treated as secrets. The Parent ID is a UUID, but it leaks in pre-auth API requests, in an AWS bucket request (Grandparent ID), in GitHub commit history and in a JavaScript file. Unpredictability is not confidentiality.
- Missing authorisation on object access.
GetParentByIdtakes the Parent ID as a parameter and requires no authentication, so anyone holding the ID gets API keys, administrator details and the Grandparent ID. - IDOR in account creation. The creation flow trusts caller-supplied role and Parent values, so a caller can assign Admin and create accounts in any Parent whose ID is known.
- Weak JWT secret. The link-generation endpoint used a weak JWT secret, so the token could be compromised and the Child ID inside it changed.
- Missing approval on entity creation. Account creation lets a user create Grandparent entities without the company's approval.
- Unsafe default when a parameter is omitted. Removing the Parent ID from one endpoint makes the API fall back to an arbitrary production customer's Parent ID instead of rejecting the request.
- Authorisation enforced only in the UI. The limited-access user could only reach certain features in the dashboard, but the same cookies worked against the API, which returned the API key.
Impact
Under the conditions described, an unauthenticated attacker could escalate to administrator in a Parent, enumerate every Parent under a Grandparent, and create administrator Child accounts in any of them, effectively taking over other Parent entities pre-auth. The report describes the data involved as incredibly sensitive. A weak JWT secret allowed account takeover by modifying the Child ID in a link token. The program's own Grandparent ID, leaked in GitHub history and a JavaScript file, allowed admin accounts to be created in the program's own Parent entities. Removing a parameter from one endpoint returned an arbitrary production customer's Parent ID, which led to that customer's API key and critical PII, and limited-access dashboard cookies replayed against the API yielded the API key for almost any high-privilege action.
Fix
Based on the issues, the changes needed are: stop leaking Parent and Grandparent IDs in pre-auth API responses, bucket requests, JavaScript and repository history; require authentication and object-level authorisation on GetParentById; bind role and Parent values in account creation to the caller's own tenant; use a strong, properly managed JWT secret and validate the Child ID against the authenticated context; require approval for Grandparent creation; reject requests with a missing Parent ID instead of falling back to a default; and enforce the limited-access role in the API, not only in the dashboard.
Variants to test
- Pre-auth identifier leaks. Capture requests an unauthenticated visitor can trigger and search responses for UUIDs and tenant identifiers. A positive result is a Parent or Grandparent ID appearing before login.
- Unauthenticated lookup endpoints. Take any
Get*ByIdstyle endpoint and call it without credentials using an ID from step 1. A positive result is API keys, administrator details or a parent tenant ID in the response. - Role and tenant injection in registration. In account creation, try setting role fields to Admin and Parent IDs to another tenant. A positive result is an account created with elevated role or in a tenant you do not own.
- JWT secret weakness. Collect link tokens and attempt to crack or forge them, then change the subject or Child ID. A positive result is a token the server accepts with a modified ID.
- Missing approval on entity creation. Try creating a top-level entity through the normal signup flow. A positive result is a new Grandparent-level entity without manual review.
- Identifier leaks in public sources. Search the target's GitHub commit history and JavaScript bundles for tenant IDs. A positive result is a live Grandparent or Parent ID.
- Parameter omission. Remove required parameters such as the Parent ID from API calls. A positive result is a response containing another customer's data instead of a validation error.
- UI-only authorisation. Take cookies from a limited-access user and replay them against the API. A positive result is access to API keys or actions the dashboard hides from that role.
Conclusion
APIs do not always behave consistently. Understanding exactly how the application works, and the significance of each component in relation to the others, is what makes a chain like this visible.
What happened, in plain words
A security researcher spent some time testing a company's product, a piece of software that many different organisations pay to use at the same time. The company ran a bug bounty programme, a scheme where a company invites outside people to look for security mistakes in its systems. This particular programme was private, meaning only invited researchers could take part.
The researcher found not one bug but a chain of them. Each bug on its own looked small. Put together, they let a pre-auth user effectively take over other Parent entities and reach sensitive data.
The company asked to read the write-up before it was published, which is a normal courtesy. By the time the researcher wanted to publish, the programme had been shut down and the email account he had been talking to the company with no longer worked. So he published the story anyway, in good faith, with no names, no company details and nothing that could identify anyone.
To keep everyone private, the report gives the three kinds of account made-up names:
- A Grandparent is the top level. It oversees several Parents.
- A Parent is one customer organisation. It manages its own Child accounts.
- A Child is an ordinary end user, a person who logs in and uses the product.
Each of these has an ID, a unique string of characters that identifies it, a bit like a customer number on a bill. If you know someone's customer number, you can often ask a company's systems about that customer.
The ideas you need before we start
A few words come up constantly, so here they are from zero.
API. An API is the way one piece of software talks to another. When you use a website, your browser asks the company's servers for pages. An API is the same idea, but for programs: the dashboard you see, the mobile app, and outside tools all send requests to the API and get answers back, usually in a structured text format rather than a web page. Think of a restaurant: the dining room is the website you see, the kitchen is the company's database, and the API is the waiter who carries your order to the kitchen and brings back the food. If the waiter will carry any order to any table without checking who asked, that is an API problem.
Request and response. A request is a message your browser or program sends to a server, asking for something. A response is the server's reply. Both are just text with a structure.
Parameter. A parameter is a named value attached to a request, like parentId=123. It tells the server which specific thing you mean.
UUID. A UUID is a long random-looking identifier, something like a very long serial number. Because it is random, you cannot guess one. But random is not the same as secret: if the value is printed somewhere you can read, guessing is unnecessary.
Pre-auth (unauthenticated). Pre-auth means before logging in. Some parts of a website work for visitors who have not signed in, such as the login page itself or a public marketing page. Anything those parts reveal can be seen by anyone on the internet.
Authentication and authorisation. Authentication is proving who you are, like showing a passport. Authorisation is what you are allowed to do once you are known, like a passport not granting you the right to enter every room in the building. Many bugs are authorisation bugs: the system knows who you are but never checks whether you should be allowed to do what you asked.
IDOR. IDOR stands for Insecure Direct Object Reference. It means the system lets you name an object by its ID and hands it over without checking that the object belongs to you. Everyday comparison: a hotel clerk gives a room key to anyone who says a room number, without checking that the person is the guest in that room.
Role. A role is a label that says what a user may do, for example Admin (full control) or Viewer (read only).
Cookie. A cookie is a small piece of text a website stores in your browser so it can recognise you on your next request. When you log in, the server gives your browser a cookie, and your browser sends it back with every request. It works like a wristband at an event: show the wristband, get in without queueing again. If someone else copies your wristband, they get in as you.
Token and JWT. A token is a piece of text that stands in for a login, often used in links. JWT stands for JSON Web Token, a common format for such tokens. A JWT carries some information, such as which user it is for, and a signature made with a secret key so the server can tell it has not been altered. If the secret key is weak, an attacker can make their own valid-looking token, like forging a signed letter because the signature is easy to copy.
AWS bucket. Amazon Web Services offers storage space in the cloud called a bucket, used to hold files such as images. Files in a bucket can sometimes be fetched by anyone who knows the address.
PII. Personally Identifiable Information: data that identifies a real person, such as a name, address or phone number.
Multi-tenant. A multi-tenant system serves many separate customer organisations from the same software and the same servers. Each customer is a tenant. The whole point is that one tenant must never see another tenant's data.
Dashboard. The dashboard is the web page where a Parent organisation manages its account, its users and its settings.
GitHub and commit history. GitHub is a website where software teams store and share code. Every change saved to a project is called a commit, and the full history of commits is kept. Anything ever committed stays in that history, even if it is deleted from the current version of the files.
JavaScript file. JavaScript is the programming language that runs inside web pages in your browser. The files are downloaded to your computer when you open the site, so anyone can read them.
The setup
The testing was done against a private programme, so the report does not name the target, the tools used or any software versions. The one thing that matters for following the chain is the starting position: the attacker is not logged in. The first leaks can be reached by an ordinary visitor, and every later step builds on what the earlier ones returned.
Finding it
The researcher noticed that the Parent ID was an extremely valuable piece of information. It was a UUID, so nobody could guess it. But it was being leaked inside API requests that a pre-auth user sends. In other words, the value was travelling in traffic that any visitor's browser produces, where anyone watching their own browser's network activity could read it.
A Grandparent ID also leaked, in a request that fetched content from an AWS bucket. On its own, before login, that leak is useless, because knowing a Grandparent's number does not get you anything yet.
Next the researcher looked at the account creation system, the part of the product that signs new users up, and found an IDOR there. It had two effects. First, the request let the caller choose arbitrary roles, such as Admin, for the account being created. Second, it let the caller create an account inside any Parent, as long as the Parent ID was known.
Separately, there was an endpoint called GetParentById. An endpoint is a specific address on the API that does one job, like a counter in a post office: this one's job is to look up a Parent by its ID. It took the Parent ID as a parameter, required no login at all, and returned API keys, administrator details, the Grandparent ID and more sensitive data. An API key is a long secret string that programs use instead of a password, so whoever holds it can act as the owner.
Exploitation, step by step
Step 1: get the Parent ID without logging in
The Parent ID is leaked inside the API requests that a pre-auth user sends. The report does not reproduce any request for this step. The point is simply that the value appears in traffic an unauthenticated visitor can already generate, so the attacker does not need an account to learn it. The Grandparent ID also leaks in a request that fetches content from an AWS bucket, but the report says that leak is useless before login.
Why this step matters: everything that follows needs a Parent ID to aim at. Without it, the attacker has nothing to point the later bugs at.
Step 2: abuse the IDOR in account creation
The account creation system has an IDOR with two effects:
- The caller can assign arbitrary roles, such as Admin, in the Parent entity.
- The caller can create accounts in any Parent, provided the Parent ID is known.
With the Parent ID from step 1, the attacker can therefore make themselves an administrator of the Parent. The report does not reproduce the request body for this step.
Why this step matters: this is the first privilege escalation. The attacker arrives as a nobody and leaves as an admin of a customer organisation, simply because the signup form believed whatever role and Parent it was told.
Step 3: call GetParentById without logging in
The endpoint GetParentById takes the Parent ID as a parameter and requires no authentication. Given the Parent ID, it leaks API keys, administrator details, the Grandparent ID and more sensitive data. The report does not show the raw request or response.
Why this step matters: the attacker now holds the keys to the Parent and, crucially, learns the Grandparent ID, which unlocks the level above.
Step 4: list every Parent under the Grandparent
The Grandparent ID from step 3, combined with the API keys, can be used to list all of the Parent entities for that Grandparent, along with their corresponding Parent IDs.
Why this step matters: the attacker started with one customer organisation and now has a list of every sibling organisation under the same top-level account, each with its ID.
Step 5: repeat the privilege escalation across the Grandparent
The account creation IDOR from step 2 is then reused to create arbitrary administrator Child accounts in any Parent of the Grandparent. The end user could effectively take over other Parent entities pre-auth, and the report describes the data at play as incredibly sensitive.

Why this step matters: the same small bug, pointed at a list of IDs instead of one, turns into a takeover of every organisation under the top-level account, all without ever logging in.
Step 6: account takeover through a weak JWT secret
A separate issue arose from the endpoint that generated links sent to Child entities so they could authenticate. In plain terms: the product could email or otherwise send a user a link that logs them in, and that link contained a JWT. The JWT secret used to sign those tokens was weak, so the token could be compromised. With a forged or modified token, account takeover was possible by changing the Child ID inside it.
Why this step matters: a token is supposed to be tamper-proof because of its signature. If the secret behind the signature is weak, the signature proves nothing, and the attacker can rewrite the token to say it belongs to a different Child, which is account takeover: logging in as someone else.
Step 7: create Grandparent entities without approval
There was also an issue in account creation that let a user create Grandparent entities without the company's approval.
Why this step matters: top-level accounts are normally created only after a company checks who you are. Being able to make one yourself means you can set up a whole new top-level structure on the platform at will.
Step 8: find the programme's own Grandparent ID
The private programme's Grandparent ID leaked in two places: in the company's official GitHub repository, within the commit history, and in a JavaScript file used in the main web application. Chained with the earlier issues, that ID could be used to create admin accounts in the private programme's own Parent entities.
Why this step matters: this is the same identifier leak as before, but in public places. Code history and browser files are readable by anyone, so a value that was meant to be internal was effectively published.
Step 9: exploit default endpoint behaviour
Removing the Parent ID value from a specific endpoint caused the API to return an arbitrary production customer's Parent ID. That Parent ID was then used to obtain both the API key and critical PII from the Parent through various API endpoints.
Why this step matters: a request with a missing value should be rejected with an error. Instead, the API quietly chose a default, and that default belonged to a real customer in the live system. This is like a form that, if you leave the name blank, fills in a stranger's name for you.
The Parent entity had a dashboard for managing the Parent. From that dashboard it was possible to send a link to someone externally, who would have limited access and could only reach certain features, a common role-based access control pattern in SaaS. By reusing the cookies of that limited-access user against the API rather than the dashboard, it was possible to retrieve the API key and perform almost any high-privilege action.
Why this step matters: the limited role was enforced only by the dashboard screens. The API behind the dashboard never checked the role, so the same cookie that gave a guest a few buttons gave the API full power. The restriction existed in the shop window, not in the stockroom.
Why it all worked
The chain comes from several independent mistakes that reinforce each other:
- Identifiers treated as secrets. The Parent ID is a UUID, but it leaks in pre-auth API requests, in an AWS bucket request (Grandparent ID), in GitHub commit history and in a JavaScript file. Unpredictability is not confidentiality.
- Missing authorisation on object access.
GetParentByIdtakes the Parent ID as a parameter and requires no authentication, so anyone holding the ID gets API keys, administrator details and the Grandparent ID. - IDOR in account creation. An IDOR in account creation lets a caller assign Admin and create accounts in any Parent whose ID is known.
- Weak JWT secret. The link-generation endpoint used a weak JWT secret, so the token could be compromised and the Child ID inside it changed.
- Missing approval on entity creation. Account creation lets a user create Grandparent entities without the company's approval.
- Unsafe default when a parameter is omitted. Removing the Parent ID from one endpoint makes the API fall back to an arbitrary production customer's Parent ID instead of rejecting the request.
- Authorisation enforced only in the UI. The limited-access user could only reach certain features in the dashboard, but the same cookies worked against the API, which returned the API key.
What it meant in practice
Under the conditions described, an unauthenticated attacker could escalate to administrator in a Parent, enumerate every Parent under a Grandparent, and create administrator Child accounts in any of them, effectively taking over other Parent entities pre-auth. The report describes the data involved as incredibly sensitive. A weak JWT secret allowed account takeover by modifying the Child ID in a link token. The programme's own Grandparent ID, leaked in GitHub history and a JavaScript file, allowed admin accounts to be created in the programme's own Parent entities. Removing a parameter from one endpoint returned an arbitrary production customer's Parent ID, which led to that customer's API key and critical PII, and limited-access dashboard cookies replayed against the API yielded the API key for almost any high-privilege action.
How it should have been fixed
Based on the issues, the changes needed are: stop leaking Parent and Grandparent IDs in pre-auth API responses, bucket requests, JavaScript and repository history; require authentication and object-level authorisation on GetParentById; bind role and Parent values in account creation to the caller's own tenant; use a strong, properly managed JWT secret and validate the Child ID against the authenticated context; require approval for Grandparent creation; reject requests with a missing Parent ID instead of falling back to a default; and enforce the limited-access role in the API, not only in the dashboard.
Things to try on your own targets
These are the same ideas turned into checks you can repeat elsewhere. Each one starts with a normal action and looks for a surprising answer.
- Pre-auth identifier leaks. Capture requests an unauthenticated visitor can trigger and search responses for UUIDs and tenant identifiers. A positive result is a Parent or Grandparent ID appearing before login.
- Unauthenticated lookup endpoints. Take any
Get*ByIdstyle endpoint and call it without credentials using an ID from step 1. A positive result is API keys, administrator details or a parent tenant ID in the response. - Role and tenant injection in registration. In account creation, try setting role fields to Admin and Parent IDs to another tenant. A positive result is an account created with elevated role or in a tenant you do not own.
- JWT secret weakness. Collect link tokens and attempt to crack or forge them, then change the subject or Child ID. A positive result is a token the server accepts with a modified ID.
- Missing approval on entity creation. Try creating a top-level entity through the normal signup flow. A positive result is a new Grandparent-level entity without manual review.
- Identifier leaks in public sources. Search the target's GitHub commit history and JavaScript bundles for tenant IDs. A positive result is a live Grandparent or Parent ID.
- Parameter omission. Remove required parameters such as the Parent ID from API calls. A positive result is a response containing another customer's data instead of a validation error.
- UI-only authorisation. Take cookies from a limited-access user and replay them against the API. A positive result is access to API keys or actions the dashboard hides from that role.
Conclusion
APIs do not always behave consistently. Understanding exactly how the application works, and the significance of each component in relation to the others, is what makes a chain like this visible.
Glossary
- API: the interface programs use to talk to a company's servers, separate from the web pages a person sees.
- API key: a long secret string that lets a program act as an account owner, used instead of a password.
- Authentication: proving who you are, for example by logging in.
- Authorisation: what you are allowed to do once the system knows who you are.
- AWS bucket: cloud storage offered by Amazon Web Services, used to hold files.
- Bug bounty programme: a scheme where a company invites outside researchers to find and report security bugs, usually for a reward.
- Child: in this report, an ordinary end user managed by a Parent.
- Commit history: the full record of every saved change in a code project, kept even after files are edited or deleted.
- Cookie: a small piece of text stored in your browser that lets a site recognise you on later requests.
- Dashboard: the web page where a customer organisation manages its account and users.
- Endpoint: a specific address on an API that performs one job.
- Grandparent: in this report, the top-level entity that oversees several Parents.
- ID: a unique value that identifies a record, like a customer number.
- IDOR: Insecure Direct Object Reference, where a system hands over an object named by its ID without checking that it belongs to the requester.
- JavaScript: the language that runs inside web pages in your browser; its files are downloaded and readable by anyone.
- JWT: JSON Web Token, a text token carrying information plus a signature made with a secret key.
- Multi-tenant: one system serving many separate customer organisations, each of which must never see the others' data.
- Parameter: a named value attached to a request that tells the server which thing you mean.
- Parent: in this report, one customer organisation that manages its own Child users.
- PII: Personally Identifiable Information, data that identifies a real person.
- Pre-auth: before logging in; reachable by any visitor.
- Privilege escalation: gaining more permissions than you were given.
- Request / response: the message a client sends to a server, and the server's reply.
- Role: a label such as Admin or Viewer that defines what a user may do.
- SaaS: software sold as a service, run by the vendor and used over the internet by many customers.
- Token: a piece of text that stands in for a login, often carried in a link.
- UUID: a long random-looking identifier that cannot be guessed but is not secret if it is exposed.
- Vulnerability: a mistake in software that lets someone do something they should not be able to do.