Accidental IDOR in eLearnSecurity to Knowing Your Address and Cert You Bought.
An IDOR vulnerability in the eLearnSecurity checkout order-received page allowed changing the order ID to download other users' invoices, which included their billing addresses. The attacker could access personal information of other customers.
Published on p1boom.com
{{media:0}}
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 the eLearnSecurity website, a certification vendor that is part of INE. The feature involved is the checkout flow: after an order is placed, an order-received page offers the invoice as a PDF download. The URL carries the order identifier twice, once as a path segment and once as a pdfid query parameter, together with an order key.

The report opens with a short definition of the class of bug: insecure direct object references arise when an application uses user-supplied input to access objects directly. The author notes that IDORs are most often associated with horizontal privilege escalation but can also appear in vertical privilege escalation, and that they are widespread and easy to spot.
Setup
The researcher was helping a friend who wanted to buy an eLearnSecurity certification but did not have a credit card with international transactions enabled. The purchase was made on the friend's behalf. The only tool mentioned is Burp, used to look back at the request history. No versions, accounts beyond the buyer's, or special preconditions are described.
Finding it
The researcher selected the eJPT certification on elearnsecurity.com and went through checkout. After the transaction the page went blank, which left him unsure whether the purchase had gone through.

Going back to the URL in Burp history and tweaking it a little produced the order-received URL:
https://elearnsecurity.com/checkout/order-received/20080/?key=wc_order_XmcAZFYb6llmi&pdfid=20080
Visiting that URL downloaded the invoice. With the primary job done, he turned to the URL itself. The structure is worth reading carefully: the order number 20080 appears as a path segment, the key parameter carries a WooCommerce order key, and pdfid repeats the same number 20080.
Exploitation
Step 1: change the PDF identifier
The first instinct was to change the PDF ID. The researcher changed it and nothing happened: the invoice was not served for the altered value.

Step 2: change the order identifier in the path
He then noticed a second numerical value in the URL that could be changed, the order number in the path. Changing it to the next value gave:
https://elearnsecurity.com/checkout/order-received/20081/?key=wc_order_XmcAZFYb6llmi&pdfid=20081
This returned the invoice of another person, and that invoice also showed the other customer's billing address. The order key was left untouched; only the two numeric identifiers were incremented.

Step 3: confirm with more identifiers
He tested a couple more IDs, and the general form of the URL is:
https://elearnsecurity.com/checkout/order-received/<ID>/?key=wc_order_XmcAZFYb6llmi&pdfid=<ID>
Step 4: report
He decided to report the issue to INE as the parent company of eLearnSecurity. At that point INE had no responsible disclosure policy. After getting in touch with their team over Twitter, they created a responsible disclosure page and he submitted the issue there.
Root cause
The invoice download appears to be keyed on an order identifier taken from the URL, with no ownership check visible. The order key in the query string was left unchanged while a different order's invoice was returned. Changing the pdfid value alone did nothing, while changing the path segment returned another order's invoice.
Impact
An attacker with a completed order and its order-received URL can change the identifier to a neighbouring value and retrieve another customer's invoice. Each invoice discloses the billing address of the person it belongs to, as the researcher observed on the invoice he retrieved. The report does not describe any other personal or payment data on the invoice, and does not state how many orders were exposed or whether the identifiers were sequential beyond the adjacent values he tried.
Fix
The report does not say what change was made. The fix that addresses the root cause is to authorise the invoice request against the authenticated customer, or to require an unguessable per-order token that is actually validated, rather than trusting the order identifier in the path.
Variants to test
- Increment and decrement the numeric path segment of any order, invoice or receipt URL while keeping every other parameter unchanged. A positive result is a document belonging to another account.
- Change only the secondary identifier (here
pdfid) and leave the primary one alone, then do the reverse. A positive result is that one of the two values controls the lookup and the other is ignored, which tells you which parameter to attack. - Reuse your own order key with someone else's order number. A positive result is that the key is not bound to the order and provides no protection.
- Try non-adjacent and much larger identifiers to see whether the space is enumerable and how far it extends. A positive result is that arbitrary orders can be fetched, not just neighbours.
- Look for the same pattern in other document endpoints: invoices, receipts, tickets, shipping labels and statements. A positive result is any of them returning another user's document when only the identifier changes.
What happened, in plain words
A security researcher was helping a friend buy a certification exam from eLearnSecurity, a company that sells cybersecurity training and exams and is part of INE. The friend did not have a credit card with international transactions enabled, so the researcher paid for the exam on his behalf. After paying, the website showed a blank page, which made the researcher worry that the purchase had failed. He went back through the list of web requests his browser had made, found the address of the page that had been trying to load, and opened it again. That page offered the invoice for the order as a PDF file.
Once the invoice was downloaded, the researcher looked more closely at the web address of that page. It contained the order number twice. He changed one of the two numbers and nothing happened. He changed the other one and the website handed him the invoice of a completely different customer, including that person's billing address. He tested a couple more IDs. He reported the problem to INE, the parent company of eLearnSecurity. At the time INE had no page explaining how to report security problems, so after he contacted the team on Twitter they created one, and he submitted the report there.
This kind of bug is called an IDOR, short for Insecure Direct Object Reference. The rest of this article explains what that means, how the researcher found it, and why it worked, in the same order as the original write-up.

