Skip to content
IDOR Write-up Intermediate

When API Trust Goes Wrong: Findings From an E-Commerce Security Assessment

An e-commerce platform's API trusted client-supplied identifiers and values, allowing cart operations on other users' carts, order creation outside the normal checkout flow, and client-controlled pricing. It also exposed payment credentials, customer personal data, and checkout session tokens in URLs and headers.

Kittubadri Follow

Published on medium.com

Cybersecuri

Kittubadri, 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. 6 min read.

Context

This write-up comes from an authorised security assessment of an e-commerce platform. The author examined the application's cart, checkout, pricing, payment and session-handling workflows. The affected website and sensitive production identifiers are deliberately omitted from the write-up, so no hostnames, endpoints, parameter names or versions appear here.

The theme running through every finding is the same: the application trusted information supplied by the client without properly validating it on the server. The author's framing is that security testing does not always require complex exploits; sometimes the most interesting findings appear when an application accepts client input at face value.

Setup

The write-up does not describe the tooling, the number of accounts used, or any specific preconditions beyond the fact that the testing was authorised and covered the cart, checkout, pricing, payment and session-handling flows. The cart issue is described in terms of an authenticated user's ownership of resources.

Finding it

The author notes that the most interesting vulnerabilities are sometimes hidden inside completely normal workflows. The cart, a course identifier, a checkout request and a session token each look harmless in isolation, but each one turned out to be trusted by the server further than it should be.

The key distinction the author draws is between authentication and authorisation:

Authentication answers "Who are you?" Authorization answers "What are you allowed to access?"

A valid authentication token should never automatically grant access to another user's resources. Several of the findings below are exactly that failure.

Exploitation

1. Cart authorisation bypass

The cart functionality relied on a client-supplied cart identifier without adequately verifying that the authenticated user actually owned that cart. Because the identifier came from the client and the server did not check ownership, cart operations could be performed against another user's cart.

The write-up does not include the request or the identifier format. The condition is simply that the cart identifier is accepted from the client and used without an ownership check against the authenticated session.

2. Checkout authorisation weakness

The checkout process did not sufficiently verify that the requested course was actually associated with the user's intended purchase flow. By supplying course identifiers directly to the purchase endpoint, it was possible to create an order without relying entirely on the expected cart workflow.

A secure checkout should independently verify each step server-side:

Text
User ↓Cart ownership ↓Course ownership/availability ↓Price ↓Order

Each of those steps should be validated on the server. The write-up does not show the purchase endpoint or the course identifier values.

3. Client-controlled pricing

The checkout process relied on client-supplied course information without sufficiently ensuring that the final price was derived from trusted server-side values. The author contrasts the observed behaviour with the intended flow:

Text
Client → Course selection          ↓Server → Trusted database price          ↓Server → Calculate final amount

The server, rather than the client, should always be the authority for prices. The write-up does not include the request that carried the client-supplied course information or the resulting price.

4. Sensitive payment information exposure

The assessment identified exposure of sensitive information associated with the payment environment. Payment-related credentials and configuration should never be unnecessarily exposed through client-accessible responses.

The author notes that even if a particular credential cannot directly perform a sensitive operation, exposing internal payment information increases the attack surface and can provide useful information to an attacker.

5. Customer information exposure

API responses also exposed customer information beyond what should normally be required by the requesting client. The observed information included personally identifiable data such as:

  • Name
  • Email address
  • Phone number
  • Order-related information

This is a failure of data minimisation. If an endpoint only needs to return an order status, there is no reason for it to also return unnecessary customer information. The write-up does not identify the endpoint or show a response body.

6. Session token exposure

Another issue involved the transmission of checkout session tokens through request URLs and headers. Sensitive session values appearing in URLs can create additional exposure through mechanisms such as logging, browser history, caching and other infrastructure. Session tokens should be treated as credentials and handled accordingly.

Root cause

Although these vulnerabilities affected different parts of the application, they shared a common underlying problem:

Too much trust was placed in client-controlled information.

The security boundary the author describes should look like this:

Text
Client Input     ↓Authentication     ↓Authorization     ↓Input Validation     ↓Business Logic Validation     ↓Sensitive Operation

Skipping any of these checks can create unexpected security consequences.

Impact

  • Cart authorisation bypass: cart operations could be performed against another user's cart.
  • Checkout authorisation weakness: an order could be created by supplying course identifiers directly to the purchase endpoint, bypassing the expected cart workflow.
  • Client-controlled pricing: the checkout relied on client-supplied course information without sufficiently ensuring the final price came from trusted server-side values.
  • Payment information exposure: sensitive information associated with the payment environment was exposed through client-accessible responses, increasing the attack surface.
  • Customer information exposure: API responses returned PII (name, email address, phone number, order-related information) beyond what the requesting client needed.
  • Session token exposure: checkout session tokens travelled in request URLs and headers, exposing them to logging, browser history, caching and other infrastructure.

