How I found my first bug (IDOR)
An API endpoint that returned user details was found to be accessible without proper authorisation, allowing an attacker to retrieve personal information of over 7,000 users. The vulnerability was an IDOR (Insecure Direct Object Reference) that exposed PII.
bhansalipratish.medium.com
Published on bhansalipratish.medium.com
Bug Bounty
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
The target was a job finding website, referred to throughout as redacted.com. Users could create an account, add personal details such as name, address, contact information and date of birth, upload a resume, and apply to various companies. The feature at the centre of the write-up is the candidate profile API, which returns the details of the logged-in user.
Setup
The researcher worked as a normal registered user, browsing the site with Burp Suite running so that traffic was captured in the HTTP history. Before hunting, they kept a .txt file listing what was in scope and what was not, plus a checklist of bugs to look for based on the target. They also used SecLists, specifically its api_endpoints.txt wordlist, for fuzzing.
Finding it
After browsing the site as a normal user to get familiar with its functionality, the researcher reviewed the HTTP history to see which parameters and endpoints had been collected. One endpoint stood out:
/api/v2/candidates/me
This endpoint fetched the user details. The me segment, standing in for the current user's identifier, immediately suggested an IDOR test.
Exploitation
Step 1: Replace me with other values
The researcher replaced me with numbers, and also tried admin, Admin, accounts and basic names. They also tried changing the version from v2 to v1. None of these attempts succeeded.
Step 2: Fuzz the endpoint path
Recalling that SecLists contains a common api_endpoints.txt file, the researcher loaded it into Burp Intruder and started fuzzing. The fuzzing produced a 200 OK response on:
/api/v2/users
Step 3: Inspect the response
Checking the response to /api/v2/users showed that it leaked PII of more than 7k users on the website.
The researcher reported the issue and was awarded a reward.
Root cause
The report does not describe the server-side code, so the exact mistake is not stated. What the behaviour shows is that an API endpoint returning user data, /api/v2/users, was reachable without any check that the caller was authorised to receive the records of other users. The /api/v2/candidates/me endpoint scoped results to the current user through the me placeholder, but the sibling /api/v2/users endpoint exposed the collection itself. Likely the endpoint lacked an authorisation check, or relied on the caller not knowing the path rather than on access control.
Impact
An attacker with an account on the site could retrieve PII belonging to more than 7k users. The report does not enumerate which fields were exposed beyond describing the data as PII. The exposure required only that the endpoint be discovered, which the researcher achieved through wordlist fuzzing.
Fix
The report does not say what was changed. Based on the behaviour, the /api/v2/users endpoint should enforce authorisation so that a caller can only retrieve records they are entitled to, and should not return the full user collection to an ordinary authenticated user.
Variants to test
- Replace path segments that stand for the current user, such as
me,selforcurrent, with numeric IDs,admin,Admin,accountsand common names, and try adjacent API versions such asv1in place ofv2. A positive result is a response containing another user's data. - Fuzz the API path with a curated endpoint wordlist such as SecLists
api_endpoints.txtin Burp Intruder. A positive result is a 200 OK on an endpoint that returns records belonging to other users. - When a scoped endpoint like
/api/v2/candidates/meexists, look for collection endpoints at the same level, such as/api/v2/users, that may not apply the same scoping. A positive result is a response listing multiple users' PII.
What happened, in plain words
A security researcher signed up to a job finding website as an ordinary user. While browsing the site with a tool that records every request the browser sends, they noticed one address the site used to fetch their own profile details. The address ended in the word me, which looked like a placeholder for "the person currently logged in". That made them suspect that if they swapped me for something else, the site might hand back somebody else's details. That kind of mistake is called IDOR, short for Insecure Direct Object Reference: the site uses a simple name or number to point at a record, and never checks that the person asking is allowed to see that record.
The direct swaps did not work. So the researcher took a ready-made list of common API addresses and let a tool try them all against the site automatically, a process called fuzzing. One of those addresses, /api/v2/users, answered with a normal success response and returned personal information about more than 7k users. The researcher reported it and was awarded a reward.
Background you need first
A few ideas come up again and again below, so here they are from zero.
Website versus API. A normal web page is meant for human eyes: text, buttons, pictures. An API (Application Programming Interface) is the same website talking to its own pages or to a mobile app in a more machine-friendly way, sending and receiving raw data rather than pretty pages. A useful comparison is a restaurant. The dining room with menus and waiters is the website you see; the kitchen hatch where orders go in and plates come out is the API. You normally never stand at the hatch yourself, but your browser does it for you behind the scenes, and anyone who finds the hatch can knock on it directly.
Endpoint. An endpoint is one specific address on that API, one door at the hatch. Each endpoint does one job: fetch a profile, list orders, save a setting. In this story the interesting doors are /api/v2/candidates/me and /api/v2/users.
Request and response. Your browser sends a request ("please give me my profile") and the server sends back a response (the data, plus a status code). The status code is a three-digit number summarising what happened. 200 OK means "here you go, success". You have probably seen 404 for "not found".
Session cookie or token. When you log in, the server gives your browser a small piece of data, a cookie or token, that it checks on every later request so it knows who you are. Think of a wristband at an event: you show it once at the door, and after that staff glance at your wrist instead of asking for your ID again. If a request carries a valid wristband, the server treats it as coming from that user.
Burp Suite and HTTP history. Burp Suite is a tool that sits between your browser and the website and records every request and response. Its HTTP history is simply that recording, a list you can scroll through afterwards. It is useful because the browser hides most of the traffic from you; the history shows all of it, including the API calls.
Burp Intruder and fuzzing. Fuzzing means trying a large number of variations automatically instead of one at a time. Burp Intruder is the part of Burp Suite that does this: you give it a request with one part marked as the variable, and a list of candidate values, and it sends one request per value. A wordlist is just a text file with one candidate per line. SecLists is a well-known public collection of such wordlists, and one of its files, api_endpoints.txt, contains common API path names.
PII. PII stands for Personally Identifiable Information: data that identifies a real person, such as a name, address, contact details or date of birth.
IDOR. As above, Insecure Direct Object Reference. The site points at a record using something simple (a number, a name, the word me) and does not verify that the requester owns or may see that record. The everyday comparison is a hotel where room numbers are the keys: if reception hands you a key marked 214 and the door of 215 opens with the same key because nobody checks, that is the same mistake in physical form.
The target
The site was a job finding website, called redacted.com throughout the write-up. People could create an account, add personal details such as name, address, contact information and date of birth, upload a resume, and apply to various companies. The feature at the centre of the story is the candidate profile API, the endpoint that returns the details of the logged-in user.
Setting up
The researcher worked as a normal registered user, browsing the site with Burp Suite running so that all traffic landed in the HTTP history. Two habits were in place before any testing started:
- A
.txtfile listing what was in scope and what was not. Scope means the parts of the site the programme has authorised you to test; staying inside it keeps the work legal and welcome. - A checklist of bug types to look for, chosen for this particular target. The researcher notes this is considered good practice and links Notion.so as a place to keep it.
Neither habit is technical. They are the equivalent of writing a shopping list before going to the shop, so you do not wander and forget what you came for.
Finding it
After browsing the site as a normal user to get familiar with its functionality, the researcher reviewed the HTTP history to see which parameters and endpoints had been collected. One endpoint stood out:
/api/v2/candidates/me
Line by line, in plain words:
/api/says this is an API address rather than a normal page.v2is a version number. Sites often keep several versions of an API running at once while older apps catch up.candidatessays which kind of record is being asked for: job candidates.meis the part that matters. It is a placeholder meaning "whoever is logged in right now". The server reads your wristband, works out who you are, and returns your record.
This endpoint fetched the user details. The me segment, standing in for the current user's identifier, immediately suggested an IDOR test: if me is just a stand-in for an identifier, what happens when you supply a different identifier?
Exploitation
Step 1: Replace me with other values
The researcher replaced me with numbers, and also tried admin, Admin, accounts and basic names. They also tried changing the version from v2 to v1. None of these attempts succeeded.
The reasoning: if the server simply pasted whatever came after candidates/ into a database lookup, then candidates/1, candidates/2 and so on would return other people's profiles. Trying admin and accounts checks whether privileged or grouped records sit at guessable names. Trying v1 checks whether an older version of the API, perhaps written before access checks were added, still answers. All of these are cheap guesses, and all of them failed here.
Step 2: Fuzz the endpoint path
Recalling that SecLists contains a common api_endpoints.txt file, the researcher loaded it into Burp Intruder and started fuzzing. The idea is to stop guessing names by hand and let a list of known-common API paths do the guessing. The fuzzing produced a 200 OK response on:
/api/v2/users
Line by line:
/api/again marks an API address.v2is the same version as the profile endpoint, so this door belongs to the same generation of the API.usersis a plural, collection-style name. Wherecandidates/measks for one record,userssounds like it might return the whole set.
A 200 OK here means the server did not refuse the request. It answered as if the request were perfectly normal.
Step 3: Inspect the response
Checking the response to /api/v2/users showed that it leaked PII of more than 7k users on the website.
In other words, the door that answered was not returning one profile. It was returning a large set of personal records, for users other than the researcher, to an ordinary logged-in account. The researcher reported the issue and was awarded a bounty.
Why it worked
The report does not describe the server-side code, so the exact mistake is not stated. What the behaviour shows is that an API endpoint returning user data, /api/v2/users, was reachable without any check that the caller was authorised to receive the records of other users. The /api/v2/candidates/me endpoint scoped results to the current user through the me placeholder, but the sibling /api/v2/users endpoint exposed the collection itself. Likely the endpoint lacked an authorisation check, or relied on the caller not knowing the path rather than on access control.
A comparison: a office building where the front desk checks your badge before letting you into your own floor, but the service corridor has an unmarked door to the filing room and no lock, on the assumption that visitors will not find it. The security was the secrecy of the door, not a lock on it. Fuzzing is exactly the tool that finds unmarked doors.
Impact
An attacker with an account on the site could retrieve PII belonging to more than 7k users. The report does not enumerate which fields were exposed beyond describing the data as PII. The exposure required only that the endpoint be discovered, which the researcher achieved through wordlist fuzzing. No special privileges, no trickery against other users, just a request to a path that answered.
Fix
The report does not say what was changed. Based on the behaviour, the /api/v2/users endpoint should enforce authorisation so that a caller can only retrieve records they are entitled to, and should not return the full user collection to an ordinary authenticated user. In the office comparison: put a lock on the filing room door and check badges at it, rather than trusting that nobody finds the corridor.
Variants to test
These are the same ideas generalised, so you can try them on other sites.
- Replace path segments that stand for the current user, such as
me,selforcurrent, with numeric IDs,admin,Admin,accountsand common names, and try adjacent API versions such asv1in place ofv2. A positive result is a response containing another user's data. - Fuzz the API path with a curated endpoint wordlist such as SecLists
api_endpoints.txtin Burp Intruder. A positive result is a 200 OK on an endpoint that returns records belonging to other users. - When a scoped endpoint like
/api/v2/candidates/meexists, look for collection endpoints at the same level, such as/api/v2/users, that may not apply the same scoping. A positive result is a response listing multiple users' PII.
Takeaways
The researcher's own summary is short: fuzzing is your best friend. The wider lesson is that a single endpoint that behaves correctly tells you what its neighbours might look like, and a wordlist is a cheap way to knock on all of them.
Glossary
- API: the machine-facing part of a website, where pages and apps send and receive raw data instead of human-readable pages.
- Endpoint: one specific address on an API that performs one job, such as fetching a profile.
- Request: the message your browser sends to a server asking for something.
- Response: the message the server sends back, containing data and a status code.
- Status code: a three-digit number summarising the outcome, such as
200 OKfor success or404for not found. - 200 OK: the standard success status code, meaning the server understood and answered the request.
- Session cookie or token: a small piece of data your browser holds after logging in and sends with later requests, so the server knows who you are.
- Burp Suite: a tool that sits between your browser and a website and records every request and response.
- HTTP history: Burp Suite's recorded list of all requests and responses seen so far.
- Parameter: a named value attached to a request, such as a search term or an identifier.
- Fuzzing: automatically trying many variations of a request instead of testing them one by one.
- Burp Intruder: the part of Burp Suite that sends one request per value from a list, used for fuzzing.
- Wordlist: a text file with one candidate value per line, fed to a fuzzing tool.
- SecLists: a public collection of wordlists used in security testing.
api_endpoints.txt: a SecLists wordlist containing common API path names.- PII: Personally Identifiable Information, data that identifies a real person, such as name, address, contact details or date of birth.
- IDOR: Insecure Direct Object Reference, where a site points at a record with a simple name or number and fails to check that the requester is allowed to see it.
- Authorisation: the check that decides whether a logged-in user is allowed to perform a particular action or see a particular record.
- Scope: the parts of a target a testing programme has authorised you to test.
- Bounty: a reward paid by a programme for a valid security report.