Skip to content
IDOR Write-up Beginner

Critical IDOR in Order Tracking: Sequential IDs + Zero Authentica

An order-tracking API returned full order details for any sequential numeric order ID without requiring authentication. An attacker could increment the ID to read other customers' personal and company data, including tax IDs, addresses, phone numbers, emails and invoice numbers.

Guilhermegh Follow

Published on medium.com

Idor

Guilhermegh, 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. 4 min read.

Context

The target is an order tracking feature: a public page where a customer follows the progress of a purchase. Behind the page sits a REST API that returns the full order payload for a given order number. The researcher found it while hunting for routes that could be susceptible to IDOR, and the feature turned out to accept the order number as a sequential numeric ID and to return the complete payload without requiring authentication. Because the IDs are predictable, incrementing the number is enough to read the data of any order belonging to any customer, including the buyer's CNPJ/CPF, full address, telephone, e-mail and invoice number. The researcher classifies this as an IDOR (Insecure Direct Object Reference) with critical confidentiality impact and no user interaction required.

Setup

No accounts, roles or special tooling are described. The only precondition was access to the public site and its JavaScript bundle. The requests below were sent without any authentication header, cookie or token.

Finding it

The site did not expose the API in its HTML. The path came from the main JavaScript bundle. Searching the JS for URL patterns revealed an object holding the tracking backend address:

JavaScript
// trecho do bundle (simplificado)
const NZ = {
apiTracking: "https://resume.com/tracking-back/...", // backend de tracking
…
}

From the name of the function called by the front end (getOrderTracking) it was trivial to derive the REST route:

Text
GET /tracking-acompanhamento/v2/api/pedido/tracking/idPedido/2000001

The route takes the order identifier directly in the path.

Exploitation

Step 1: request an order with no authentication at all

The first test was sent with no authentication header of any kind:

HTTP
GET /tracking-acompanhamento/v2/api/pedido/tracking/idPedido/1999996 HTTP/1.1
Host: resume.com

The response was a 200 OK carrying another party's data:

JSON
HTTP/1.1 200 OK
{
“idPedido”: 1999996,
“status”: “…”,
“destinatario”: { “cnpj”: “44.446.904/0001–10”, “razaoSocial”: “…” },
“endereco”: { “logradouro”: “…”, “numero”: “…”, “cidade”: “…”, “uf”: “…” },
“contato”: { “telefone”: “…”, “email”: “…” },
“notaFiscal”: { “numero”: “445395”, “serie”: “…” }
}

The payload contains the recipient's CNPJ and legal name, the full address (street, number, city, state), the contact block (telephone and e-mail) and the invoice number and series. No login, no token and no rate limit were involved.

Step 2: enumerate sequential IDs

The identifier is not a UUID: it is a sequential integer (1999996, 1999997, …). A simple loop is therefore enough to walk the range:

Bash
for id in $(seq 1999996 2000020); do
curl -s “https://resume.com/tracking-acompanhamento/v2/api/pedido/tracking/idPedido/$id"
done

Of 25 consecutive orders, 7 belonged to third parties, each one exposing CNPJ, address, telephone, e-mail and invoice number, including orders from public bodies (municipal governments), which the researcher says aggravates the criticality.

idPedido Data leaked
1999996 CNPJ, address, telephone, e-mail, invoice
1999997 CNPJ, address, telephone, e-mail, invoice
… …
2000020 CNPJ, address, telephone, e-mail, invoice

The whole base holds tens of thousands of orders, so the impact is at full scale.

Root cause

The endpoint performs no authentication: the response is returned to whoever asked, with no login, token or rate limit. On top of that, the identifier is a sequential integer rather than an unguessable value, so the lookup key can be walked. The researcher also notes that there is no rate limit and no blocking: the sequential requests went through without a 403 or 429. Because there is no authentication, access logs cannot distinguish a legitimate user from an attacker, since every request looks the same.

Impact

An unauthenticated attacker can read the full record of any order whose ID they guess or enumerate: CNPJ, complete address, telephone, e-mail and invoice number. Each returned ID belongs to a different customer, so enumeration turns one victim into N victims. The researcher frames this as material for fraud and targeted phishing, and as a LGPD issue, since personal data of data subjects is disclosed without consent. The exposure is not limited to private customers: orders from public bodies are included.

Fix