The write-up does not assign severities or CVSS scores, and it does not quantify how many users or records were affected.

Fix

The author's guidance is that every security-sensitive decision should ultimately be enforced by the server, and lists the assumptions that should not be made:

  • A cart ID belongs to the current user.
  • A course ID is authorised for the current user.
  • A price supplied by the client is trustworthy.
  • Sensitive customer data should automatically be returned.
  • A session token is safe simply because it is transmitted over HTTPS.

In practice that means ownership checks on cart identifiers, server-side validation of course ownership and availability at checkout, server-side price derivation from trusted database values, data minimisation in API responses, and treating session tokens as credentials rather than URL parameters.

Variants to test

  1. Cart identifier swapping. Take a cart identifier from your own session and substitute another account's identifier in cart operations. A positive result is a successful read or modification of the other user's cart.
  2. Direct purchase endpoint calls. Skip the cart and send course identifiers straight to the purchase endpoint. A positive result is an order created without the expected cart workflow.
  3. Price tampering. Supply course or price information from the client at checkout and observe whether the server recalculates from its own database. A positive result is an order whose final amount reflects client-supplied values.
  4. Response over-fetching. Request order status or similar minimal endpoints and inspect the full response. A positive result is PII or payment configuration returned beyond what the client needs.
  5. Token placement. Check whether checkout session tokens appear in URLs or headers. A positive result is a token visible in a URL that would land in logs, history or caches.
  6. Credential exposure in payment responses. Inspect client-accessible responses tied to the payment environment for credentials or configuration. A positive result is any payment-related secret or internal configuration detail returned to the client.

The author's closing advice is to test not just whether an API accepts a request, but whether the server is actually enforcing the rules behind that request.

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

What happened, in plain words

A security researcher was given permission to test an e-commerce platform. The permission matters: testing someone's website without it is illegal in most countries, and this assessment was authorised. The researcher did not need complex exploits. Instead, they used the shop the way a normal customer would, and paid attention to what the shop's servers accepted without question.

The shop is built from several moving parts: a shopping cart, a checkout page, a price calculation, a payment step, and a way of remembering who you are between pages. Each of those parts talks to the shop's servers through an API.

An API (Application Programming Interface) is the set of doors and counters a website's own pages use to ask the server for things. Think of a restaurant: the menu and the waiter are the API. You do not walk into the kitchen yourself; you tell the waiter what you want, and the waiter carries your order to the kitchen and brings back the food. In the same way, your browser sends a request to the server, and the server sends back data. The important part is that the waiter should check your order against the restaurant's rules, not just carry whatever you say into the kitchen.

The researcher found six problems, and they shared a common pattern: too much trust was placed in client-controlled information. In everyday terms, it is like a hotel receptionist who hands out room keys to anyone who names a room number, without checking that the person is actually staying in that room.

Before going further, two words appear constantly in this kind of testing, and they are easy to mix up:

  • Authentication answers "Who are you?" It is the login step: proving you are a particular account.
  • Authorisation answers "What are you allowed to access?" It is the permission step: deciding whether that account may touch a particular cart, order or record.

A valid login should never, by itself, give you access to someone else's things. Several of the findings below are exactly that mistake.

The setup

The write-up does not describe which tools were used, how many accounts were created, or any special preparation. What it does say is that the testing was authorised and covered the cart, checkout, pricing, payment and session-handling flows. The cart issue is described from the point of view of a logged-in user, because it is about one user's ownership of a cart.

A session is the server's memory of your visit. When you log in, the server gives your browser a small piece of text, often called a token or a cookie, and your browser sends it back with every later request so the server knows it is still you. Think of it as a wristband at a festival: you show it once at the gate, and after that staff recognise you by the band. If someone else gets your band, they can walk around as you.

Finding it

The researcher did not go hunting for exotic bugs. They walked through the normal business workflows, the same paths a real customer takes, and asked a simple question at each step: does the server check this, or does it just believe it?

A cart, a course identifier, a checkout request and a session token each look harmless on their own. But each one turned out to be trusted by the server further than it should be. That is the whole method: use the product normally, then notice where the server takes your word for something.

The six findings

1. Cart authorisation bypass

The cart worked using a cart identifier: a value that names a particular shopping cart. The browser sent this identifier with each cart request, and the server used it to decide which cart to read or change. The problem was that the server did not properly check that the logged-in user actually owned that cart.

Because the identifier came from the client (your browser) and the server did not check ownership, cart operations could be performed against another user's cart. In plain terms: if you can name someone else's cart, the server will act on it as if it were yours.

