IDOR and statistics leakage in Orders
The order statistics endpoint accepted an order key supplied by the client and returned statistics for that order without checking that the caller owned it. An attacker could change the order key in the request body to read private statistics belonging to other users' orders.
- Disclosed after 54 days
Description: Twitter on its service "MoPub" statistics dedicated to the results of "Order", after the test shows that the endpoint "https://app.mopub.com/web-client/api/orders/stats/query" is infected with a "IDOR " bug
Which led to the leak of private statistics "Orders" by another users
Steps To Reproduce:
- [Create account in https://app.mopub.com/ and login]
- [go to the link https://app.mopub.com/orders and create Order ]
- [using this POST Request you can disclose statistics another orders By changing the value of the parameter orderKeys in body request]
POST /web-client/api/orders/stats/query HTTP/1.1
Host: app.mopub.com
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:66.0) Gecko/20100101 Firefox/66.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: https://app.mopub.com/orders
Content-Type: application/json
x-csrftoken: {TOKEN}
Content-Length: 98
Connection: close
Cookie: csrftoken={TOKEN}; sessionid={SID}; mp_mixpanel__c=1;
{"startTime":"2019-04-07","endTime":"2019-04-20","orderKeys":["43b29d60a9724fa9abbdc800044002d6"]}

Impact
leakage statistics
What the report shows
The target is MoPub, Twitter's advertising service, at app.mopub.com. The feature in question is the statistics view attached to Orders: after creating an order in the web client, the application queries a backend endpoint to render that order's performance figures.
The researcher reports that the endpoint https://app.mopub.com/web-client/api/orders/stats/query is affected by an insecure direct object reference, allowing the statistics of other users' orders to be read. The report describes the outcome as a leak of private order statistics.
The reproduction steps are short:
- Create an account at
https://app.mopub.com/and log in. - Go to
https://app.mopub.com/ordersand create an order. - Send the POST request below, changing the value of the
orderKeysparameter in the request body to disclose the statistics of another order.
POST /web-client/api/orders/stats/query HTTP/1.1
Host: app.mopub.com
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:66.0) Gecko/20100101 Firefox/66.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: https://app.mopub.com/orders
Content-Type: application/json
x-csrftoken: {TOKEN}
Content-Length: 98
Connection: close
Cookie: csrftoken={TOKEN}; sessionid={SID}; mp_mixpanel__c=1;
{"startTime":"2019-04-07","endTime":"2019-04-20","orderKeys":["[redacted]"]}
The body carries a date range and an array of order keys. The key in the example is a 32-character hexadecimal identifier, which is the object reference the endpoint trusts. The request also carries the session cookie and a CSRF token header, so the call is made as an authenticated user; the flaw is not missing authentication but missing authorisation on the referenced object.

