Skip to content
IDOR Write-up Beginner

$1,000+ P1: PII Disclosure W/ IDOR

The friend-request page used a sequential numeric identifier that was only encoded (URL then Base64), so changing the number returned another user's page. The page's client-side code then exposed that user's full name, email address, phone number and date of birth.

Graham Zemel Follow

Published on medium.com

The Gray Area

Graham Zemel, 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 is a web application with a friend-request feature. When a user opens a friend request, the URL carries an id parameter that identifies the request. In the example the researcher shows, the parameter value is not a plain number but an encoded string, and the application decodes it server-side to look up the record.

The bug is an IDOR (Insecure Direct Object Reference), a class of access-control flaw. As the researcher explains, IDOR affects permissions, such as whether a user has admin capabilities. It usually appears as horizontal privilege escalation (reaching another user with the same permissions) and occasionally as vertical privilege escalation (reaching a user with higher permissions). Here the object being referenced is a friend request, and the disclosure that follows is of personal data.

Setup

No accounts, roles, tools or versions are described. The researcher works from a browser against the live site and uses two public online tools for the encoding steps: a URL decoder/encoder and a Base64 decoder/encoder. The report does not describe any precondition beyond having a friend-request URL with an id value.

Finding it

The URL presented itself like this:

Text
https://website.com/friend-request/?id=MjQzNDU%3D

Most of the URL looks ordinary and secure; the interesting part is the id parameter, which looks like a URL-encoded string. The % is the clue: it signals that some character outside 0-9, a-z and A-Z was present and has been encoded in a special format. The researcher notes that knowledge of ciphers and encodings, largely picked up from CTFs, is what makes the next step possible.

Exploitation

Step 1: Decode the parameter

Decoding the MjQzNDU%3D value gives MjQzNDU=. The trailing = is the notation that suggests Base64, so the next decode is Base64, which yields a number:

  • MjQzNDU%3D URL decoded gives MjQzNDU=
  • MjQzNDU= Base64 decoded gives 24345

So the application associates the id parameter with a number, passes it through a couple of encodings, and when the browser identifies the id parameter it has been told how to decode the value into 24345.

Step 2: Re-encode a neighbouring number

To reverse the process, encode a different number. The researcher picks 24344, because if 24345 exists it is likely that a number came before it in a sequential sequence, making it the most likely to return a valid response.

  • 24344 Base64 encoded gives MjQzNDQ=
  • MjQzNDQ= URL encoded gives MjQzNDQ%3D

The result looks similar to the original, but the U before the %3D (the encoded =) has changed to a Q.

Step 3: Request the neighbouring object

Paste the new value into the URL:

Text
https://website.com/friend-request/?id=MjQzNDQ%3D

If the response differs from the one returned for MjQzNDU%3D, that is the IDOR. At this level it is low impact: it shows only a name and a little information in the HTML.

Step 4: Look past the rendered page

The researcher's advice at this point is to keep looking for other vectors even after finding a decent bug, in order to get a bigger payout. Opening the source of the web page shows that the HTML does not display everything: the user data imported into the site's code is all there in client-side documents. First and last name, email address, phone number and date of birth are all visible. That is significant material, at least in terms of OSINT-type information.

The researcher also published a small parser, idorAutomation, on GitHub, described as a simple 20-line program that works on this site and would need revisions for anyone else using it.

Root cause

The application takes a client-supplied identifier that decodes to a number and uses it to look up a friend request. The report does not describe any ownership check. Because the identifier is sequential, changing it by one reaches the neighbouring record. Encoding the value is not an access control: it only obscures the number, and the scheme is trivially reversible.

Impact

Changing the identifier by one returned a different response, showing another user's record. The rendered page leaks a name and a little information; the client-side documents additionally expose first and last name, email address, phone number and date of birth. The researcher frames this as PII disclosure that could possibly be used to further exploit the application, and rates it as a simple, everyday IDOR.

Fix