This is an authorisation bypass: a check that should exist is missing, so you get past a boundary you were never meant to cross. The write-up does not include the request or the format of the identifier. The condition is simply that the cart identifier is accepted from the client and used without an ownership check against the logged-in session.

2. Checkout authorisation weakness

The checkout process did not sufficiently verify that the requested course was actually associated with the user's intended purchase flow. By supplying course identifiers directly to the purchase endpoint, it was possible to create an order without relying entirely on the expected cart workflow.

An endpoint is one specific address on the server that does one specific job, like a single counter in a large office. The purchase endpoint is the counter that creates orders. Normally you reach it after putting something in your cart, so the cart is the expected path. Here, the researcher could walk straight up to the counter and name a course, skipping the queue.

A secure checkout should independently verify each step on the server:

Text
User ↓Cart ownership ↓Course ownership/availability ↓Price ↓Order

Read this diagram from top to bottom as a checklist the server should run for every order:

  • User: who is asking? The server should know this from the session, not from anything the browser claims.
  • Cart ownership: does this cart belong to that user?
  • Course ownership/availability: is this course actually part of what the user is buying, and is it available?
  • Price: what does the server's own database say this costs?
  • Order: only now create the order.

Each of those steps should be validated on the server. The write-up does not show the purchase endpoint or the course identifier values.

3. Client-controlled pricing

The checkout process relied on course information supplied by the client without sufficiently ensuring that the final price came from trusted server-side values. The author contrasts what happened with what should happen:

Text
Client → Course selection          ↓Server → Trusted database price          ↓Server → Calculate final amount

This diagram shows two halves. On the left, the client (your browser) selects a course. On the right, the server should look up the price in its own trusted database and calculate the final amount itself. The arrow from the client should stop at "course selection"; it should never reach the price.

When the server instead trusts price-related information from the browser, the client can influence pricing. The everyday comparison is a market stall where the customer writes the price on the label and the seller just reads it back. The server, rather than the client, should always be the authority for prices. The write-up does not include the request that carried the client-supplied course information or the resulting price.

4. Sensitive payment information exposure

The assessment identified exposure of sensitive information associated with the payment environment. In other words, responses the browser could read exposed sensitive information associated with the payment environment.

A credential is a secret used to prove identity or gain access, such as a password or an API key. Configuration means the settings that make a system work, such as which payment service it talks to and how. Neither belongs in a response a customer's browser can read.

Payment-related credentials and configuration should never be unnecessarily exposed through client-accessible responses. The author notes that even if a particular credential cannot directly perform a sensitive operation, exposing internal payment information increases the attack surface, meaning the number of ways an attacker could try to get in, and can provide useful information to an attacker.

5. Customer information exposure

API responses also exposed customer information beyond what should normally be required by the requesting client. The observed information included personally identifiable data such as:

  • Name
  • Email address
  • Phone number
  • Order-related information

Personally identifiable information (PII) is any data that can identify a real person, directly or in combination with other details. This is a failure of data minimisation: the principle that a system should hand over only the data needed for the job, nothing more.

If an endpoint only needs to return an order status, there is no reason for it to also return unnecessary customer information. The everyday comparison is a parcel tracking page that tells you where your parcel is, and also prints the recipient's phone number and email for no reason. The write-up does not identify the endpoint or show a response body.

6. Session token exposure

Another issue involved the transmission of checkout session tokens through request URLs and headers.

A URL is the address in your browser's address bar. A header is extra information sent alongside a request, like the label on an envelope rather than the letter inside. Both are places where a token can travel, but they are not equally safe.

Sensitive session values appearing in URLs can create additional exposure through mechanisms such as logging, browser history, caching and other infrastructure. Servers and proxies often keep logs of the addresses requested, browsers keep history, and caches store copies of pages. A token in a URL can end up copied into all of those places. Session tokens should be treated as credentials and handled accordingly.

The common pattern

Although these vulnerabilities affected different parts of the application, they shared a common underlying problem:

Too much trust was placed in client-controlled information.

The security boundary should look like this:

Text
Client Input     ↓Authentication     ↓Authorization     ↓Input Validation     ↓Business Logic Validation     ↓Sensitive Operation

This is a pipeline, and every request should pass through every stage in order:

  • Client input: whatever the browser sends.
  • Authentication: confirm who is asking.
  • Authorisation: confirm they are allowed to do this particular thing.
  • Input validation: confirm the values are well formed and sensible.
  • Business logic validation: confirm the request makes sense under the shop's own rules, such as the price and the course matching.
  • Sensitive operation: only now do the thing, such as creating an order or returning customer data.

Skipping any of these checks can create unexpected security consequences. In each finding above, one of those layers was missing or insufficient: ownership checks on the cart, course-to-flow association at checkout, server-side price derivation, response filtering for payment and customer data, and safe handling of session tokens.