The report records the impact simply as leakage of statistics. The platform metadata lists the issue as an insecure direct object reference with medium severity, a CVSS score of 5.9 and a bounty of 289.00 USD, disclosed on 2019-06-14. The report does not describe a fix.
Root cause
The endpoint accepts an order identifier from the client and returns statistics for it without checking that the authenticated caller owns or may access that order. The endpoint returns statistics for an order key supplied by the client without checking that the caller may access that order. The report shows that changing the value of the orderKeys parameter discloses another order's statistics.
Impact
The consequence is disclosure of private business data: the statistics of orders belonging to other MoPub users. An attacker who holds another order key can query its statistics by changing the orderKeys value. The report does not quantify what the statistics contain or how an attacker would obtain foreign keys beyond changing the parameter, so the practical reach depends on whether keys can be harvested elsewhere (referrers, shared links, exports, predictable generation).
How this kind of bug works
An IDOR arises when an application exposes an internal object identifier to the client and uses it to look up data without an access-control decision tied to the current principal. Authentication proves who is calling; authorisation must still decide whether this caller may touch this object. Frameworks make the mistake easy: a route such as /orders/{key}/stats maps naturally to a database lookup by primary key, and the ownership check is easy to forget, especially on secondary endpoints (statistics, exports, attachments, history) that are added after the main CRUD screen.
Defences are server-side object-level authorisation on every request, scoping queries by the authenticated tenant or user (for example, filtering by owner in the same query that fetches the object), and using unguessable identifiers only as a defence-in-depth measure, never as the access-control mechanism.
How to test for it
- Map the object-bearing endpoints. Use the application normally with a proxy and note every request that carries an identifier: path segments, query parameters, JSON body fields, headers.
- Create two accounts (A and B) and, in each, create at least one object of the same type. Record the identifiers each account sees.
- With account A's session, replay A's requests but substitute B's identifier. Send the request as-is otherwise, keeping cookies and CSRF tokens valid for A.
- Try variations: swap identifiers in the body array, in the path, in query strings; try B's identifier with A's session and also with no session; try identifiers that are sequential or otherwise guessable.
- A positive result is a response containing B's data (values that match what B sees, not an empty set or an error). Compare against B's own view to confirm.
Common false positives: the endpoint returns a generic success with empty data, or the data returned is public by design; the identifier is not actually an object reference but a per-user token; caching or CDN behaviour returns another user's page without the API being at fault; and test accounts in the same organisation legitimately share objects. Confirm with two unrelated accounts before reporting.
How it is fixed
The standard fix is to enforce object-level authorisation in the handler: resolve the identifier, then verify the caller's permission on that object before returning anything, and return a generic 403 or 404 otherwise. Prefer scoping the data query itself to the caller's account so a missing check cannot leak rows. Apply the same check to every endpoint that accepts an identifier, including batch endpoints that take arrays of keys, and add regression tests that replay a foreign identifier against each route.
Hunting notes
IDORs cluster on secondary and bulk endpoints: statistics, reports, exports, invoices, notifications, activity feeds, and any API that accepts an array of identifiers. Recon signals include numeric or short identifiers in URLs, keys that appear in client-side JavaScript, and endpoints discovered in mobile app traffic that the web UI never calls. To make a report land, demonstrate the cross-account read with two accounts, show the exact request and the returned data with sensitive values redacted, and state clearly what an attacker gains. If keys are unguessable, explain how they could be obtained; if they are sequential, show enumeration. Keep the proof minimal and reproducible.
What happened, in plain words
MoPub was an advertising service run by Twitter, reachable at app.mopub.com. Inside it, users could create "Orders": records that group an advertising campaign and collect performance figures over time. The Orders screen showed a list of your own orders, and each order had a statistics view with numbers for a chosen date range.
A security researcher found that the part of the site that fetches those statistics did not check who was asking. If you were logged in and sent the identifier of somebody else's order, the server answered with that order's statistics. In security language this is an insecure direct object reference, or IDOR: the application takes an identifier supplied by the user (here, an order key) and uses it to look up data without asking whether this user is allowed to see that particular object.
The report describes the result simply as a leak of private order statistics. The platform recorded it as medium severity, with a CVSS score of 5.9 and a bounty of 289.00 USD, disclosed on 2019-06-14. The report does not describe how it was fixed.
What the report shows
The target is the statistics endpoint behind the Orders feature. After you create an order in the web client, the browser asks a backend endpoint for that order's figures so it can draw them on the page.
The researcher reports that https://app.mopub.com/web-client/api/orders/stats/query is affected by an IDOR, allowing the statistics of other users' orders to be read.
The reproduction steps are short:
- Create an account at
https://app.mopub.com/and log in. This gives you a normal, legitimate session, which matters because the bug is not about getting in without an account. - Go to
https://app.mopub.com/ordersand create an order. This gives you a real order of your own, so you can see the request the site normally makes. - Send the POST request below, changing the value of the
orderKeysparameter in the request body to disclose the statistics of another order.
POST /web-client/api/orders/stats/query HTTP/1.1
Host: app.mopub.com
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:66.0) Gecko/20100101 Firefox/66.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Referer: https://app.mopub.com/orders
Content-Type: application/json
x-csrftoken: {TOKEN}
Content-Length: 98
Connection: close
Cookie: csrftoken={TOKEN}; sessionid={SID}; mp_mixpanel__c=1;
{"startTime":"2019-04-07","endTime":"2019-04-20","orderKeys":["[redacted]"]}
Line by line:
POST /web-client/api/orders/stats/query HTTP/1.1is the request line: the method (POST, meaning "here is some data for you"), the path of the endpoint, and the HTTP version. A request is simply the message your browser sends to a server to ask for something.Host: app.mopub.comsays which site the request is for. One server can host many sites, so the server needs to know which one you mean.User-Agent,Accept,Accept-Language,Accept-Encodingdescribe the browser and what kinds of response it can handle. They are ordinary browser headers and play no part in the bug.Referer: https://app.mopub.com/orderstells the server which page the request came from. Here it is the Orders page, which is where the statistics view lives.Content-Type: application/jsonsays the body is JSON, a common text format for structured data.x-csrftoken: {TOKEN}carries a CSRF token, a value the site puts in its pages so it can tell that a state-changing request really came from its own pages and not from a malicious site. The report shows it redacted as{TOKEN}.Content-Length: 98is the size of the body in bytes.Connection: closeasks the server to close the connection after the response.Cookie: csrftoken={TOKEN}; sessionid={SID}; mp_mixpanel__c=1;carries the cookies, small pieces of data the browser stores for a site and sends back on every request.sessionidis the important one: it is the value that identifies your logged-in session, like a wristband at an event. The report shows it redacted as{SID}.- The blank line separates headers from body.
- The body
{"startTime":"2019-04-07","endTime":"2019-04-20","orderKeys":["[redacted]"]}asks for statistics between two dates for a list of orders.orderKeysis an array (a list) of order identifiers; the one shown is a 32-character hexadecimal string. That string is the object reference the endpoint trusts.
The key point is that the request is fully authenticated: it carries the researcher's own session cookie and a valid CSRF token. The flaw is not missing authentication but missing authorisation on the referenced object. The server knew who was calling; it just never checked whether that caller was allowed to see the order named in orderKeys.