The researcher recommended the following corrections:

  1. Mandatory authentication on the endpoint (session or token); today there is no control at all.
  2. Per-object authorisation (IDOR): the order should only be returned if it belongs to the authenticated user (WHERE idPedido = X AND cliente = sessao).
  3. Non-enumerable IDs: replace the sequential integer with a UUID or Hashid in the public URL.
  4. Rate limiting on tracking.
  5. Logging and alerting for sequential scanning (N requests to consecutive IDs in a short window).

Variants to test

  • Order, invoice and ticket numbers in API paths. Send a request with a low, round or consecutive identifier and no credentials. A positive result is a 200 with a payload belonging to someone else.
  • Identifiers hidden in JavaScript bundles. Grep the main bundle for URL patterns and backend hostnames, then derive REST routes from front-end function names such as getOrderTracking. A positive result is a reachable endpoint that is not linked from the HTML.
  • Sequential ranges around a known ID. Walk a short range with a loop and count how many responses return third-party data. A positive result is any non-trivial hit rate, especially with no 403 or 429 along the way.
  • Public-sector records. Check whether the exposed orders include government or institutional buyers, which raises the severity of the disclosure.

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

What happened, in plain words

A security researcher was looking for a common type of web bug called an IDOR. The name stands for Insecure Direct Object Reference. In everyday terms: imagine a hotel where every room key is just the room number written on a card, and the front desk never checks who you are. If you are in room 12, you can walk to room 13, hold up a card that says "13", and the door opens. The building trusts the number on the card instead of checking that you actually booked that room. An IDOR is the same idea on a website: the site takes an identifier that you supply (a number, a name, a code) and hands back the thing it points to, without checking that the thing belongs to you.

The researcher found a website with an order tracking feature. Order tracking is the page a customer uses to follow a purchase: you bought something, and you want to know whether it has been packed, shipped or delivered. To show you that page, the site has to look up your order in its database. It does this through an API.

An API (Application Programming Interface) is the behind-the-scenes counter where a website asks its own systems for data. When you load a tracking page, your browser does not usually contain the order details itself. Instead, the page's code sends a request to the API, something like "give me order 1999996", and the API replies with the details in a structured format. You can think of the API as a waiter: the web page is the menu you see, and the waiter goes to the kitchen (the database) and brings back your dish (the data).

The problem the researcher found was twofold:

  1. The API accepted the order number as a sequential numeric ID. Sequential means the numbers simply count up: 1999996, 1999997, 1999998, and so on. They are not random. Anyone who knows one order number can guess the next ones.
  2. The API returned the complete order details without requiring authentication. Authentication is the process of proving who you are, usually by logging in. Here there was no login check at all.

Put together, this meant that anyone could type a number into the API and receive the full record of any order belonging to any customer. That record included the buyer's CNPJ/CPF (Brazilian tax identification numbers for companies and individuals), full address, telephone, e-mail and invoice number.

The researcher classifies this as an IDOR with critical confidentiality impact. Confidentiality means keeping data secret from people who should not see it. There was no user interaction required: the victim did not have to click anything, log in, or do anything at all for their data to be exposed.

Setting the scene

The researcher does not describe using any accounts, special roles or unusual tools. The only things needed were access to the public website and its JavaScript bundle.

A JavaScript bundle is a file (or a few files) that a website sends to your browser containing the code that makes the page interactive. Modern websites often combine many small code files into one large bundle. That bundle has to be downloaded by every visitor, so it is public: anyone can open it, read it, and search through it. It frequently contains the addresses of the APIs the page talks to, because the page needs to know where to send its requests.

The researcher worked with curl. Curl is a command-line tool that sends web requests and prints the responses. If a browser is a car with a steering wheel and pedals, curl is the same engine with the body removed: you tell it exactly where to go and it shows you exactly what came back, with no page rendering in the way. The requests described below were sent without any authentication header, cookie or token.

A cookie is a small piece of data a website stores in your browser after you log in, so that the site can recognise you on your next request. A token is a similar idea: a string of characters that acts like a temporary pass. An authentication header is the part of a web request where a browser normally attaches that pass. Sending a request with none of these is like walking up to a counter with no badge, no ticket and no name: the server has no idea who you are.

Finding the endpoint

The website did not expose the API address in its HTML. HTML is the markup that describes the visible structure of a page: headings, paragraphs, buttons, images. If the API address had been in the HTML, anyone could have found it by right-clicking and choosing "View page source". It was not there.