The idea behind the bug
The report starts with a short definition. An insecure direct object reference happens when a website takes a value that the user can supply, such as a number in the address bar, and uses it directly to fetch something stored on the server, without checking whether that user is allowed to see it.
A simple comparison: imagine a hotel where the receptionist hands you a key labelled with your room number, and the doors have no locks beyond the number on the key. If you swap your key for one labelled 204, you can walk into room 204. The hotel trusted the number on the key instead of checking that the key belonged to you. A website that trusts a number in the URL in the same way has the same problem.
The report notes that IDORs are most often associated with horizontal privilege escalation, which means moving sideways from your own account to another account of the same kind, for example from your invoice to another customer's invoice. They can also appear in vertical privilege escalation, which means moving upwards to a more powerful account, for example from a normal user to an administrator. The report adds that these bugs are widespread and easy to spot.
TLDR

The image above is the short summary the author put near the top of the post, before the detailed story.
Setting up
The researcher was helping a friend who wanted to buy an eLearnSecurity certification but did not have a credit card with international transactions enabled. The purchase was made on the friend's behalf, so the researcher was using an ordinary customer account and an ordinary checkout flow, exactly as any buyer would. The only tool mentioned in the report is Burp, which is a program that sits between your browser and the website and records every request and response, so you can look back at them later. No software versions, no extra accounts beyond the buyer's, and no special preconditions are described.
Finding it
The researcher went to elearnsecurity.com, selected the eJPT certification, and went through checkout. The report notes in passing that eJPT is a good certification and recommends it to beginners who want to get into a penetration testing role. After the transaction, the page went blank, which left him unsure whether the purchase had gone through.

The image above is a short clip used to show how he felt when the page went blank.
He went back to the URL in his Burp history and tweaked it a little, which produced this address:
https://elearnsecurity.com/checkout/order-received/20080/?key=wc_order_XmcAZFYb6llmi&pdfid=20080
Line by line, in plain words:
https://elearnsecurity.comis the website being visited./checkout/order-received/20080/is the path on the website. The20080in the middle is the order number, written directly into the address.?marks the start of the query string, the part of the address that carries extra named values.key=wc_order_XmcAZFYb6llmiis a parameter calledkey. Its value looks like an order key, a long random-looking string that a shop platform such as WooCommerce attaches to an order. The idea of such a key is that only someone who was given it, normally the buyer, can use it.&separates one parameter from the next.pdfid=20080is a second parameter calledpdfid, and its value is the same order number again.
Visiting that address downloaded the invoice. With the main job done, he turned his attention to the address itself. The structure is worth reading carefully: the order number 20080 appears as part of the path, the key parameter carries an order key, and pdfid repeats the same number 20080.
Trying to break it
Step 1: change the PDF identifier
The first instinct was to change the PDF ID. The researcher changed it and nothing happened: the invoice was not served for the altered value.

The image above is another short clip, used to show the reaction when the first attempt did nothing.
Step 2: change the order identifier in the path
He then noticed a second numerical value in the address that could be changed, the order number in the path. Changing it to the next value gave:
https://elearnsecurity.com/checkout/order-received/20081/?key=wc_order_XmcAZFYb6llmi&pdfid=20081
Line by line, in plain words:
- The path now ends in
20081instead of20080, so the order number has gone up by one. - The
keyparameter is unchanged: it is stillwc_order_XmcAZFYb6llmi, the key from his own order. - The
pdfidparameter is also now20081, matching the new number in the path.
This returned the invoice of another person, and that invoice also showed the other customer's billing address. The order key was left untouched; only the two numeric identifiers were incremented.