The fix implied by the finding is a server-side authorisation check: before returning a friend request, verify that the authenticated user is a party to it, and do not rely on encoding or obscuring the identifier. Using non-sequential, unguessable identifiers would make enumeration harder but would not replace the ownership check.

Variants to test

  1. Sequential numeric IDs behind encoding. Take any parameter that decodes to a number (Base64, hex, URL encoding, or a mix) and step the number by one. A positive result is a response containing another user's data instead of an error or your own record.
  2. Double-encoded values. Apply the same decode chain the application uses, change the number, and re-encode in the same order. A positive result is the same as above, showing the server decodes consistently and still does not check ownership.
  3. Other object references in the same app. Friend requests, messages, invoices, profile pages and export endpoints often share the same lookup pattern. A positive result is any endpoint where changing the identifier returns a different user's object.
  4. Client-side data beyond the rendered page. View the source and the network responses for fields not shown on screen, such as email, phone and date of birth. A positive result is PII present in the response for an object you do not own.
  5. Vertical escalation. Try identifiers that may belong to administrative users or records. A positive result is access to data or actions above your role, which the researcher notes IDOR can occasionally produce.

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 bug on a website that lets people send each other friend requests. When you open one of those friend requests, the address bar of your browser contains a link with a number hidden inside it, disguised by two layers of encoding. By decoding that number, changing it by one, and encoding it again, the researcher could open somebody else's friend request. The page itself showed only a name and a little information, but the hidden code behind the page contained much more: first and last name, email address, phone number and date of birth. That kind of personal information is called PII, short for personally identifiable information. The bug class is called IDOR, short for Insecure Direct Object Reference, and it belongs to a family of access-control problems: the website lets you reach a record that does not belong to you because it never checks who you are before handing it over.

This article walks through the same steps the researcher took, in the same order, explaining every idea from scratch. You only need a browser and a computer to follow along.

The target and the feature

The target is a web application with a friend-request feature. A friend request is simply a record in the site's database: one user asks another to become friends, and the site stores that request so it can be shown, accepted or declined later. When a user opens a friend request, the URL carries an id parameter that identifies which request is being shown.

A URL is the address you type into a browser, and everything after a question mark is called the query string. The query string is made of pairs: a name, an equals sign, and a value. In ?id=24345, the name is id and the value is 24345. The server reads that value to decide which record to fetch. Think of it like a cloakroom ticket: you hand over the ticket number and the attendant fetches the coat with that number. If the attendant never checks that the coat is yours, anyone holding any ticket number can walk off with any coat.

In the example the researcher shows, the id value is not a plain number but an encoded string, and the application decodes it on its side to look up the record.

What kind of bug this is

IDOR, or Insecure Direct Object Reference, is a type of access-control bug. Access control is the part of a website that decides who is allowed to see or do what, the same way a building has different keys for the front door, the office and the server room. An IDOR means the site refers to an object (a record, a file, an order, a message) by an identifier the user can see and change, and does not verify that this particular user is allowed to access that particular object.

As the researcher explains, IDOR affects permissions, such as whether a user has admin capabilities. It usually appears as horizontal privilege escalation, which means reaching another user's data while having the same level of permission as that user: you are not an administrator, you are just a different ordinary person. Occasionally it appears as vertical privilege escalation, which means reaching a user or a function with higher permissions than yours, for example an admin account.

Here the object being referenced is a friend request, and the disclosure that follows is of personal data.

Setup

No accounts, roles, tools or versions are described in the report. The researcher works from a browser against the live site and uses two public online tools for the encoding steps: a URL decoder and encoder, and a Base64 decoder and encoder. The report does not describe any precondition beyond having a friend-request URL with an id value.

Finding it

The URL presented itself like this:

Text
https://website.com/friend-request/?id=MjQzNDU%3D

Line by line, in plain words:

  • https:// is the scheme, telling the browser to use a secure, encrypted connection.
  • website.com is the domain, the name of the site. The report uses this placeholder rather than the real name.
  • /friend-request/ is the path, the page on the site that shows a friend request.
  • ?id=MjQzNDU%3D is the query string: the parameter named id carries the value MjQzNDU%3D.

