Skip to content
IDOR Write-up Intermediate

Stealing User’s PII info by visiting API endpoint directly

An API endpoint that stored customer PII could be accessed via GET without authentication, and when a victim visited an attacker-supplied session endpoint, their previously submitted PII was copied to that endpoint. An attacker could then read the victim's PII by visiting the same endpoint.

Kunal pandey Follow

Published on web.archive.org

Bounty$500 View original

#### Kunal pandey

Kunal pandey, on web.archive.org

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

This write-up comes from a private program on HackerOne to which the researcher had been invited. The target was a store portal seller area: a payment flow in which staff members can send a "Place order" feature to any customer. To collect the details needed from the customer, staff send an invitation either by email or as a QR code.

Image for post
Image for post From the original on web.archive.org

The customer receives the invitation link and opens a page such as payment-na.examle.com/0811ebf4-d7d0-ba31–9ce68648a5a9, where they fill in the necessary details.

Image for post
Image for post From the original on web.archive.org

So the normal behaviour of the feature is: a seller creates an order, the customer opens a per-session payment page, submits their details, and the details are stored server-side against that session.

Setup

The researcher worked from two perspectives inside the same portal: a seller/staff area used to create the order and generate the payment link, and a second portal area used to act as another user (the attacker). Requests were intercepted and inspected with Burp Suite. The captured request carried a Firefox 78.0 on macOS 10.15 User-Agent. No special accounts beyond the invited program access are described.

Finding it

While completing a payment as a customer, the researcher intercepted the request that saves the form. It is a POST to a session-scoped API endpoint, and the session identifier is part of the path:

HTTP
POST /na/customer/client/v1/session/002420e4-e031-47aa-8d94-6f7c40c248c7 HTTP/1.1Host: payments-na.example.comUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Firefox/78.0Accept: application/json, text/plain, */*Accept-Language: en-US,en;q=0.5Accept-Encoding: gzip, deflateContent-Type: application/json;charset=utf-8X-Cdc-Client: 2.15.45Content-Length: 125Origin: https://payments-na.example.comDNT: 1Connection: closeReferer: https://payments-na.example.com{"browser_prefilled":[],"customer_details":{"country":"US"..............},"skipped_fields":[],"user_submitted":true,"action":"continueAddressUnverified"}

The important parts are the path, which carries the session UUID, and the JSON body, which carries customer_details (the PII being submitted) along with browser_prefilled, skipped_fields, user_submitted and action. The response to this POST is shown in the write-up:

After the form is completed the flow finishes normally.

At this point all the information has been stored against payments-na.example.com/na/customer/client/v1/session/002420e4-e031–47aa-8d94–6f7c40c248c7, the payment is made and the process is done.

The observation that made this look wrong was the behaviour of the endpoint itself: the same session endpoint could also be reached with a GET from the browser.

Exploitation

Step 1: create a fresh session as the attacker

From another user's portal, the attacker uses the same "Place order" feature and obtains a payment link of the same shape, for example payment-na.examle.com/fa5daba4–5d50–8f80–9eb1-ebia3ea6d665.

Image for post
Image for post From the original on web.archive.org

Step 2: capture the POST and keep the session fresh

The attacker fills in the form, intercepts the request in Burp, and takes the POST to payment-na.example.com/na/customer/client/v1/session/xxxx. The generated API endpoint is fetched from that request, and the request is then dropped so that it is never submitted and the session stays fresh. The endpoint obtained this way was:

Text
payment-na.example.com/na/customer/client/v1/session/96afd42f-4281–4529–9b8c-3ba70b0f000b

Step 3: confirm the endpoint is readable with GET

Further testing showed the endpoint can also be used with the GET method directly in the browser. The screenshot of the fetched endpoint is below.

At this stage there is no PII on it and the parameters are blank, which is expected because nothing has been submitted for this session.

Step 4: get the victim to open the attacker's endpoint

The attacker sends this endpoint to other users who have already completed the details for their orders. As soon as the victim clicks the endpoint, all of their PII from their previous submission, which was stored under /na/customer/client/v1/session/002420e4-e031–47aa-8d94–6f7c40c248c7, is copied to the attacker's endpoint /na/customer/client/v1/session/96afd42f-4281–4529–9b8c-3ba70b0f000b.

After the victim clicks the endpoint, the PII copied onto it, seen from the victim's point of view, is shown here:

Image for post
Image for post From the original on web.archive.org

Step 5: read the copied PII as the attacker

From the attacker's point of view, visiting the given API endpoint in incognito mode shows the copied details on the endpoint, including email id, address and other PII belonging to the victim.

Image for post
Image for post From the original on web.archive.org

In this way an attacker could fetch any customer's PII simply by generating a fresh session API endpoint and sending it to the customer.

Root cause

The session endpoint accepted a GET request and had no authorization token header check. Because the attacker's session endpoint was accepted as authenticated for the victim's session endpoint, the server copied the PII stored against the victim's session into the attacker's fresh session. The write-up describes this as the attacker's endpoint being "authenticated correctly for the victim's API endpoint" in the absence of a token check, which allowed the server to copy the PII across. In other words, the server accepted the attacker's session endpoint as authenticated for the victim's session because no token check was made.

Impact

An attacker who can get a victim to open a crafted session endpoint can obtain that victim's PII, including email id and address, by visiting the endpoint in incognito mode. The attack requires the victim to click the link, and it works against customers who have already submitted their details. The report does not state how many users or records were affected.

Fix

The team removed the GET method and added an authorization token header to the POST request so that each request is authenticated by the server. This removed the scenario in which the endpoint could be used for the copying PII attack.

Variants to test

  1. Session-scoped endpoints that answer GET: request a session endpoint with GET in a browser and see whether it returns stored data. A positive result is a JSON body containing customer fields for a session you did not submit.
  2. Cross-session writes: create a fresh session, capture its POST, drop it, then have a second account open that session URL. A positive result is the second account's data appearing under the first session.
  3. Missing token checks on POST: replay a captured POST with the authorization header removed or replaced. A positive result is the server accepting the request and storing data.
  4. Identifier substitution: swap the session UUID in the path for another known UUID while keeping your own cookies. A positive result is data from the other session being returned or overwritten.
  5. Link-based data movement: send a freshly generated, unsubmitted session link to a test account that has already submitted details, then read the fresh session in a private window. A positive result is the test account's PII appearing in the fresh session.

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

What happened, in plain words

A security researcher found a way to steal personal information from customers of an online payment portal. The final read needed only a normal web browser, though the attacker used an intercepting tool to capture the session endpoint. The attacker created an empty payment page, sent its web address to a customer, and when the customer opened it, the customer's saved personal details (email address, home address and similar) were quietly copied onto the attacker's page. The attacker then opened that same address in a private browser window and read the details.

The company paid a $500 bounty and fixed the problem by removing the GET method and adding an authorization token header to the POST request.

This article walks through the whole story from the beginning, explaining every technical word as it appears. You only need to know how to use a browser and a computer to follow it.

The setting: a seller portal and a payment link

The researcher had been invited to a private bug bounty program on HackerOne. HackerOne is a platform where companies publish their software and offer rewards (called bounties) to people who find security problems in it. A private program means only invited researchers can take part.

The target was a store portal seller area. Think of it as the back office of an online shop: staff members log in there to manage orders. One feature in this back office is called "Place order". A staff member uses it to create an order for a customer and to send that customer an invitation to pay. The invitation can go out by email or as a QR code. A QR code is that square barcode-like image you scan with a phone camera; scanning it opens a web link.

Image for post
Image for post From the original on web.archive.org

The picture above shows the seller area where staff send the "Place order" feature to a customer, by email or QR code.

When the customer receives the invitation, they open a link that looks like this:

Text
payment-na.examle.com/0811ebf4-d7d0-ba31–9ce68648a5a9

That long string of letters and numbers at the end is a unique identifier for that one payment session. A session is simply one visit or one interaction with a website, tracked by the server so it can remember who is doing what. The identifier is often called a UUID (universally unique identifier): a long random-looking code that identifies one session. The customer opens the page and fills in the details the seller needs, such as name, address and email.

Image for post
Image for post From the original on web.archive.org

The picture above shows the payment page the customer lands on after clicking the invitation link.

So the normal flow is: a seller creates an order, the customer opens a personal payment page, submits their details, and the server stores those details against that session.

What an API is, and why it matters here

Before going further, it helps to understand what an API is. API stands for Application Programming Interface. In web terms, it is the set of addresses (called endpoints) that a website's own pages use behind the scenes to send and receive data. When you fill in a form on a modern website, your browser usually does not send the whole page back to the server. Instead, a small piece of JavaScript code running in your browser sends a request to an API endpoint with your data, and the server replies with a short answer, often in a format called JSON (JavaScript Object Notation), which is just structured text with curly brackets and colons.

A useful everyday comparison: think of a restaurant. The menu and the dining room are the website you see. The kitchen is the server where data lives. The waiter who carries your order to the kitchen and brings the food back is the API. You never walk into the kitchen yourself; you talk to the waiter. In the same way, your browser talks to API endpoints, not directly to the database.

Each API request has a method, which is a word telling the server what kind of action you want. The two most common are:

  • GET: "give me something". Used to read data. Typing an address in your browser's address bar always sends a GET request.
  • POST: "here is something for you". Used to send data to the server, for example when you submit a form.

Intercepting the request

To see what the browser actually sends, the researcher used a tool called Burp Suite. Burp Suite is a program that sits between your browser and the internet and lets you pause, inspect and modify every request and response. It is widely used by security testers. The captured request carried a Firefox 78.0 on macOS 10.15 User-Agent.

While completing a payment as a customer, the researcher paused the request that saves the form. It is a POST to a session-scoped API endpoint, and the session identifier is part of the web address (the path):

HTTP
POST /na/customer/client/v1/session/002420e4-e031-47aa-8d94-6f7c40c248c7 HTTP/1.1Host: payments-na.example.comUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Firefox/78.0Accept: application/json, text/plain, */*Accept-Language: en-US,en;q=0.5Accept-Encoding: gzip, deflateContent-Type: application/json;charset=utf-8X-Cdc-Client: 2.15.45Content-Length: 125Origin: https://payments-na.example.comDNT: 1Connection: closeReferer: https://payments-na.example.com{"browser_prefilled":[],"customer_details":{"country":"US"..............},"skipped_fields":[],"user_submitted":true,"action":"continueAddressUnverified"}