Instead, the path came from the main JavaScript bundle. The researcher searched the JavaScript for patterns that look like web addresses. This is a normal technique: you open the bundle, search for http, for api, for tracking, and see what turns up. What turned up was an object holding the tracking backend address:

JavaScript
// trecho do bundle (simplificado)
const NZ = {
apiTracking: "https://resume.com/tracking-back/...", // backend de tracking
…
}

Line by line:

  • // trecho do bundle (simplificado) is a comment in Portuguese meaning "excerpt from the bundle (simplified)". Comments are notes for humans; the browser ignores them.
  • const NZ = { starts the definition of a named group of values. const means "constant", a value that is set once. NZ is just the name the developers chose. The curly brace opens the group.
  • apiTracking: "https://resume.com/tracking-back/...", is one entry inside that group. The name apiTracking suggests it holds the address of the tracking API. The value is a URL on the site resume.com, under a path starting with tracking-back. The ... means the excerpt was shortened.
  • … stands for the rest of the entries, which were left out of the excerpt.
  • } closes the group.

So the bundle told the researcher that a tracking backend existed at a particular address. A backend is the part of a system that runs on the server and does the real work: storing orders, checking data, building responses. The front end (what you see in the browser) is only the shop window.

From the name of the function called by the front end, getOrderTracking, it was trivial to derive the REST route:

Text
GET /tracking-acompanhamento/v2/api/pedido/tracking/idPedido/2000001

A function is a named block of code that does a job. getOrderTracking literally reads as "get order tracking", so the researcher could guess what it does and, from there, what address it calls. A REST route is the address pattern an API uses for a particular kind of request. Think of a postal address: the street tells you the department, the house number tells you the specific item. Here the route is built from words that describe the feature (tracking-acompanhamento, Portuguese for tracking follow-up), a version marker (v2), and then the order identifier (idPedido, Portuguese for order ID) followed by a number.

Line by line:

  • GET is the HTTP method, the verb of the request. GET means "give me this thing". Other common verbs are POST (create), PUT (replace) and DELETE (remove).
  • /tracking-acompanhamento/v2/api/pedido/tracking/idPedido/2000001 is the path, the part of the address that identifies what you are asking for. It ends with 2000001, a sample order number.

The route takes the order identifier directly in the path.

Exploitation

Step 1: request an order with no authentication at all

The first test was sent with no authentication header of any kind:

HTTP
GET /tracking-acompanhamento/v2/api/pedido/tracking/idPedido/1999996 HTTP/1.1
Host: resume.com

Line by line:

  • GET /tracking-acompanhamento/v2/api/pedido/tracking/idPedido/1999996 HTTP/1.1 is the request line. GET is the verb, the path asks for order 1999996, and HTTP/1.1 is the version of the protocol being spoken. HTTP is the language browsers and servers use to exchange requests and responses.
  • Host: resume.com is a header. Headers are extra pieces of information attached to a request, like the lines of an envelope around a letter. Host tells the server which site name the request is for, because one server can host many sites.

Notice what is missing: there is no Authorization header, no Cookie header, no token of any kind. The request was sent bare, with no authentication of any kind. Instead, the response was a 200 OK carrying another party's data:

JSON
HTTP/1.1 200 OK
{
“idPedido”: 1999996,
“status”: “…”,
“destinatario”: { “cnpj”: “44.446.904/0001–10”, “razaoSocial”: “…” },
“endereco”: { “logradouro”: “…”, “numero”: “…”, “cidade”: “…”, “uf”: “…” },
“contato”: { “telefone”: “…”, “email”: “…” },
“notaFiscal”: { “numero”: “445395”, “serie”: “…” }
}