Most of the URL looks ordinary and secure; the interesting part is the id parameter, which looks like a URL-encoded string. URL encoding is a way of writing characters that are not allowed, or not safe, inside a URL. Each such character is replaced by a percent sign followed by two characters, which is why it is also called percent-encoding. A space, for example, becomes %20.

The % is the clue: it signals that some character outside 0-9, a-z and A-Z was present and has been encoded in a special format. The researcher notes that knowledge of ciphers and encodings, largely picked up from CTFs, is what makes the next step possible. A CTF, or capture the flag, is a practice competition where people solve small security puzzles; it is a common way to learn this kind of pattern recognition.

Exploitation

Step 1: Decode the parameter

Decoding the MjQzNDU%3D value gives MjQzNDU=. The trailing = is the notation that suggests Base64, so the next decode is Base64, which yields a number:

  • MjQzNDU%3D URL decoded gives MjQzNDU=
  • MjQzNDU= Base64 decoded gives 24345

Base64 is an encoding that represents data using 64 ordinary characters (the letters, digits and a couple of symbols), so that binary or special characters can travel safely through systems that only expect text. It is not encryption: anyone can reverse it, and the = at the end is padding, added so the length comes out right. Seeing that padding is a strong hint that you are looking at Base64.

So the application associates the id parameter with a number, passes it through a couple of encodings, and when the browser identifies the id parameter it has been told how to decode the value into 24345. In other words, the number 24345 was turned into text with Base64, then that text was made URL-safe with percent-encoding, and the server reverses both steps before using the number.

Why do this at all? Encoding here only obscures the number. It does not protect it, because the scheme is trivially reversible by anyone who recognises it.

Step 2: Re-encode a neighbouring number

To reverse the process, encode a different number. The researcher picks 24344, because if 24345 exists it is likely that a number came before it in a sequential sequence, making it the most likely to return a valid response. Sequential means the numbers follow one another in order, like 1, 2, 3, so if one record is 24345, the record just before it is very likely 24344.

  • 24344 Base64 encoded gives MjQzNDQ=
  • MjQzNDQ= URL encoded gives MjQzNDQ%3D

The result looks similar to the original, but the U before the %3D (the encoded =) has changed to a Q. That single character difference is what carries the change from one number to the next.

Step 3: Request the neighbouring object

Paste the new value into the URL:

Text
https://website.com/friend-request/?id=MjQzNDQ%3D

This is the same page and the same parameter as before; only the encoded value differs, and it now decodes to 24344 instead of 24345. The step is taken to see whether the server will happily fetch the neighbouring record.

If the response differs from the one returned for MjQzNDU%3D, that is the IDOR. At this level it is low impact: it shows only a name and a little information in the HTML. HTML is the language web pages are written in, and what you see rendered in the browser is only part of what the server sent.

Step 4: Look past the rendered page

The researcher's advice at this point is to keep looking for other vectors even after finding a decent bug, in order to get a bigger payout. A vector, in this context, is another way in or another angle on the same weakness.

Opening the source of the web page shows that the HTML does not display everything: the user data imported into the site's code is all there in client-side documents. Client-side means it is sent to your browser and processed there, as opposed to server-side, which stays on the machine running the site. Anything sent to the browser can be read by the person using the browser, whether or not the page chooses to display it.

First and last name, email address, phone number and date of birth are all visible. That is significant material, at least in terms of OSINT-type information. OSINT stands for open-source intelligence: information gathered from publicly or easily available sources, which can be combined to build a profile of a person.

The researcher also published a small parser, idorAutomation, on GitHub, described as a simple 20-line program that works on this site and would need revisions for anyone else using it. A parser in this sense is a small script that reads a response and pulls out the fields of interest, so that checking many identifiers by hand is not necessary.

Root cause

