P2 Vulnerability : IDOR Exposes Other Users’ Personal Data
The profile API returned a user's record based on a numeric identifier supplied in the request path, without checking that the logged-in caller owned that record. Any authenticated user could change the identifier and read other users' names, emails, phone numbers and addresses, and sequential IDs made bulk harvesting easy.
Published on medium.com
Idor Vulnerability
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 is a profile API that returns a user's personal record by numeric identifier. The request in question is GET /api/v1/users/10451/profile, where the numeric segment is the user's identifier. In normal use, an authenticated user opens their own profile page, the front end issues this request with their own identifier, and the API returns the matching record: full name, email address, phone number and postal address.
The report classifies the issue as P2, High: any logged-in user can read another user's profile data by changing the numeric identifier in the request. Write or modify access was not confirmed, which is why the researcher kept it below P1.
The researcher's own severity breakdown:
| Factor | Assessment |
|---|---|
| Attack complexity | Low, a single parameter change |
| Privileges required | Low, any standard account |
| Confidentiality impact | High, PII of other users |
| Integrity / availability impact | None observed |
| Indicative CVSS 3.1 | ~6.5 (AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N) |
Setup
The only precondition is the ability to hold two ordinary accounts and to intercept and replay HTTP requests. The researcher's steps use only two accounts under the tester's control:
- Account A, the attacker account.
- Account B, the victim account.
Both are standard accounts; no elevated role is needed. Requests are captured and replayed in an approved proxy tool, and the two sessions are kept separate, one per browser session.
Finding it
The profile API decides which record to return from the user_id path parameter, but it does not check that the authenticated user owns, or is otherwise permitted to view, that record. Because the identifiers are sequential and predictable, an attacker could enumerate PII for a large portion of the user base.
What makes it look wrong is the combination of two properties: the object identifier is taken from client input rather than derived from the session, and the values are easy to guess. The second property amplifies the issue but, as the researcher stresses, is not the core flaw. The core flaw is the missing object-level authorization check.
Exploitation
Step 1: create the two accounts
Create Account A (attacker) and Account B (victim). Both are ordinary accounts.
Step 2: record the victim's identifier
Log in as Account B and note its user ID from the profile page or from an API response. In the researcher's test this value was 10452.
Step 3: open the attacker's profile
Log in as Account A in a separate browser session and open the profile page. Keeping the sessions separate matters: the request that follows must carry Account A's credentials while asking for Account B's record.
Step 4: capture the request
Capture the profile request in an approved proxy tool. The captured request, with Account A's token, looks like this:
GET /api/v1/users/10451/profile
Authorization: Bearer [Account A token]
Here 10451 is Account A's own identifier and the Authorization header carries Account A's bearer token. The server uses the token to establish who is calling, and the path segment to decide which record to return.
Step 5: swap the identifier and resend
Replace the ID with Account B's ID (10452) and resend the request using Account A's token. Nothing else changes: same method, same path shape, same header, only the numeric segment differs.
Step 6: inspect the response
The expected result is 403 Forbidden or 404 Not Found. The observed result was 200 OK with Account B's profile:
The response body confirms that the record returned belongs to Account B, not to the account whose token was presented. The researcher redacted the values in the published evidence.
Root cause
The researcher lists three contributing factors:
- The server checks authentication (a valid session) but not authorization (does this user have access to this object?).
- The object identifier is trusted from client input instead of being derived from the session.
- Predictable sequential IDs make valid targets easy to guess. This amplifies the issue but is not the core flaw.
In other words, the server checks that the caller is logged in but never asks whether this is the right user for this object. The existing defence, a valid session, answers "is this a logged-in user?" and never asks "is this the right user for this object?".
The report maps the pattern to OWASP API Security Top 10 API1:2023 Broken Object Level Authorization, OWASP Top 10 A01:2021 Broken Access Control and CWE-639, Authorization Bypass Through User-Controlled Key.
Impact
The researcher's impact assessment:
- Data exposure: unauthorised disclosure of other users' PII.
- Scale: sequential IDs allow automated harvesting across the entire user base.
- Downstream risk: harvested data enables targeted phishing, social engineering and credential-stuffing attempts.
- Compliance: may trigger breach-notification obligations under GDPR, India's DPDP Act or similar laws, depending on the data and the jurisdiction.
What was not demonstrated: data modification, account takeover, or access to payment or authentication secrets. The researcher notes that any of these would justify escalation to P1. The impact is therefore disclosure of profile fields, with write or modify access not confirmed.
Fix
The researcher's recommended remediation, in the order given:
- Enforce object-level authorization server-side on every request: verify
resource.owner_id == session.user_idor check role-based permissions. - Derive identity from the session for "my profile" routes, for example
GET /api/v1/me/profile. - Centralise access checks in middleware or a policy layer rather than per-handler logic.
- Use non-sequential identifiers (UUIDs) as defence in depth, not as a substitute for authorization.
- Audit similar endpoints (orders, invoices, documents, settings) for the same pattern.
- Add regression tests asserting that cross-account requests return 403 or 404.
- Monitor and rate-limit for one session requesting many distinct object IDs.
- Review logs for historical exploitation, looking for requester ID not equal to owner ID.
The report does not state which of these, if any, were implemented.
Variants to test
- Sibling object types. Audit orders, invoices, documents and settings endpoints for the same pattern, as the researcher suggests. A positive result is a
200carrying another account's data where a403or404is expected. A positive result is any response whose body belongs to an object you do not own. A positive result is a record returned for an owner other than the token holder. A positive result is a run of successful cross-account reads with no throttling. A positive result is a state change on another account's object; the original report did not confirm this.
Evidence to include
When reporting this class of issue, the researcher recommends attaching:
- Redacted request/response pairs for both accounts.
- Screenshots showing the two separate sessions.
- Timestamps of testing.
- Confirmation that only researcher-controlled accounts were accessed.
What happened, in plain words
A website had a page that shows you your own profile: your name, email address, phone number and postal address. Behind that page, the site asks a server for the information using a small web address that ends in a number, and that number is the user's ID. The server looked at the number, fetched the matching record and sent it back. It checked that the person asking was logged in, but it never checked that the person asking was the owner of the record they were asking for.
So any logged-in user could change the number in the request to somebody else's number and receive that person's personal details. The researcher who found this rated it P2, High: serious, but not the most serious level, because write or modify access was not confirmed.
The report calls this an IDOR, which stands for Insecure Direct Object Reference. The name sounds complicated; the idea is simple. Imagine a hotel where the receptionist hands you the key to room 10451. You notice the keys are numbered in order, so you ask for the key to room 10452 instead, and the receptionist hands it over without checking that you booked that room. The key is the "direct object reference": a plain, guessable name for something you should not be able to reach. The problem is not that the keys have numbers. The problem is that nobody checked whether the room was yours.
The target: a profile API
Before the details, two words need explaining.
An API (Application Programming Interface) is the part of a website that the page itself talks to in order to get data. When you open your profile page, the page you see is mostly an empty shell; a piece of code inside it sends a request to the API, the API replies with your data, and the page fills in the blanks. Think of a restaurant: the menu and the table are the website you see, the kitchen is the API, and the waiter carrying orders back and forth is the request. You never walk into the kitchen yourself, but everything on your plate came from there.
An endpoint is one specific address inside that API, one dish on the kitchen's list. The endpoint in this report is:
Read it piece by piece:
GETis the type of request. It means "give me something", as opposed to sending or changing something./api/v1/users/is the fixed part of the address: it points at the users section of the API, version 1.{user_id}is a placeholder. In a real request it is replaced by an actual number, the user's identifier./profilesays which piece of that user's data is wanted: the profile.
A path parameter is a value built into the address itself, like the 10452 in /users/10452/profile, rather than sent separately. It is part of the URL, visible to anyone who looks.
In normal use, you open your own profile page, the page sends this request with your own number, and the API returns your record: full name, email address, phone number and postal address. That is the feature working as designed.
Severity: why P2 and not P1
Bug bounty programmes rank findings by severity, usually from P1 (most serious) down to P5 (informational). This one was rated P2, High. The researcher's reasoning: any logged-in user can read another user's profile data by changing one number, but write or modify access was not confirmed. Being able to read other people's data is bad; being able to change it, or take over their account, would be worse, and that is what would have pushed it to P1.
The researcher also gave a breakdown of the factors that feed into a severity score:
| Factor | Assessment |
|---|---|
| Attack complexity | Low, a single parameter change |
| Privileges required | Low, any standard account |
| Confidentiality impact | High, PII of other users |
| Integrity / availability impact | None observed |
| Indicative CVSS 3.1 | ~6.5 (AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N) |
A few of those terms need unpacking.
Attack complexity describes how much skill or luck the attack needs. "Low" means it is a single change of one value, no special tricks.
Privileges required describes what kind of account the attacker needs. "Low" here means any ordinary account, no administrator rights.
Confidentiality, integrity and availability are the three classic properties of data. Confidentiality means only the right people can see it. Integrity means only the right people can change it. Availability means it is there when needed. Here confidentiality was hit hard (other people's personal data became visible), while integrity and availability were untouched.
PII stands for Personally Identifiable Information: data that can identify a real person, such as a name, email address, phone number or home address. It is the kind of data that privacy laws care about.
CVSS is a standard scoring system for vulnerabilities, producing a number from 0 to 10. The string in brackets is the set of answers that produced the score. AV:N means the attack can come over the network; AC:L means low attack complexity; PR:L means low privileges needed; UI:N means no action from the victim is required; S:U means the impact stays within the vulnerable component; C:H means high confidentiality impact; I:N and A:N mean no integrity or availability impact. A score of about 6.5 sits in the middle of the range: clearly a problem, not a catastrophe.
Setting up the test
The only things needed to reproduce this are two ordinary accounts and a way to look at and resend the requests a browser makes. The researcher's steps use only two accounts under the tester's own control:
- Account A, the attacker account.
- Account B, the victim account.
Both are standard accounts; no elevated role is needed. The two sessions are kept separate, one per browser session.
Why two accounts? Because the whole question is whether one account can reach another account's data. With a single account you can only see your own record, which proves nothing. With two, you can log in as one and ask for the other's data, and the answer tells you whether the check exists.
Why a proxy tool? A proxy sits between your browser and the website and lets you see, pause and edit the traffic going both ways. Normally the browser builds the request for you and you never see it. A proxy lets you look at the request, change one number, and send it again. The researcher used an approved proxy tool, meaning one the programme allows.
Finding it
The profile API decides which record to return from the user_id path parameter, but it does not check that the logged-in user owns, or is otherwise permitted to view, that record. Because the identifiers are sequential and predictable, an attacker could enumerate PII for a large portion of the user base.
Two properties combine to make this look wrong. First, the object identifier is taken from what the client sends rather than derived from the session. Second, the values are easy to guess. The second property amplifies the issue but, as the researcher stresses, is not the core flaw. The core flaw is the missing object-level authorization check. Even with random identifiers, the server would still be handing out records to anyone who asked with the right number.
Exploitation, step by step
Step 1: create the two accounts
Create Account A (attacker) and Account B (victim). Both are ordinary accounts. This gives you a controlled pair: one identity to make the request, one identity whose data should be out of reach.
Step 2: record the victim's identifier
Log in as Account B and note its user ID from the profile page or from an API response. In the researcher's test this value was 10452. You need this number because it is the target: the record you will try to reach from the other account.
Step 3: open the attacker's profile
Log in as Account A in a separate browser session and open the profile page. Keeping the sessions separate matters: the request that follows must carry Account A's credentials while asking for Account B's record. If you mixed the sessions up, you would be asking for your own data with your own credentials, and the test would prove nothing.
Step 4: capture the request
Capture the profile request in an approved proxy tool. The captured request, with Account A's token, looks like this:
GET /api/v1/users/10451/profile
Authorization: Bearer [Account A token]
Line by line:
GET /api/v1/users/10451/profileis the request line.GETasks for data. The path points at the users section of the API, version 1, then at user10451, then at that user's profile. Here10451is Account A's own identifier, because you are logged in as Account A and looking at your own profile.Authorization: Bearer [Account A token]is a header. Headers are extra lines of information attached to a request, like the label on a parcel. This one carries the token.
A token is a long string of characters that the site gave you when you logged in, and that your browser sends with every request to prove who you are. Think of it as a wristband at an event: you show it at the door, and staff let you in without asking for your name and password again. Bearer is simply the name of the scheme, meaning "whoever bears this token is the user". The token is a secret: anyone who has it can act as you, which is why it is redacted here.
The server uses the token to establish who is calling, and the path segment to decide which record to return. That split is exactly where the bug lives.
Step 5: swap the identifier and resend
Replace the ID with Account B's ID (10452) and resend the request using Account A's token. Nothing else changes: same method, same path shape, same header, only the numeric segment differs. Changing one thing at a time is what makes the result meaningful: if the answer changes, the number is the reason.
Step 6: inspect the response
The expected result is 403 Forbidden or 404 Not Found. Those are HTTP status codes, the short numeric answers a server gives to every request. 200 means "here you go, success". 403 means "I know who you are, but you are not allowed". 404 means "there is nothing here by that name". Either of the last two would have been the correct answer here, because the record does not belong to the caller.
The observed result was 200 OK with Account B's profile:
This is a JSON object, a common way of writing structured data as text: curly braces hold a set of labelled values, each label in quotes followed by a colon and the value. Line by line:
"id": 10452is the identifier of the record returned. It is Account B's number, not Account A's."name","email","phone"and"address"are the personal fields of that record. The researcher redacted the actual values in the published evidence, so the shape is visible but the private data is not.
The response body confirms that the record returned belongs to Account B, not to the account whose token was presented. That is the proof: the server accepted Account A's wristband and still opened Account B's door.
Root cause
The researcher lists three contributing factors:
- The server checks authentication (a valid session) but not authorization (does this user have access to this object?).
- The object identifier is trusted from client input instead of being derived from the session.
- Predictable sequential IDs make valid targets easy to guess. This amplifies the issue but is not the core flaw.
The difference between authentication and authorization is worth fixing in your head, because it is the heart of this class of bug. Authentication answers "who are you?" and is handled by the token. Authorization answers "are you allowed to do this?" and was missing. A building with a working front door lock but no lock on the individual offices has good authentication and no authorization.
In other words, the server checks that the caller is logged in but never asks whether this is the right user for this object. The existing defence, a valid session, answers "is this a logged-in user?" and never asks "is this the right user for this object?".
The report maps the pattern to OWASP API Security Top 10 API1:2023 Broken Object Level Authorization, OWASP Top 10 A01:2021 Broken Access Control and CWE-639, Authorization Bypass Through User-Controlled Key. Those are three well-known catalogues of vulnerability types; the names all describe the same idea, that a check on who may access a specific object is missing or can be bypassed by a value the user controls.
Impact
The researcher's impact assessment:
- Data exposure: unauthorised disclosure of other users' PII.
- Scale: sequential IDs allow automated harvesting across the entire user base.
- Downstream risk: harvested data enables targeted phishing, social engineering and credential-stuffing attempts.
- Compliance: may trigger breach-notification obligations under GDPR, India's DPDP Act or similar laws, depending on the data and the jurisdiction.
A few of those need a plain explanation. Harvesting means collecting data automatically, in bulk, rather than one record at a time. Because the IDs run in order, a simple script could walk from one number to the next and collect record after record. Phishing is a fake message designed to trick someone into handing over information or clicking something harmful; knowing a person's real name, email and address makes such a message far more convincing. Social engineering is the broader version of the same trick: manipulating people rather than machines. Credential stuffing is trying email and password pairs stolen elsewhere against this site, on the bet that people reuse passwords. GDPR is the European data protection law and DPDP is India's Digital Personal Data Protection Act; both can require an organisation to notify authorities and users when personal data is exposed.
What was not demonstrated: data modification, account takeover, or access to payment or authentication secrets. The researcher notes that any of these would justify escalation to P1. The impact is therefore disclosure of profile fields, with write or modify access not confirmed.
Fix
The researcher's recommended remediation, in the order given:
- Enforce object-level authorization server-side on every request: verify
resource.owner_id == session.user_idor check role-based permissions. In plain words: before returning a record, compare the owner written on the record with the user the token belongs to, and refuse if they differ. The==is just "is equal to". - Derive identity from the session for "my profile" routes, for example
GET /api/v1/me/profile. Instead of letting the client say which user it wants, the server reads the user from the token and looks up that person's profile. The wordmemeans "whoever is logged in". - Centralise access checks in middleware or a policy layer rather than per-handler logic. Middleware is code that runs on every request before the main handler, a shared checkpoint rather than a separate guard at every door.
- Use non-sequential identifiers (UUIDs) as defence in depth, not as a substitute for authorization. A UUID is a long random-looking identifier that is impractical to guess. It makes guessing harder but does not fix the missing check, which is why the researcher calls it defence in depth: an extra layer, not the fix itself.
- Audit similar endpoints (orders, invoices, documents, settings) for the same pattern. If one endpoint forgot the check, its neighbours may have too.
- Add regression tests asserting that cross-account requests return 403 or 404. A regression test is an automated check that runs again and again, so the bug cannot quietly come back later.
- Monitor and rate-limit for one session requesting many distinct object IDs. Rate limiting means capping how many requests one user can make in a period, so bulk harvesting becomes slow or blocked.
- Review logs for historical exploitation, looking for requester ID not equal to owner ID. Logs are the records a server keeps of what happened; searching them for requests where the caller and the owner differ shows whether anyone already exploited the flaw.
The report does not state which of these, if any, were implemented.
Variants to test
Once you understand the pattern, the same idea can be tried in other places.
- Sibling object types. Audit orders, invoices, documents and settings endpoints for the same pattern, as the researcher suggests. A positive result is a
200carrying another account's data where a403or404is expected. A query string is the part of a URL after a question mark, carrying extra values. A positive result is any response whose body belongs to an object you do not own. A positive result is a record returned for an owner other than the token holder. Enumeration means trying values one after another, in order. A positive result is a run of successful cross-account reads with no throttling. A positive result is a state change on another account's object; the original report did not confirm this.
Evidence to include
When reporting this class of issue, the researcher recommends attaching:
- Redacted request/response pairs for both accounts.
- Screenshots showing the two separate sessions.
- Timestamps of testing.
- Confirmation that only researcher-controlled accounts were accessed.
Redacted means sensitive values are blacked out or replaced, as with the token and the personal fields above. Showing both accounts' requests and responses proves the two identities were genuinely separate. Timestamps show when the testing happened. Confirming that only your own test accounts were touched shows you did not read real users' data while proving the point.
Glossary
- API: the part of a website that pages talk to in order to fetch or send data, like the kitchen behind a restaurant's menu.
- Endpoint: one specific address inside an API that performs one job.
- GET: the request type that asks a server to return data without changing anything.
- Path parameter: a value built into the URL itself, such as a user ID in
/users/10452/profile. - Query string: the part of a URL after a question mark that carries extra values.
- Header: an extra line of information attached to a request or response, such as the one carrying a token.
- Token: a secret string issued at login that proves who you are on later requests, like a wristband at an event.
- Bearer: the name of the scheme meaning "whoever carries this token is the user".
- Proxy tool: software that sits between your browser and a site so you can view, pause and edit requests.
- HTTP status code: the short numeric answer a server gives, such as 200 (success), 403 (not allowed) or 404 (not found).
- JSON: a text format for structured data, using curly braces and labelled values.
- IDOR (Insecure Direct Object Reference): a flaw where a user can reach someone else's data by changing a plain, guessable identifier.
- Authentication: checking who a user is.
- Authorization: checking whether a user is allowed to do a particular thing.
- Object-level authorization: checking that a user is allowed to access this specific record, not just that they are logged in.
- PII (Personally Identifiable Information): data that can identify a real person, such as name, email, phone or address.
- Severity (P1, P2, and so on): a ranking of how serious a finding is, from most to least serious.
- CVSS: a standard scoring system that turns a set of answers about a vulnerability into a number from 0 to 10.
- Attack complexity: how much skill or luck an attack needs.
- Privileges required: what kind of account an attacker needs.
- Confidentiality, integrity, availability: the three properties of data, meaning only the right people can see it, only the right people can change it, and it is there when needed.
- Harvesting: collecting data automatically in bulk.
- Enumeration: trying values one after another, in order, to find valid ones.
- Phishing: a fake message designed to trick someone into giving away information or clicking something harmful.
- Social engineering: manipulating people, rather than machines, to get access or information.
- Credential stuffing: trying stolen email and password pairs on another site, betting on password reuse.
- GDPR: the European data protection law.
- DPDP Act: India's Digital Personal Data Protection Act.
- Middleware: code that runs on every request before the main handler, acting as a shared checkpoint.
- UUID: a long random-looking identifier that is impractical to guess.
- Defence in depth: adding extra layers of protection rather than relying on one.
- Regression test: an automated check that runs repeatedly so a fixed bug cannot quietly return.
- Rate limiting: capping how many requests one user can make in a period.
- Logs: records a server keeps of what happened.
- Redacted: sensitive values blacked out or replaced before publishing.
- OWASP API Security Top 10 / OWASP Top 10: well-known catalogues of common vulnerability types.
- CWE-639: the catalogue entry for authorization bypass through a user-controlled key.