What each finding means in practice

  • Cart authorisation bypass: cart operations could be performed against another user's cart.
  • Checkout authorisation weakness: an order could be created by supplying course identifiers directly to the purchase endpoint, bypassing the expected cart workflow.
  • Client-controlled pricing: the final price was not sufficiently derived from trusted server-side values, so the client influenced pricing.
  • Payment information exposure: internal payment credentials and configuration were exposed through client-accessible responses, increasing the attack surface even where a credential could not directly perform a sensitive operation.
  • Customer information exposure: API responses returned PII (name, email address, phone number, order-related information) beyond what the requesting client needed.
  • Session token exposure: checkout session tokens travelled in request URLs and headers, exposing them to logging, browser history, caching and other infrastructure.

The write-up does not assign severities or CVSS scores, and it does not quantify how many users or records were affected.

What should change

The author's guidance is that every security-sensitive decision should ultimately be enforced by the server, and lists the assumptions that should not be made:

  • A cart ID belongs to the current user.
  • A course ID is authorised for the current user.
  • A price supplied by the client is trustworthy.
  • Sensitive customer data should automatically be returned.
  • A session token is safe simply because it is transmitted over HTTPS.

That last point deserves a word. HTTPS is the padlock in your browser: it encrypts the connection between your browser and the server so nobody in between can read it. It protects the journey, not the destination. A token sent over HTTPS is still a token sitting in a server log or a browser history entry afterwards.

In practice, the fixes mean ownership checks on cart identifiers, server-side validation of course ownership and availability at checkout, server-side price derivation from trusted database values, data minimisation in API responses, and treating session tokens as credentials rather than URL parameters.

How you could test the same ideas

These are the variants the author suggests. They only make sense on a system you own or have written permission to test.

  1. Cart identifier swapping. Take a cart identifier from your own session and substitute another account's identifier in cart operations. A positive result is a successful read or modification of the other user's cart.
  2. Direct purchase endpoint calls. Skip the cart and send course identifiers straight to the purchase endpoint. A positive result is an order created without the expected cart workflow.
  3. Price tampering. Supply course or price information from the client at checkout and observe whether the server recalculates from its own database. A positive result is an order whose final amount reflects client-supplied values.
  4. Response over-fetching. Request order status or similar minimal endpoints and inspect the full response. A positive result is PII or payment configuration returned beyond what the client needs.
  5. Token placement. Check whether checkout session tokens appear in URLs or headers. A positive result is a token visible in a URL that would land in logs, history or caches.
  6. Credential exposure in payment responses. Inspect client-accessible responses tied to the payment environment for credentials or configuration. A positive result is any payment-related secret or internal configuration detail returned to the client.

The author's closing advice is to test not just whether an API accepts a request, but whether the server is actually enforcing the rules behind that request.

Glossary

  • API: the set of addresses and rules a website's pages use to ask its server for data or actions, like a waiter carrying orders to a kitchen.
  • Authentication: proving who you are, usually by logging in.
  • Authorisation: deciding what a proven identity is allowed to access or do.
  • Authorisation bypass: getting past a permission check because the check is missing or insufficient.
  • Cart identifier: a value that names a particular shopping cart, sent by the browser with cart requests.
  • Checkout: the part of a shop where a basket becomes an order.
  • Client: the program on your side, normally your browser, which sends requests.
  • Server: the computer that holds the data and decides what to do with each request.
  • Endpoint: one specific address on a server that performs one specific job.
  • Session: the server's memory of your visit, kept alive by a token your browser sends back.
  • Token: a piece of text that acts like a wristband, proving your session to the server.
  • Cookie: a small piece of data a site stores in your browser and receives back on later requests.
  • Header: extra information sent alongside a request, like a label on an envelope.
  • URL: the address of a page or request, shown in your browser's address bar.
  • HTTPS: the encrypted connection shown by the padlock, protecting data in transit but not afterwards.
  • Credential: a secret used to prove identity or gain access, such as a password or API key.
  • Configuration: the settings that make a system work, such as which services it talks to.
  • Attack surface: the total number of ways an attacker could try to get in.
  • PII (personally identifiable information): data that can identify a real person, such as a name, email address or phone number.
  • Data minimisation: returning only the data needed for the job, nothing extra.
  • Input validation: checking that values sent by the client are well formed and sensible.
  • Business logic validation: checking that a request makes sense under the application's own rules, such as price and ownership matching.
  • Caching: storing copies of responses so they can be served faster later, which can also store secrets.
  • Logging: keeping records of requests and events, which can also record secrets.
  • CVSS: a standard scoring system for rating the severity of a vulnerability.

More by Kittubadri

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.