Let us go through this line by line, in plain words.

  • POST /na/customer/client/v1/session/002420e4-e031-47aa-8d94-6f7c40c248c7 HTTP/1.1 is the first line. POST is the method: the browser is sending data. The path after it is the endpoint, and the long code at the end is the session UUID. HTTP/1.1 is the version of the web protocol being used.
  • Host: payments-na.example.com tells the server which website the request is for. One server can host many websites, so it needs to know which one you want.
  • User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Firefox/78.0 identifies the browser and operating system. Servers use it to tailor responses.
  • Accept: application/json, text/plain, */* says the browser is willing to receive JSON, plain text, or anything else.
  • Accept-Language: en-US,en;q=0.5 says the preferred language is US English.
  • Accept-Encoding: gzip, deflate says the browser can accept compressed responses to save bandwidth.
  • Content-Type: application/json;charset=utf-8 says the body of the request is JSON text encoded in UTF-8 (a standard way of representing characters).
  • X-Cdc-Client: 2.15.45 is a custom header. Headers are extra pieces of information attached to a request, like the labels on a parcel. This one appears to identify a client version.
  • Content-Length: 125 says the body is 125 bytes long.
  • Origin: https://payments-na.example.com tells the server which site the request came from. Browsers add this automatically for cross-origin requests.
  • DNT: 1 is the "Do Not Track" preference.
  • Connection: close asks the server to close the connection after answering.
  • Referer: https://payments-na.example.com says which page the request was made from.
  • The last line is the body: {"browser_prefilled":[],"customer_details":{"country":"US"..............},"skipped_fields":[],"user_submitted":true,"action":"continueAddressUnverified"}. This is JSON. customer_details holds the personal information the customer typed in. browser_prefilled and skipped_fields are lists (empty here). user_submitted is true, meaning the customer submitted the form. action records what happened next.

The important parts are the path, which carries the session UUID, and the JSON body, which carries customer_details, the personal data being submitted.

The server's reply to this POST is shown below:

After the form is completed, the flow finishes normally.

At this point all the information has been stored against payments-na.example.com/na/customer/client/v1/session/002420e4-e031–47aa-8d94–6f7c40c248c7, the payment is made and the process is done.

The observation that made this look wrong was the behaviour of the endpoint itself: the same session endpoint could be reached with a GET from the browser, and the session identifier in the path was the only thing tying stored data to a person. In other words, the server accepted the attacker's session endpoint as authenticated for the victim's session because no token check was made.

Exploitation

Exploitation means turning a weakness into a working attack. Here is how the researcher did it, step by step.

Step 1: create a fresh session as the attacker

From another user's portal, the attacker uses the same "Place order" feature and obtains a payment link of the same shape, for example:

Text
payment-na.examle.com/fa5daba4–5d50–8f80–9eb1-ebia3ea6d665
Image for post
Image for post From the original on web.archive.org

The picture above shows the second portal area, where the attacker creates their own order and gets a payment link.

Why this step? The attacker needs a session of their own, one that is empty and that they control, so that later they can watch what gets written into it.

Step 2: capture the POST and keep the session fresh

The attacker fills in the form, intercepts the request in Burp, and takes the POST to payment-na.example.com/na/customer/client/v1/session/xxxx. The generated API endpoint is fetched from that request, and the request is then dropped so that it is never submitted and the session stays fresh. The endpoint obtained this way was:

Text
payment-na.example.com/na/customer/client/v1/session/96afd42f-4281–4529–9b8c-3ba70b0f000b

Why drop the request? If the attacker submitted the form, the session would be filled with the attacker's own details. By dropping it, the session stays empty and unused, ready to receive someone else's data. "Fresh" here means untouched.

Step 3: confirm the endpoint is readable with GET

Further testing showed the endpoint can also be used with the GET method directly in the browser. The screenshot of the fetched endpoint is below.

At this stage there is no PII on it and the parameters are blank, which is expected because nothing has been submitted for this session. PII stands for Personally Identifiable Information: any data that can identify a specific person, such as a name, email address, home address or phone number.

Why this step? The attacker wants to confirm that simply opening the address in a browser (which sends a GET) returns the session's contents. If it does, the attacker can later read whatever ends up in that session without any special tools.

Step 4: get the victim to open the attacker's endpoint

The attacker sends this endpoint to other users who have already completed the details for their orders. As soon as the victim clicks the endpoint, all of their PII from their previous submission, which was stored under /na/customer/client/v1/session/002420e4-e031–47aa-8d94-6f7c40c248c7, is copied to the attacker's endpoint /na/customer/client/v1/session/96afd42f-4281–4529–9b8c-3ba70b0f000b.

After the victim clicks the endpoint, the PII copied onto it, seen from the victim's point of view, is shown here:

Image for post
Image for post From the original on web.archive.org

Why this works: the server accepted the attacker's session endpoint as authenticated for the victim's session, so the victim's stored details were copied into the requested session. It never checks whether the person making the request actually owns the session they are asking about.

A cookie, by the way, is a small piece of data a website stores in your browser so it can recognise you on your next request. It is like a cloakroom ticket: you hand it in and get your coat back. A token is similar but usually travels in a header rather than a cookie, and is used to prove who you are.

Step 5: read the copied PII as the attacker

From the attacker's point of view, visiting the given API endpoint in incognito mode shows the copied details on the endpoint, including email id, address and other PII belonging to the victim.

Image for post
Image for post From the original on web.archive.org

Incognito mode (also called private browsing) is a browser mode that does not keep your normal cookies and history. The attacker uses it to make sure they are not logged in as themselves, so what they see is exactly what any stranger opening the link would see.

In this way an attacker could fetch any customer's PII simply by generating a fresh session API endpoint and sending it to the customer.

Root cause

Root cause means the underlying reason the problem existed. The session endpoint accepted a GET request and had no authorization token header check. Authorization is the process of checking whether a person is allowed to do what they are trying to do. A token is a short string that proves identity, like a wristband at an event: if you have the right one, you get in.

Because the attacker's session endpoint was accepted as authenticated for the victim's session endpoint, the server copied the PII stored against the victim's session into the attacker's fresh session. The write-up describes this as the attacker's endpoint being "authenticated correctly for the victim's API endpoint" in the absence of a token check, which allowed the server to copy the PII across.

A useful comparison: imagine a hotel where your room number is the only thing the front desk asks for. If you say "room 204", they hand you the key to room 204, no questions asked. Anyone who learns a room number can get in. That is essentially what happened here: the session UUID was the room number, and the server handed over the contents.

Impact

Impact means the harm that could come from the bug. An attacker who can get a victim to open a crafted session endpoint can obtain that victim's PII, including email id and address, by visiting the endpoint in incognito mode. The attack requires the victim to click the link, and it works against customers who have already submitted their details. The report does not state how many users or records were affected.

Fix

The team removed the GET method and added an authorization token header to the POST request so that each request is authenticated by the server. This removed the scenario in which the endpoint could be used for the copying PII attack.

In plain terms: the door that anyone could open with a browser was closed, and a guard (the token check) was placed at the remaining door.

Variants to test

If you are learning to test websites, these are the kinds of checks the researcher's finding suggests. Each one is a small experiment you can run with a browser and an intercepting tool.

  1. Session-scoped endpoints that answer GET: request a session endpoint with GET in a browser and see whether it returns stored data. A positive result is a JSON body containing customer fields for a session you did not submit.
  2. Cross-session writes: create a fresh session, capture its POST, drop it, then have a second account open that session URL. A positive result is the second account's data appearing under the first session.
  3. Missing token checks on POST: replay a captured POST with the authorization header removed or replaced. A positive result is the server accepting the request and storing data.
  4. Identifier substitution: swap the session UUID in the path for another known UUID while keeping your own cookies. A positive result is data from the other session being returned or overwritten.
  5. Link-based data movement: send a freshly generated, unsubmitted session link to a test account that has already submitted details, then read the fresh session in a private window. A positive result is the test account's PII appearing in the fresh session.

Timeline

  • Jul 22nd: Reported it to the team.
  • Jul 23rd: Report was triaged by the team and severity was set as a medium.
  • Jul 23rd: $500 got rewarded.
  • Jul 27th: Report resolved.

Triaged means the team looked at the report, confirmed it was a real issue, and assigned a severity level. Medium is a middle rating on a scale that usually runs from low to critical.

Glossary

  • API (Application Programming Interface): the set of web addresses a website's pages use behind the scenes to send and receive data.
  • API endpoint: one specific address in an API, for example /na/customer/client/v1/session/....
  • Authorization: the process of checking whether a person is allowed to do what they are trying to do.
  • Bounty: a reward, usually money, paid to someone who finds and reports a security problem.
  • Burp Suite: a tool that sits between your browser and the internet so you can pause, inspect and change requests and responses.
  • Cookie: a small piece of data a website stores in your browser so it can recognise you on later requests.
  • Cross-session write: when data from one session ends up stored in a different session.
  • Endpoint: see API endpoint.
  • Exploitation: turning a weakness into a working attack.
  • GET: an HTTP method meaning "give me something"; used to read data. Typing an address in a browser sends a GET.
  • HackerOne: a platform where companies publish software and offer rewards to people who find security problems in it.
  • Header: extra information attached to a request or response, like the labels on a parcel.
  • HTTP: the protocol browsers and servers use to talk to each other.
  • Impact: the harm that could come from a bug.
  • Incognito mode: a browser mode that does not keep your normal cookies and history.
  • JSON (JavaScript Object Notation): a structured text format for data, using curly brackets, colons and commas.
  • Method: the word at the start of an HTTP request (GET, POST, etc.) that says what kind of action is wanted.
  • PII (Personally Identifiable Information): any data that can identify a specific person, such as name, email address or home address.
  • POST: an HTTP method meaning "here is something for you"; used to send data to the server.
  • Private program: a bug bounty program that only invited researchers can take part in.
  • QR code: a square barcode-like image that a phone camera can scan to open a web link.
  • Root cause: the underlying reason a problem exists.
  • Session: one visit or interaction with a website, tracked by the server so it can remember who is doing what.
  • Session identifier (UUID): a long random-looking code that uniquely identifies one session.
  • Token: a short string that proves identity, usually sent in a header.
  • Triaged: when a security team has looked at a report, confirmed it is real, and assigned a severity.
  • UUID (universally unique identifier): a very long random-looking code that is practically impossible to guess.
  • Vulnerability class: a category of security weakness, such as missing authorization checks.

More by Kunal pandey

View all

4 more disclosed reports, best first.

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.