The application takes a client-supplied identifier that decodes to a number and uses it to look up a friend request. The report does not describe any ownership check. Client-supplied means the value comes from the browser and can therefore be set to anything by whoever is using that browser.

Because the identifier is sequential, changing it by one reaches the neighbouring record. Encoding the value is not an access control: it only obscures the number, and the scheme is trivially reversible. Authorisation is the decision about whether a given user may perform a given action on a given object; authentication, by contrast, is only about proving who the user is.

Impact

Changing the identifier by one returned a different response, showing another user's record. To enumerate means to walk through a series of values one after another, collecting whatever each one returns. The rendered page leaks a name and a little information; the client-side documents additionally expose first and last name, email address, phone number and date of birth. The researcher frames this as PII disclosure that could possibly be used to further exploit the application, and rates it as a simple, everyday IDOR.

Fix

The fix implied by the finding is a server-side authorisation check: before returning a friend request, verify that the authenticated user is a party to it, and do not rely on encoding or obscuring the identifier. Using non-sequential, unguessable identifiers would make enumeration harder but would not replace the ownership check. An unguessable identifier is one that cannot be predicted, such as a long random string, so that stepping to the next value is not possible.

Variants to test

  1. Sequential numeric IDs behind encoding. Take any parameter that decodes to a number (Base64, hex, URL encoding, or a mix) and step the number by one. A positive result is a response containing another user's data instead of an error or your own record.
  2. Double-encoded values. Apply the same decode chain the application uses, change the number, and re-encode in the same order. A positive result is the same as above, showing the server decodes consistently and still does not check ownership.
  3. Other object references in the same app. Friend requests, messages, invoices, profile pages and export endpoints often share the same lookup pattern. A positive result is any endpoint where changing the identifier returns a different user's object. An endpoint is a specific address on a server that performs a specific job, such as returning a list of messages.
  4. Client-side data beyond the rendered page. View the source and the network responses for fields not shown on screen, such as email, phone and date of birth. A positive result is PII present in the response for an object you do not own. Network responses are the raw replies the server sends, which you can inspect in your browser's developer tools.
  5. Vertical escalation. Try identifiers that may belong to administrative users or records. A positive result is access to data or actions above your role, which the researcher notes IDOR can occasionally produce.

Glossary

  • Access control: the part of a system that decides who may see or do what.
  • Authentication: proving who you are, for example by logging in.
  • Authorisation: deciding whether an identified user is allowed to perform a specific action on a specific object.
  • Base64: an encoding that turns data into ordinary text characters so it can travel safely; easily reversed, not encryption.
  • Client-side: happening in or sent to the user's browser, as opposed to on the server.
  • CTF (capture the flag): a practice security competition made of small puzzles.
  • Endpoint: a specific address on a server that performs a specific job.
  • Enumerate: to walk through a series of values one after another, collecting the results.
  • Horizontal privilege escalation: reaching another user's data at the same permission level as your own.
  • HTML: the language web pages are written in.
  • IDOR (Insecure Direct Object Reference): an access-control bug where a user can reach an object that does not belong to them by changing an identifier.
  • OSINT (open-source intelligence): information gathered from publicly or easily available sources and combined to build a profile.
  • Parameter: a named value in a URL's query string, such as id.
  • Parser: a small program that reads a response and extracts the fields of interest.
  • Percent-encoding (URL encoding): writing characters that are not safe in a URL as a percent sign followed by two characters.
  • PII (personally identifiable information): data that identifies a specific person, such as name, email, phone or date of birth.
  • Query string: the part of a URL after the question mark, made of name and value pairs.
  • Sequential identifier: an identifier that follows a predictable order, such as 24344, 24345, 24346.
  • Server-side: happening on the machine that runs the website, not in the user's browser.
  • Unguessable identifier: an identifier that cannot be predicted, such as a long random string.
  • Vector: another way in, or another angle on the same weakness.
  • Vertical privilege escalation: reaching data or actions at a higher permission level than your own.

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.