Line by line:

  • HTTP/1.1 200 OK is the status line of the response. 200 is the status code for success, and OK is its human-readable label. A status code is a three-digit number that summarises what happened: 200 means it worked, 403 means forbidden, 404 means not found, 429 means too many requests.
  • { opens a JSON object. JSON is a text format for structured data: curly braces hold named values, square brackets hold lists, and each entry is a name, a colon and a value. It is the format APIs commonly use to reply.
  • “idPedido”: 1999996, is the order identifier echoed back. idPedido is Portuguese for order ID.
  • “status”: “…”, is the order status. The actual value was shortened to … in the write-up.
  • “destinatario”: { “cnpj”: “44.446.904/0001–10”, “razaoSocial”: “…” }, is the recipient block. destinatario means recipient. cnpj is the Brazilian company tax number, shown here as a real-looking value. razaoSocial means legal name, shortened to ….
  • “endereco”: { “logradouro”: “…”, “numero”: “…”, “cidade”: “…”, “uf”: “…” }, is the address block. logradouro is street, numero is number, cidade is city, uf is the state abbreviation. All values are shortened.
  • “contato”: { “telefone”: “…”, “email”: “…” }, is the contact block: telephone and e-mail, both shortened.
  • “notaFiscal”: { “numero”: “445395”, “serie”: “…” } is the invoice block. notaFiscal means invoice, numero is the invoice number, serie is the invoice series, shortened.
  • } closes the object.

So the payload contains the recipient's CNPJ and legal name, the full address (street, number, city, state), the contact block (telephone and e-mail) and the invoice number and series. No login, no token and no rate limit were involved. A rate limit is a cap on how many requests a client may make in a period of time. Without one, a client can ask for thousands of records in a row and the server will keep answering.

Step 2: enumerate sequential IDs

The identifier is not a UUID: it is a sequential integer (1999996, 1999997, …). A UUID (Universally Unique Identifier) is a long, random-looking string such as 550e8400-e29b-41d4-a716-446655440000. Because it is effectively random, guessing one is impractical. A sequential integer is the opposite: once you have one, the next is simply plus one. Enumeration means walking through a list of possible values one by one. A simple loop is therefore enough to walk the range:

Bash
for id in $(seq 1999996 2000020); do
curl -s “https://resume.com/tracking-acompanhamento/v2/api/pedido/tracking/idPedido/$id"
done

Line by line:

  • for id in $(seq 1999996 2000020); do starts a shell loop. A shell is the text-based command interface of your computer. for id in ... means "for each value, call it id, in the following list". $(seq 1999996 2000020) runs the seq command, which prints every whole number from 1999996 to 2000020. So id takes each of those 25 values in turn. do marks the start of the work to repeat.
  • curl -s “https://resume.com/tracking-acompanhamento/v2/api/pedido/tracking/idPedido/$id" sends one request per value. curl is the request tool. -s means silent: do not print progress noise. The URL is the same route as before, with $id replaced by the current number. The $ tells the shell to substitute the variable's value.
  • done closes the loop.

Of 25 consecutive orders, 7 belonged to third parties, each one exposing CNPJ, address, telephone, e-mail and invoice number, including orders from public bodies (municipal governments), which the researcher says aggravates the criticality. In other words, roughly one in four guesses returned somebody else's data, and some of those somebody-elses were government offices.

idPedido Data leaked
1999996 CNPJ, address, telephone, e-mail, invoice
1999997 CNPJ, address, telephone, e-mail, invoice
… …
2000020 CNPJ, address, telephone, e-mail, invoice

The table lists the first two and the last identifier in the range, with the same set of leaked fields for each. The whole base holds tens of thousands of orders, so the impact is at full scale.

Root cause

The endpoint performs no authentication and no object-level authorisation. Authorisation is the check that comes after authentication: authentication asks "who are you?", authorisation asks "are you allowed to see this particular thing?". A site can authenticate you perfectly and still fail at authorisation if it lets you read records that belong to someone else. Here the order is looked up purely by the identifier supplied in the path, and the response is returned to whoever asked.

On top of that, the identifier is a sequential integer rather than an unguessable value, so the lookup key can be walked. The researcher also notes that there is no rate limit and no blocking: the sequential requests went through without a 403 or 429. 403 means forbidden, 429 means too many requests. Neither appeared, so nothing slowed the loop down.

Because there is no authentication, access logs cannot distinguish a legitimate user from an attacker, since every request looks the same. Access logs are the records a server keeps of who requested what. If every request arrives with no identity attached, the log line for a real customer and the log line for an attacker are identical.

Impact

An unauthenticated attacker can read the full record of any order whose ID they guess or enumerate: CNPJ, complete address, telephone, e-mail and invoice number. Each returned ID belongs to a different customer, so enumeration turns one victim into N victims. The researcher frames this as material for fraud and targeted phishing, and as a LGPD issue, since personal data of data subjects is disclosed without consent. LGPD is Brazil's general data protection law, the local equivalent of GDPR: it sets rules on how personal data may be collected, used and shared. Phishing is a scam message designed to look genuine so that the recipient hands over information or clicks a malicious link; having a real name, address, telephone and invoice number makes such a message far more convincing. The exposure is not limited to private customers: orders from public bodies are included.