Root cause
The endpoint accepts an order identifier from the client and returns statistics for it without checking that the logged-in caller owns or may access that order. The endpoint returns statistics for an order key supplied by the client without checking that the caller may access that order. The report shows that changing the value of the orderKeys parameter discloses another order's statistics.
Impact
The consequence is disclosure of private business data: the statistics of orders belonging to other MoPub users. Anyone holding another order key can query its statistics by changing the orderKeys value. The report does not quantify what the statistics contain or how an attacker would obtain foreign keys beyond changing the parameter, so the practical reach depends on whether keys can be harvested elsewhere (referrers, shared links, exports, predictable generation).
In general, how this kind of bug works
An IDOR arises when an application exposes an internal object identifier to the client and uses it to look up data without an access-control decision tied to the current user. Authentication proves who is calling; authorisation must still decide whether this caller may touch this object. Think of a hotel: showing your key card at the door proves you are a guest, but the door should still only open your own room, not any room whose number you happen to know.
Frameworks make the mistake easy: a route such as /orders/{key}/stats maps naturally to a database lookup by primary key, and the ownership check is easy to forget, especially on secondary endpoints (statistics, exports, attachments, history) that are added after the main screen.
Defences are server-side object-level authorisation on every request, scoping queries by the authenticated tenant or user (for example, filtering by owner in the same query that fetches the object), and using unguessable identifiers only as a defence-in-depth measure, never as the access-control mechanism.
In general, how to test for it
- Map the object-bearing endpoints. Use the application normally with a proxy and note every request that carries an identifier: path segments, query parameters, JSON body fields, headers.
- Create two accounts (A and B) and, in each, create at least one object of the same type. Record the identifiers each account sees.
- With account A's session, replay A's requests but substitute B's identifier. Send the request as-is otherwise, keeping cookies and CSRF tokens valid for A.
- Try variations: swap identifiers in the body array, in the path, in query strings; try B's identifier with A's session and also with no session; try identifiers that are sequential or otherwise guessable.
- A positive result is a response containing B's data (values that match what B sees, not an empty set or an error). Compare against B's own view to confirm.
Common false positives: the endpoint returns a generic success with empty data, or the data returned is public by design; the identifier is not actually an object reference but a per-user token; caching or CDN behaviour returns another user's page without the API being at fault; and test accounts in the same organisation legitimately share objects. Confirm with two unrelated accounts before reporting.
In general, how it is fixed
The standard fix is to enforce object-level authorisation in the handler: resolve the identifier, then verify the caller's permission on that object before returning anything, and return a generic 403 or 404 otherwise. Prefer scoping the data query itself to the caller's account so a missing check cannot leak rows. Apply the same check to every endpoint that accepts an identifier, including batch endpoints that take arrays of keys, and add regression tests that replay a foreign identifier against each route.
In general, hunting notes
IDORs cluster on secondary and bulk endpoints: statistics, reports, exports, invoices, notifications, activity feeds, and any API that accepts an array of identifiers. Recon signals include numeric or short identifiers in URLs, keys that appear in client-side JavaScript, and endpoints discovered in mobile app traffic that the web UI never calls. To make a report land, demonstrate the cross-account read with two accounts, show the exact request and the returned data with sensitive values redacted, and state clearly what an attacker gains. If keys are unguessable, explain how they could be obtained; if they are sequential, show enumeration. Keep the proof minimal and reproducible.
Glossary
- MoPub: Twitter's advertising service, the product in which the bug was found.
- Order: a record in MoPub whose statistics the endpoint returns.
- Endpoint: a specific address on a server that accepts requests, such as the statistics query path in this report.
- Request: the message a browser sends to a server asking for something or submitting data.
- Header: a labelled line in a request or response carrying metadata, such as the browser type or a cookie.
- Body: the part of a request that carries data, here a JSON document.
- JSON: a text format for structured data, using curly braces, names and values.
- Cookie: a small piece of data a site stores in your browser and receives back on each request.
- Session: the server-side record of your logged-in state, identified by a session cookie.
- Session ID: the value in the session cookie that ties a request to your logged-in session.
- CSRF token: a value embedded in a site's pages and sent with requests so the server can tell the request came from its own pages, not a malicious third-party site.
- Authentication: proving who you are, for example by logging in.
- Authorisation: deciding what an authenticated user is allowed to do or see.
- Object reference: the identifier an application uses to name a specific record, such as an order key.
- IDOR (insecure direct object reference): a flaw where an application accepts an object identifier from the user and returns the object without checking the user is allowed to access it.
- Array: an ordered list of values, such as the list of order keys in the request body.
- Hexadecimal: a way of writing numbers using the characters 0 to 9 and a to f; the order key in the report is a 32-character hexadecimal string.
- CVSS: a standard scoring system for the severity of a security flaw, from 0 to 10.
- Severity: a rating of how serious a flaw is, here medium.
- Bounty: a payment made to a researcher for reporting a valid security flaw.
- Proxy: a tool that sits between your browser and the site and lets you read and modify requests.
- 403 / 404: HTTP status codes meaning "forbidden" and "not found"; returning one of these without detail avoids confirming that an object exists.
- Regression test: an automated test that checks a fixed bug stays fixed.