The image above shows the invoice that came back, with the other person's billing address on it.
Step 3: confirm with more identifiers
He tested a couple more IDs, and the general form of the address is:
https://elearnsecurity.com/checkout/order-received/<ID>/?key=wc_order_XmcAZFYb6llmi&pdfid=<ID>
Line by line, in plain words:
<ID>is a placeholder, not a literal value. It stands for any order number you put in its place.- The same number appears in the path and in
pdfid, so both places are filled with the same value. - The
keystays as it was, which is the point: the key from one order was being used with the number of another.
Step 4: report
He decided to report the issue to INE as the parent company of eLearnSecurity. At that point INE had no responsible disclosure policy. A responsible disclosure policy is a public page that tells security researchers how to report a problem safely, where to send it, and what the company promises to do about it. After getting in touch with their team over Twitter, they created a responsible disclosure page and he submitted the issue there.
Why it worked
The invoice download appears to be keyed on an order identifier taken from the address, with no ownership check visible. A session is the short-lived state a website keeps for you while you are logged in, usually tracked with a cookie, which is a small piece of data your browser stores and sends back with each request. The server should have compared the order being asked for with the account in that session, and it did not.
The order key in the query string was left unchanged while a different order's invoice was returned. Changing the pdfid value alone did nothing, while changing the path segment returned another order's invoice.
What an attacker could do
An attacker with a completed order and its order-received address can change the identifier to a neighbouring value and retrieve another customer's invoice. Enumerating means trying one number after another, the way you might try every house number on a street. Each invoice discloses the billing address of the person it belongs to, as the researcher observed on the invoice he retrieved. The report does not describe any other personal or payment data on the invoice, and does not state how many orders were exposed or whether the identifiers were sequential beyond the adjacent values he tried.
How to fix it
The report does not say what change was made. The fix that addresses the root cause is to authorise the invoice request against the authenticated customer, or to require an unguessable per-order token that is actually validated, rather than trusting the order identifier in the path. In plain words: before handing over the invoice, the server should check that the logged-in customer is the one who placed that order, or it should require a long random value that only that customer was given and that the server actually checks.
Other places to look
- Increment and decrement the numeric path segment of any order, invoice or receipt address while keeping every other parameter unchanged. A positive result is a document belonging to another account.
- Change only the secondary identifier (here
pdfid) and leave the primary one alone, then do the reverse. A positive result is that one of the two values controls the lookup and the other is ignored, which tells you which parameter to attack. - Reuse your own order key with someone else's order number. A positive result is that the key is not bound to the order and provides no protection.
- Try non-adjacent and much larger identifiers to see whether the space is enumerable and how far it extends. A positive result is that arbitrary orders can be fetched, not just neighbours.
- Look for the same pattern in other document endpoints: invoices, receipts, tickets, shipping labels and statements. A positive result is any of them returning another user's document when only the identifier changes.
Glossary
- IDOR (Insecure Direct Object Reference): a bug where a website uses a value the user can supply, such as a number in the address, to fetch stored data without checking that the user is allowed to see it.
- Horizontal privilege escalation: moving sideways from your own account to another account of the same kind, for example from your invoice to another customer's invoice.
- Vertical privilege escalation: moving upwards to a more powerful account, for example from a normal user to an administrator.
- eLearnSecurity: a certification vendor that is part of INE.
- INE: the parent company of eLearnSecurity, to which the issue was reported.
- eJPT: the eLearnSecurity certification the researcher selected during checkout.
- Checkout flow: the sequence of pages a shop shows while you place an order and pay.
- Order-received page: the page shown after an order is placed, which in this case offered the invoice as a PDF download.
- Invoice: the document listing what was bought and, in this case, the billing address of the buyer.
- PDF: a file format for documents that look the same wherever they are opened.
- URL: the address of a page or file on the web, made up of a scheme, a host, a path and an optional query string.
- Path: the part of a URL after the host, such as
/checkout/order-received/20080/. - Query string: the part of a URL after the
?, carrying named values separated by&. - Parameter: one named value in a query string, such as
keyorpdfid. - Order key: a long random-looking value attached to an order, intended to be known only to the buyer.
- WooCommerce: a shop platform for WordPress whose order keys look like
wc_order_.... - Burp: a program that sits between your browser and a website and records every request and response so you can inspect them later.
- Request history: the list of requests Burp has recorded.
- Session: the short-lived state a website keeps for you while you are logged in.
- Cookie: a small piece of data your browser stores for a website and sends back with each request, often used to track a session.
- Authenticated customer: a customer the website has identified as logged in.
- Token: a value, usually long and random, that stands in for proof of permission and is hard to guess.
- Enumerate: to try values one after another, such as consecutive order numbers, to discover what exists.
- Responsible disclosure policy: a public page telling security researchers how to report a problem safely and what the company will do about it.
- Root cause: the underlying reason a bug exists, as opposed to its visible symptom.
- Ownership check: a check that the thing being requested belongs to the person making the request.
- Endpoint: a specific address on a website that performs a particular action or returns a particular document.