Fix

The researcher recommended the following corrections:

  1. Mandatory authentication on the endpoint (session or token); today there is no control at all. A session is the server-side record of a logged-in user, usually referenced by a cookie. Requiring one means the server knows who is asking before it answers.
  2. Per-object authorisation (IDOR): the order should only be returned if it belongs to the authenticated user (WHERE idPedido = X AND cliente = sessao). The snippet is a database query condition: return the row where the order ID matches the request and the customer matches the logged-in session. If either part fails, return nothing.
  3. Non-enumerable IDs: replace the sequential integer with a UUID or Hashid in the public URL. A Hashid is a reversible encoding of a number that produces a short, scrambled-looking string, so the underlying sequence is no longer visible.
  4. Rate limiting on tracking, so a client cannot walk thousands of IDs in a row.
  5. Logging and alerting for sequential scanning (N requests to consecutive IDs in a short window). Logging means recording what happened; alerting means notifying someone when a pattern looks wrong.

Variants to test

  • Order, invoice and ticket numbers in API paths. Send a request with a low, round or consecutive identifier and no credentials. A positive result is a 200 with a payload belonging to someone else.
  • Identifiers hidden in JavaScript bundles. Grep the main bundle for URL patterns and backend hostnames, then derive REST routes from front-end function names such as getOrderTracking. A positive result is a reachable endpoint that is not linked from the HTML. To grep is to search text for a pattern.
  • Sequential ranges around a known ID. Walk a short range with a loop and count how many responses return third-party data. A positive result is any non-trivial hit rate, especially with no 403 or 429 along the way.
  • Public-sector records. Check whether the exposed orders include government or institutional buyers, which raises the severity of the disclosure.

Glossary

  • API: the behind-the-scenes interface a website uses to ask its own systems for data, and to receive it back in a structured format.
  • Authentication: proving who you are, usually by logging in.
  • Authorisation: the check that you are allowed to access a specific thing, after your identity is known.
  • Backend: the server-side part of a system that stores data and does the real work.
  • Bundle (JavaScript bundle): the file or files of code a website sends to the browser to make the page work; it is public and often contains API addresses.
  • CNPJ/CPF: Brazilian tax identification numbers for companies (CNPJ) and individuals (CPF).
  • Cookie: a small piece of data stored in your browser by a site, often used to recognise you after login.
  • Curl: a command-line tool that sends web requests and prints the responses.
  • Endpoint: a specific address on a server that accepts requests, such as one API route.
  • Enumeration: walking through a list of possible values one by one to find valid ones.
  • Function: a named block of code that performs a job.
  • GET: the HTTP method meaning "give me this thing".
  • Hashid: a reversible encoding of a number into a short scrambled-looking string, hiding the sequence.
  • Header: extra information attached to a request or response, such as Host or Authorization.
  • HTML: the markup that describes the visible structure of a web page.
  • HTTP: the protocol browsers and servers use to exchange requests and responses.
  • IDOR (Insecure Direct Object Reference): a bug where a site returns an object based on an identifier you supply, without checking that the object belongs to you.
  • JSON: a text format for structured data, using curly braces for objects and square brackets for lists.
  • LGPD: Brazil's general data protection law governing personal data.
  • Path: the part of a URL that identifies what you are asking for.
  • Payload: the data carried in a request or response body.
  • Phishing: a scam message made to look genuine so the recipient hands over information or clicks a malicious link.
  • Rate limit: a cap on how many requests a client may make in a period of time.
  • REST route: an address pattern an API uses for a particular kind of request.
  • Session: the server-side record of a logged-in user, usually referenced by a cookie.
  • Shell: the text-based command interface of a computer.
  • Status code: a three-digit number summarising the outcome of a request, such as 200, 403, 404 or 429.
  • Token: a string of characters acting as a temporary pass, sent with requests to prove identity.
  • UUID: a long, effectively random identifier that is impractical to guess.
  • 200 OK: the status code for success.
  • 403: the status code for forbidden.
  • 429: the status code for too many requests.

More by Guilhermegh

View all

1 more disclosed report, 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.