Skip to content
Access control Write-up Intermediate

One Restaurant Account. 23,000+ Order IDs. One Very Big MQTT Problem

A low-privilege restaurant account could obtain MQTT credentials and subscribe to wildcard topics, receiving live order events from thousands of other restaurants across multiple tenants. The leaked OrderIds could then be used against an unauthenticated order-items API to retrieve order contents.

Mohammed Ashraf Follow

Published on medium.com

Bug Bounty

Mohammed Ashraf, 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. 9 min read.

Context

The target was a partner-facing web application with a live order dashboard, fed by an MQTT connection to an AWS IoT endpoint. and the dashboard is fed by an MQTT connection to an AWS IoT endpoint. The frontend fetches the IoT configuration, connects to the broker, and subscribes to a small set of application topics. The researcher held a valid low-privilege restaurant account and was testing the partner-facing application, not the broker directly.

The feature normally does one thing: it lets a restaurant see its own live order events. The question the write-up asks is whether the MQTT authorisation layer knows which restaurant the authenticated user belongs to, the same way the application does.

Setup

The preconditions were modest:

  • A legitimate partner access token, tied to a low-privilege restaurant account.
  • The application-specific headers the dashboard sends when requesting IoT configuration.
  • An MQTT client capable of subscribing with wildcard filters (the write-up shows client.subscribe(...) calls with qos=0).
  • Frontend reconnaissance material: the live-order JavaScript bundle and its source map.

A valid low-privilege restaurant account was enough.

Finding it

The entry point was ordinary frontend reconnaissance: download JavaScript, search for interesting strings, repeat. One large live-order application bundle and its source map turned up, and searching for the keywords below led to references to an AWS IoT configuration endpoint used by the live-order application.

Text
secretsiotmqtt

The frontend was retrieving the information required to establish an MQTT connection. That raised the question the rest of the work answers: if the browser can obtain the IoT configuration, how tightly is the resulting MQTT access scoped?

Watching the browser's network requests showed that loading the live-order dashboard triggered a request to retrieve the IoT configuration. The request required a legitimate partner access token and some application-specific headers. The response contained the IoT endpoint and authentication material, and the authentication context also contained restaurant and tenant information, conceptually:

Text
{  "RestaurantId": "[REDACTED]",  "Tenant": "[REDACTED]",  "ClientId": "[REDACTED]"}

So the application clearly knew which restaurant the authenticated user belonged to. The open question was whether the MQTT authorisation layer knew it too.

Tracing the subscriptions made by the legitimate application showed it subscribed to only a small number of application-specific topics, conceptually:

Text
partners/{tenant}/holidaysurveyspartners/{tenant}-{ref}/holidaysurveysliveorders/{ref}/debug

Nothing resembling a wildcard. A restaurant should not need access to every event generated by every other restaurant, so the next step was to ask for # anyway.

Exploitation

Step 1: connect with the legitimate token and subscribe to #

Using a legitimate partner token, the researcher made a completely passive subscription test:

Text
client.subscribe("#", qos=0)

The broker returned:

Text
SUBACK 0x00

A successful subscription to the entire topic tree. Two more wildcards were tried:

Text
client.subscribe("partners/+#", qos=0)
Text
client.subscribe("+/+", qos=0)

Both returned SUBACK 0x00 as well. The authenticated restaurant account could request wildcard subscriptions far outside the topics the legitimate application uses. The write-up describes the moment in the familiar sequence: try something because it probably will not work, watch it work, stare at the terminal, try it again in case of a typo, watch it work again.

Step 2: measure a short capture

Leaving the connection running for about a minute produced:

Text
351 messages177 unique OrderIds177 unique (tenant, restaurant) combinations6+ countries~40 drivers

To rule out an unusually busy minute or internal test traffic, the capture was extended to five minutes:

Text
8,288 messages4,114 unique (tenant, restaurant) combinations~4,000 unique OrderIds11 countries409 drivers

At that point the question changed from whether the broker was broken to how broken it was.

Step 3: run longer captures

A 60-minute passive capture contained:

Text
147,817 messages23,929 unique (tenant, restaurant) combinations~23,000 unique OrderIds12 countries3,777 unique drivers

A separate 90-minute capture during other testing contained:

Text
22,905 messages2,631 unique (tenant, restaurant) combinations2,625 unique OrderIds11 countries200 drivers

The exact numbers depend on time of day and production traffic, but the observation was consistent: this was not one restaurant accidentally seeing one other restaurant. The subscription exposed activity across a large shared production environment.

Step 4: inventory what the messages actually contained

About 147,000 payloads were scanned. The researcher specifically searched for several categories of customer PII and found none of them: no customer phone numbers, no customer email addresses, no customer delivery addresses, no customer GPS coordinates, no payment information and no authentication tokens. The write-up is explicit that the bus did not contain everyone's personal information.

Only eight recurring event types appeared across the large capture:

Text
orderchangestatedriverassigneddriveratrestaurantestimatedrestaurantinfoupdatedeventrestaurantmenuupdatedeventstartfoodprepeposfailedtosendtokitchenHolidaySurvey

Most traffic was order-state events. Driver-related events carried fields such as:

Text
DriverNameDriverIdEstimatedArrivalTime

Other events exposed tenant, restaurant and order identifiers. One correction from the researcher's initial notes matters: an eposfailedtosendtokitchen event did not contain order-item details. It contained identifiers only:

Text
TenantRestaurantIdOrderId

The logs were re-checked specifically because an earlier interpretation had suggested additional order information. The logs disagreed, and the logs win.

The inventory from the 60-minute capture:

Field Observation Impact
DriverName 3,777 unique values Driver identification
DriverId ~99.9% empty Very limited standalone value
EstimatedArrivalTime Present on driver events Real-time activity tracking
Tenant Present throughout the stream Tenant enumeration
RestaurantId Present throughout the stream Restaurant identification
OrderId Present in relevant events Chain key
LegacyOrderId Present in ~34% of messages Cross-system correlation

There were also 50,658 distinct LegacyOrderId values in the 60-minute capture: short numeric identifiers that link newer order identifiers to legacy systems. The interesting part is not that a single identifier existed, but that identifiers were exposed across tenant boundaries.

The traffic was not limited to one local market: 12 countries appeared during the longest capture, several consistently across captures, with one market appearing more isolated. The country-to-tenant mapping and production identifiers are deliberately not published, because they are unnecessary to understand the vulnerability. The point is that the MQTT namespace was shared across multiple geographic markets and the wildcard subscription exposed cross-market traffic.

Step 5: find the second vulnerability

Driver names and restaurant events alone would limit the severity discussion. During earlier testing the researcher had identified an order-items API with functionality conceptually similar to:

Text
GET /applications/assistantapi/v1/order-item?orderId={OrderId}

The endpoint did not require authentication when accessed from the server side. On its own that is interesting, but it needs valid OrderIds. The MQTT stream supplied them continuously: fresh alphanumeric OrderIds belonging to restaurants outside the authenticated account's scope.

Step 6: chain MQTT identifiers into the order API

A small number of freshly observed identifiers were tested against the order-items endpoint. Validation was deliberately kept small: no thousands of orders, no database, no bulk download of what the broker would hand over. A handful of fresh identifiers was enough to prove the chain:

Text
8 / 8 alphanumeric OrderIds→ HTTP 200

The responses contained actual order information, including fields such as:

Text
itemsitem namesunit pricesoptions/sub-itemstotal priceorder number

A sanitised example:

Text
{  "items": [    {      "name": "[REDACTED]",      "unitPrice": 12.90,      "subItems": [...]    }  ],  "totalPrice": "[REDACTED]",  "OrderNumber": "[REDACTED]"}

All real production identifiers and values were removed from the write-up.

Step 7: check whether legacy IDs work too

The short numeric LegacyOrderId values were also tried against the same endpoint. They did not resolve:

Text
404 No order found

Only the alphanumeric OrderIds obtained from the MQTT stream resolved. That distinction matters: the stream was not leaking irrelevant identifiers, it was leaking exactly the identifier format the second vulnerability needs.

The complete chain:

Text
Cross-tenant MQTT access        ↓Live OrderId disclosure        ↓Unauthenticated order lookup        ↓Live order contents

Or, in the shortest version:

Text
MQTT = feederAPI = data

Root cause

The legitimate application needs only a handful of MQTT topics. The broker nevertheless accepted #, partners/+# and +/+ for a normal authenticated partner account. Authentication worked: the system knew the identity and restaurant context of the user, and the IoT configuration response even carried RestaurantId and Tenant. What was missing was enforcement of that context when evaluating wildcard topic access. In multi-tenant terms, the first question (who are you?) was answered, and the second (what are you allowed to read?) was effectively absent at the MQTT wildcard boundary.

The second issue compounds it: the order-items endpoint accepted OrderIds without authentication when accessed from the server side, so an identifier that should only name an order also functioned as the credential for reading it. Publishing being blocked does not help, because a read-only firehose is still a firehose.

Impact

A holder of any valid low-privilege restaurant account could passively subscribe to the shared production event bus and receive live events for unrelated tenants: order-state changes, driver names and estimated arrival times, tenant and restaurant identifiers, and fresh alphanumeric OrderIds, across 12 countries in the longest capture. Those OrderIds could then be fed to the unauthenticated order-items endpoint to retrieve live order contents, including item names, unit prices, options and sub-items, total price and order number. Eight out of eight fresh identifiers returned HTTP 200.

The exposed data is order and operational metadata plus, through the second issue, order contents. The researcher validated with a handful of orders rather than bulk retrieval, and removed production hostnames, tenant names, restaurant identifiers, real OrderIds, driver names, internal project identifiers, authentication material, raw production logs and country-to-tenant mappings from the public account.

Fix

The write-up does not describe a remediation or say what the vendor changed. What it argues should be enforced is topic-level authorisation at the broker: a restaurant account should see its restaurant, not 23,929 restaurant contexts, and a live-order dashboard should receive the events it needs rather than the entire MQTT namespace. The write-up argues that a restaurant account should see only its restaurant and that an OrderId should identify an order rather than act as the password for reading it.

Variants to test

  1. Wildcard subscriptions on any MQTT-backed dashboard. Connect with the lowest-privilege account you can create and try #, +/+, partners/+# and tenant-scoped prefixes. A positive result is SUBACK 0x00 followed by messages carrying tenant or restaurant identifiers that do not belong to your account.
  2. IoT configuration endpoints. Look for frontend bundles and source maps referencing IoT or MQTT configuration, and check whether the returned authentication context includes tenant or restaurant fields.
  3. Identifier-to-data endpoints without authentication. Take identifiers observed in one channel (event stream, logs, notifications) and replay them against lookup APIs from the server side. A positive result is HTTP 200 with object contents for identifiers you do not own.
  4. Identifier format mismatches. Test both the modern and legacy identifier formats against the same endpoint, as the researcher did with LegacyOrderId. A positive result is one format resolving where the other returns 404, which tells you which channel feeds the exploitable path.
  5. Cross-market scope. If the namespace is shared across regions, check whether a single account's wildcard reaches tenants in other countries. A positive result is events from markets your account has no relationship with.
  6. Publish versus subscribe asymmetry. Confirm whether publishing is blocked while subscribing is not.

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

What happened, in plain words

A security researcher was testing a website used by restaurants and their business partners. The site has a live order dashboard: a screen that shows orders moving through the system in real time. Behind that screen sits a messaging service called MQTT, which is a way for one computer to broadcast short updates that many other computers can listen to. Think of it like a group of walkie-talkie channels: each restaurant should be tuned to its own channel and hear only its own orders.

The researcher had a normal, low-privilege restaurant login. That is the kind of account a small restaurant gets, with no special powers. While poking around the website's code, he found how the dashboard gets its connection details for the messaging service. Then he asked the messaging service for everything instead of just his own channel, and it said yes. For an hour he sat and listened, and received 147,817 messages about orders belonging to thousands of other restaurants in 12 countries.

Those messages contained order numbers. Separately, he knew of another part of the system, an order lookup service, that would hand over the full contents of an order to anyone who asked with a valid order number, no login required. So the two problems joined up: the messaging service handed out other restaurants' order numbers, and the lookup service turned those numbers into real order details. Eight out of eight order numbers he tried came back with data.

The rest of this article walks through exactly how he got there, step by step, explaining each technical idea as it appears.

Some words you will meet immediately

Before the walkthrough, a few ideas that come up constantly.

  • JavaScript is the programming language that runs inside your browser. When you open a modern website, the site sends your browser a pile of JavaScript files, and those files make the page interactive: buttons, live updates, menus. Anyone can download these files, because your browser already did.
  • An API (Application Programming Interface) is a way for one piece of software to ask another piece of software for something. A useful everyday comparison is a restaurant menu and a waiter: the menu lists what you can ask for, and the waiter carries your request to the kitchen and brings back the result. You never walk into the kitchen yourself. On the web, an API is usually a URL that returns data rather than a web page.
  • An endpoint is one specific address on that menu. If the API is the menu, an endpoint is one dish: one URL that does one job, such as "give me the details of order 1234".
  • A token is a short piece of text that proves who you are, a bit like a wristband at an event. You show it with each request and the server checks it before answering. It is not your password; it is something the server gave you after you logged in.
  • A tenant is one customer organisation inside a shared system. If one company runs the software for many restaurants, each restaurant (or each restaurant group) is a tenant. Keeping tenants apart is the whole point of a multi-tenant system, the same way separate flats in one building share walls but not front doors.
  • MQTT is a lightweight messaging protocol. One central computer, called a broker, receives short messages on named channels called topics and forwards them to whoever has asked to listen. A topic name looks like a path, for example liveorders/restaurant-a. A client subscribes to a topic to receive its messages, and publishes to send one.
  • A wildcard is a symbol that means "anything here". In MQTT, # means every topic at every level, and + means any single level. Subscribing to # is like asking the post office to deliver every letter in the country to your door.
  • QoS stands for Quality of Service, a setting that controls how hard the broker tries to make sure a message arrives. qos=0 means "send it once and do not worry if it is lost", the lightest setting.
  • A source map is a helper file that websites ship alongside their JavaScript. The JavaScript your browser runs has usually been squashed and renamed to make it smaller, which makes it unreadable to humans. A source map lets a developer (or a curious researcher) map the squashed code back to the original, readable code.

The setup: what the researcher had

The starting position was deliberately ordinary:

  1. A legitimate partner access token, tied to a low-privilege restaurant account. Nothing stolen, nothing guessed.
  2. The application-specific headers the dashboard sends when it asks for its messaging configuration. Headers are small labels attached to a web request, like the address and return-address on an envelope; some sites require particular ones before they answer.
  3. An MQTT client, which is simply a program that can connect to a broker and subscribe to topics. The write-up shows the calls it makes.
  4. Frontend reconnaissance material: the live-order JavaScript bundle and its source map.

A valid low-privilege restaurant account was enough.

Finding it: reading the website's own code

The entry point was ordinary frontend reconnaissance. That phrase means: download the JavaScript files the site serves, search inside them for interesting words, and repeat. It is the web equivalent of reading the instructions leaflet that came with a device, because companies often leave useful hints in the code their browsers run.

One large live-order application bundle and its source map turned up. Searching that code for the keywords below led to references to an AWS IoT configuration endpoint used by the live-order application.

Text
secretsiotmqtt

Line by line, this is not code at all: it is a list of search terms typed into the downloaded files. secrets looks for hard-coded passwords or keys. iot stands for Internet of Things, the broad category of connected devices and services. mqtt looks for the messaging protocol by name. The search hit on iot and mqtt told the researcher that the dashboard talks to an AWS IoT endpoint, and the surrounding code showed where the browser fetches the details it needs to connect.

Why do this? Because the frontend has to know how to connect to the broker, so the connection details must reach the browser somehow. If you can find that mechanism, you can watch it work and ask whether it hands out more access than the dashboard actually needs.

The frontend was retrieving the information required to establish an MQTT connection. That raised the question the rest of the work answers: if the browser can obtain the IoT configuration, how tightly is the resulting MQTT access scoped? In plain terms: the browser must be given some kind of key to the messaging service. Does that key open one door, or the whole building?

Watching the browser ask for its messaging credentials

Next, the researcher watched the browser's network requests. Every browser has a developer tools panel that lists every request the page makes and every response it gets back, like a receipt roll of everything the page said to the internet. Loading the live-order dashboard triggered a request to retrieve the IoT configuration.

The request required a legitimate partner access token and some application-specific headers. The response contained the IoT endpoint and authentication material, and the authentication context also contained restaurant and tenant information, conceptually:

Text
{  "RestaurantId": "[REDACTED]",  "Tenant": "[REDACTED]",  "ClientId": "[REDACTED]"}

This block is a JSON object, a common way of writing structured data as text. The curly braces wrap a set of labelled values. RestaurantId is the identifier of the restaurant the logged-in user belongs to. Tenant is the identifier of the organisation that restaurant sits inside. ClientId is the name the browser will use when it connects to the broker, so the broker can tell one connection from another. The values are shown as [REDACTED] because the real ones were removed before publishing.

So the application clearly knew which restaurant the authenticated user belonged to. That is good design: the server knows who is asking. The open question was whether the MQTT authorisation layer knew it too. Authorisation is the difference between "I know who you are" and "I know what you are allowed to see", and it is where this story turns.

What a normal restaurant actually needs

To know what "too much" looks like, you first need to know what "normal" looks like. The researcher traced the subscriptions made by the legitimate application, meaning he watched which topics the real dashboard asked to listen to. It subscribed to only a small number of application-specific topics, conceptually:

Text
partners/{tenant}/holidaysurveyspartners/{tenant}-{ref}/holidaysurveysliveorders/{ref}/debug

These are three topic names, run together by the formatting of the original page. Read them as separate lines:

  • partners/{tenant}/holidaysurveys is a topic under the partner's tenant identifier, ending in a survey-related name.
  • partners/{tenant}-{ref}/holidaysurveys is a similar topic where the tenant identifier is followed by a reference.
  • liveorders/{ref}/debug is a live-orders topic for one particular reference, used for debugging.

The curly-braced parts, {tenant} and {ref}, are placeholders: in real use they are filled in with the actual tenant and reference values. The important observation is that every one of these names is narrow and specific. Nothing resembles a wildcard. A restaurant should not need access to every event generated by every other restaurant, just as a resident should not need a key to every flat in the building.

So the next step was to ask for # anyway. That is the core move of the whole report: request something the application never requests, and see whether the system refuses.

The "oh no" moment: asking for everything

Using a legitimate partner token, the researcher made a completely passive subscription test. Passive means he only listened; he did not send or change anything. That distinction matters both ethically and legally: listening to what a system broadcasts is far less intrusive than altering data.

Text
client.subscribe("#", qos=0)

This is one line of client code. client is the program's connection to the broker. .subscribe(...) is the instruction "please add me to this topic". The first argument, "#", is the wildcard meaning every topic at every level. qos=0 asks for the lightest delivery guarantee. In everyday terms: "put me on every channel there is, and do not bother with receipts."

The broker returned:

Text
SUBACK 0x00

SUBACK is short for subscription acknowledgement: the broker's reply to a subscribe request. 0x00 is a number written in hexadecimal, a base-16 counting system often used in protocols; here it is zero. In MQTT, a return code of zero means success. So this line says: subscription accepted, no problem. The broker had just agreed to send this restaurant every message on every topic it carried.

Two more wildcards were tried:

Text
client.subscribe("partners/+#", qos=0)

Here the topic filter is partners/+#. The + matches any single level, so this means "anything directly under partners/, and then everything below it". It is a narrower wildcard than #, but still far wider than one restaurant's own topics.

Text
client.subscribe("+/+", qos=0)

This filter means "any topic that has exactly two levels", with each level allowed to be anything. Again, it reaches well beyond a single tenant.

Both returned SUBACK 0x00 as well. The authenticated restaurant account could request wildcard subscriptions far outside the topics the legitimate application uses.

The write-up describes the moment in the familiar sequence: try something because it probably will not work, watch it work, stare at the terminal, try it again in case of a typo, watch it work again. Anyone who has spent an evening testing software recognises that loop. The second attempt is not doubt about the result; it is doubt about your own typing.

Measuring a short capture

A single surprising result is not proof of scale. Maybe the broker was misconfigured for one topic, or maybe the researcher had stumbled onto some internal test traffic. So the next step was to measure.

Leaving the connection running for about a minute produced:

Text
351 messages177 unique OrderIds177 unique (tenant, restaurant) combinations6+ countries~40 drivers

Each line is a count from that one minute. 351 messages is the number of individual updates received. 177 unique OrderIds means 177 different order numbers appeared, with duplicates counted once. 177 unique (tenant, restaurant) combinations means those orders came from 177 distinct restaurant contexts, each identified by the pair of tenant and restaurant. 6+ countries means activity traced to at least six countries. ~40 drivers means roughly forty delivery drivers were mentioned; the tilde means approximately.

Even one minute of listening had produced orders from 177 different restaurant contexts. To rule out an unusually busy minute or internal test traffic, the capture was extended to five minutes:

Text
8,288 messages4,114 unique (tenant, restaurant) combinations~4,000 unique OrderIds11 countries409 drivers

Same structure, bigger numbers: 8,288 messages, 4,114 distinct restaurant contexts, roughly 4,000 order numbers, 11 countries and 409 drivers. At that point the question changed from whether the broker was broken to how broken it was.

Running longer captures

Short captures can mislead, so the researcher ran much longer ones. A 60-minute passive capture contained:

Text
147,817 messages23,929 unique (tenant, restaurant) combinations~23,000 unique OrderIds12 countries3,777 unique drivers

In one hour: nearly 148,000 messages, 23,929 distinct restaurant contexts, roughly 23,000 order numbers, 12 countries and 3,777 distinct drivers. A separate 90-minute capture during other testing contained:

Text
22,905 messages2,631 unique (tenant, restaurant) combinations2,625 unique OrderIds11 countries200 drivers

That second capture is smaller despite running longer, which is a useful reminder that these numbers depend on time of day and how busy production traffic happens to be. The exact figures are not the point. The point is that the observation was consistent: this was not one restaurant accidentally seeing one other restaurant. The subscription exposed activity across a large shared production environment.

What was actually in the messages

This is where care matters most. It would be easy, and wrong, to write that the messaging bus contained everyone's personal information. It did not.

About 147,000 payloads were scanned. A payload is the actual content of one message, the body of the envelope. The researcher specifically searched for several categories of customer PII and found none of them. PII stands for personally identifiable information, data that points at a specific person: no customer phone numbers, no customer email addresses, no customer delivery addresses, no customer GPS coordinates, no payment information and no authentication tokens. So this was not a situation where someone's home address was flying through the messaging service.

The actual exposed information was different, and still problematic. Only eight recurring event types appeared across the large capture:

Text
orderchangestatedriverassigneddriveratrestaurantestimatedrestaurantinfoupdatedeventrestaurantmenuupdatedeventstartfoodprepeposfailedtosendtokitchenHolidaySurvey

These are eight event names run together by the page formatting. Read them as a list:

  • orderchangestate: an event type observed in the capture.
  • driverassigned: an event type observed in the capture.
  • driveratrestaurant: an event type observed in the capture.
  • estimated: an event type observed in the capture.
  • restaurantinfoupdatedevent: an event type observed in the capture.
  • restaurantmenuupdatedevent: an event type observed in the capture.
  • startfoodprep: an event type observed in the capture.
  • eposfailedtosendtokitchen: an event type observed in the capture.
  • HolidaySurvey: an event type observed in the capture.

An event is simply a notification that something happened. Most traffic was order-state events. Driver-related events carried fields such as:

Text
DriverNameDriverIdEstimatedArrivalTime

Three field names, again run together: DriverName, the driver's name; DriverId, an identifier for the driver; and EstimatedArrivalTime, when the order is expected to arrive. Other events exposed tenant, restaurant and order identifiers.

One correction from the researcher's initial notes matters, and it is a good example of why logs beat memory. An eposfailedtosendtokitchen event did not contain order-item details. It contained identifiers only:

Text
TenantRestaurantIdOrderId

That is Tenant, RestaurantId and OrderId: which organisation, which restaurant, which order. No food, no prices. The logs were re-checked specifically because an earlier interpretation had suggested additional order information. The logs disagreed, and the logs win.

The inventory from the 60-minute capture:

Field Observation Impact
DriverName 3,777 unique values Driver identification
DriverId ~99.9% empty Very limited standalone value
EstimatedArrivalTime Present on driver events Real-time activity tracking
Tenant Present throughout the stream Tenant enumeration
RestaurantId Present throughout the stream Restaurant identification
OrderId Present in relevant events Chain key
LegacyOrderId Present in ~34% of messages Cross-system correlation

Read the table as a stocktake. DriverName appeared with 3,777 distinct values, which identifies drivers. DriverId was empty in roughly 99.9% of messages, so it was of very little use on its own. EstimatedArrivalTime appeared on driver events, which allows tracking of activity in real time. Tenant and RestaurantId appeared throughout, which lets someone enumerate which organisations and restaurants exist. OrderId appeared in the relevant events and is described as the chain key, because it is the piece that unlocks the second vulnerability. LegacyOrderId appeared in about 34% of messages and allows correlation with older systems. Enumeration here means building a list of things that exist, one by one.

There were also 50,658 distinct LegacyOrderId values in the 60-minute capture: short numeric identifiers that link newer order identifiers to legacy systems. The interesting part is not that a single identifier existed. It is that the identifiers were exposed across tenant boundaries, meaning one restaurant could see identifiers belonging to others.

The traffic was not limited to one local market: 12 countries appeared during the longest capture, several consistently across captures, with one market appearing more isolated. The country-to-tenant mapping and production identifiers are deliberately not published, because they are unnecessary to understand the vulnerability. The point is that the MQTT namespace was shared across multiple geographic markets and the wildcard subscription exposed cross-market traffic. A namespace is simply the collection of all topic names in use; sharing it across markets is what made one subscription reach so far.

But driver names alone are not the whole story

At this stage the researcher had a clear cross-tenant authorisation issue: one restaurant could read other restaurants' events. But if the impact were only some restaurant events and driver names, the severity discussion would be much more limited. Serious, yes, but bounded.

Then he remembered another endpoint from earlier testing. This is where the story gets significantly worse.

The second vulnerability: an order lookup with no lock

During earlier testing the researcher had identified an order-items API with functionality conceptually similar to:

Text
GET /applications/assistantapi/v1/order-item?orderId={OrderId}

This is a URL, the address of one endpoint. GET is the type of request that means "give me something"; it should never change data. The path /applications/assistantapi/v1/order-item names the service and the version. The ?orderId={OrderId} part is a query string: a parameter passed to the endpoint, where {OrderId} is a placeholder for a real order number. In plain words: "give me the item details for this order number".

The endpoint did not require authentication when accessed from the server side. Authentication means proving who you are, usually with a token. "From the server side" means the request was made directly by a program rather than through the browser page, which is how an attacker would do it. On its own, an unauthenticated order lookup is interesting, but it needs valid order numbers. Where do you get them?

The answer was sitting in the MQTT stream. Everywhere.

Chaining the two: from message to order contents

The MQTT stream continuously exposed fresh alphanumeric OrderIds belonging to restaurants outside the authenticated account's scope. Alphanumeric means a mix of letters and numbers, as opposed to the purely numeric legacy identifiers. Fresh matters: these were live order numbers for orders happening now, not old ones.

A small number of freshly observed identifiers were tested against the order-items endpoint. Validation was deliberately kept small: no thousands of orders, no database, no bulk download of what the broker would hand over. A handful of fresh identifiers was enough to prove the chain:

Text
8 / 8 alphanumeric OrderIds→ HTTP 200

This reads as: eight order numbers were tried, all eight succeeded. HTTP 200 is the standard web status code for "OK, here is your data". Every other common code tells a different story: 404 means not found, 401 means you are not logged in, 403 means you are logged in but not allowed. A 200 here means the lookup service answered with real content, for orders belonging to other restaurants, without asking who was calling.

The responses contained actual order information, including fields such as:

Text
itemsitem namesunit pricesoptions/sub-itemstotal priceorder number

Again a list run together: items, the things ordered; item names; unit prices, the price of one of each; options/sub-items, choices and extras; total price; and order number. A sanitised example:

Text
{  "items": [    {      "name": "[REDACTED]",      "unitPrice": 12.90,      "subItems": [...]    }  ],  "totalPrice": "[REDACTED]",  "OrderNumber": "[REDACTED]"}

This is JSON again. The outer braces hold an object with three keys. items is a list, shown by the square brackets, and each entry in that list is itself an object with a name, a unitPrice of 12.90 and a subItems list, abbreviated with [...] because the contents were removed. totalPrice and OrderNumber follow. The [REDACTED] markers show where real values were stripped out before publication. All real production identifiers and values were removed from the write-up.

Checking whether the legacy numbers work too

The short numeric LegacyOrderId values were also tried against the same endpoint. They did not resolve:

Text
404 No order found

404 is the status code for "not found", and the message says it plainly: no order with that number. Only the alphanumeric OrderIds obtained from the MQTT stream resolved. That distinction matters: the stream was not leaking irrelevant identifiers, it was leaking exactly the identifier format the second vulnerability needs. If the stream had only carried legacy numbers, the chain would have broken at this step.

The complete chain:

Text
Cross-tenant MQTT access        ↓Live OrderId disclosure        ↓Unauthenticated order lookup        ↓Live order contents

Read it top to bottom as a sequence of four steps. First, cross-tenant MQTT access: one restaurant listens to other tenants' messages. Second, live OrderId disclosure: those messages contain current order numbers. Third, unauthenticated order lookup: a service returns order details to anyone holding a number. Fourth, live order contents: the actual items, prices and totals come back. Each step feeds the next, which is why the whole is worse than any single part.

Or, in the shortest version:

Text
MQTT = feederAPI = data

Three words joined by equals signs: the messaging service acts as a feeder that supplies order numbers, the API turns those numbers into data, and the result is the data itself.

Root cause: who are you versus what may you read

The legitimate application needs only a handful of MQTT topics. The broker nevertheless accepted #, partners/+# and +/+ for a normal authenticated partner account. Authentication worked: the system knew the identity and restaurant context of the user, and the IoT configuration response even carried RestaurantId and Tenant. What was missing was enforcement of that context when evaluating wildcard topic access.

In multi-tenant terms, the first question, who are you, was answered. The second question, what are you allowed to read, was effectively absent at the MQTT wildcard boundary. A useful comparison is a hotel receptionist who checks your name at the door and then hands you a master key because you asked politely. The identity check passed; the permission check never happened.

The second issue compounds it: the order-items endpoint accepted OrderIds without authentication when accessed from the server side, so an identifier that should only name an order also functioned as the credential for reading it. An order number should be a label, not a password. Publishing being blocked does not help either, because a read-only firehose is still a firehose: being unable to shout into the channel does not stop you hearing everything on it.

Impact: what an attacker could actually do

A holder of any valid low-privilege restaurant account could passively subscribe to the shared production event bus and receive live events for unrelated tenants: order-state changes, driver names and estimated arrival times, tenant and restaurant identifiers, and fresh alphanumeric OrderIds, across 12 countries in the longest capture. Those OrderIds could then be fed to the unauthenticated order-items endpoint to retrieve live order contents, including item names, unit prices, options and sub-items, total price and order number. Eight out of eight fresh identifiers returned HTTP 200.

The write-up is careful about the limits: no customer phone numbers, email addresses, delivery addresses, GPS coordinates, payment information or authentication tokens were found in the scanned payloads, and DriverId was empty in roughly 99.9% of messages. The exposed data is order and operational metadata plus, through the second issue, order contents. The researcher validated with a handful of orders rather than bulk retrieval, and removed production hostnames, tenant names, restaurant identifiers, real OrderIds, driver names, internal project identifiers, authentication material, raw production logs and country-to-tenant mappings from the public account.

That restraint is worth pausing on. There is a line between proving a vulnerability and collecting everything you can reach, and the researcher stayed on the proof side: a few fresh examples, not thousands of orders.

Fix: what should change

The write-up does not describe a remediation or say what the vendor changed. What it argues should be enforced is topic-level authorisation at the broker: a restaurant account should see its restaurant, not 23,929 restaurant contexts, and a live-order dashboard should receive the events it needs rather than the entire MQTT namespace. The write-up argues that a restaurant account should see only its restaurant and that an OrderId should identify an order rather than act as the password for reading it.

Variants to test: where else this pattern might appear

If you want to look for similar problems yourself, these are the angles the write-up suggests. Only test systems you are authorised to test.

  1. Wildcard subscriptions on any MQTT-backed dashboard. Connect with the lowest-privilege account you can create and try #, +/+, partners/+# and tenant-scoped prefixes. A positive result is SUBACK 0x00 followed by messages carrying tenant or restaurant identifiers that do not belong to your account.
  2. IoT configuration endpoints. Look for frontend bundles and source maps referencing IoT or MQTT configuration, and check whether the returned authentication context includes tenant or restaurant fields.
  3. Identifier-to-data endpoints without authentication. Take identifiers observed in one channel, such as an event stream, logs or notifications, and replay them against lookup APIs from the server side. A positive result is HTTP 200 with object contents for identifiers you do not own.
  4. Identifier format mismatches. Test both the modern and legacy identifier formats against the same endpoint, as the researcher did with LegacyOrderId. A positive result is one format resolving where the other returns 404, which tells you which channel feeds the exploitable path.
  5. Cross-market scope. If the namespace is shared across regions, check whether a single account's wildcard reaches tenants in other countries. A positive result is events from markets your account has no relationship with.
  6. Publish versus subscribe asymmetry. Confirm whether publishing is blocked while subscribing is not.

Closing

The funny part is that there was nothing particularly exotic here. No zero-day, meaning no previously unknown flaw in widely used software. No RCE, short for remote code execution, where an attacker runs their own commands on someone else's machine. No fancy cryptography attack, no kernel exploit. It was basically:

Text
Find MQTT   ↓Try #   ↓SUBACK 0x00   ↓Wait...   ↓Why am I receiving everyone else

Five steps: find the messaging service, try the wildcard, get an acceptance, wait, and wonder why other people's messages keep arriving. Sometimes the vulnerability is not hidden behind an elaborate exploit chain. Sometimes it is sitting in a policy file quietly saying:

Text
Allow: *

A policy file is a list of rules the system follows, and Allow: * means "allow everything". A restaurant account should see its restaurant, not 23,929 restaurant contexts. A live-order dashboard should receive the events it needs, not the entire MQTT namespace. And an OrderId should identify an order; it should not be the password for reading it.

From the original on medium.com

He went looking for an interesting API endpoint and accidentally found the world's least useful restaurant reservation system: he could see everyone's orders. Then it was back to the JavaScript, hoping the next 25 MB would just be fonts.

Glossary

  • API: a defined way for one piece of software to ask another for data or actions, like a menu you order from.
  • Authentication: proving who you are, usually with a token or password.
  • Authorisation: deciding what an authenticated user is allowed to see or do.
  • Broker: the central server in a messaging system that receives messages and forwards them to subscribers.
  • Client: a program that connects to a broker to publish or subscribe.
  • Cross-tenant: reaching data that belongs to a different organisation than your own.
  • Endpoint: one specific URL in an API that performs one job.
  • Enumeration: building a list of things that exist, one by one, such as tenants or restaurants.
  • Event: a notification that something happened, such as an order changing stage.
  • Frontend: the part of a website that runs in your browser.
  • Header: a small label attached to a web request, carrying extra information such as what the caller accepts or who they claim to be.
  • HTTP 200: the standard web status code meaning the request succeeded and data follows.
  • HTTP 404: the standard web status code meaning the requested thing was not found.
  • IoT: Internet of Things, the broad category of connected devices and services.
  • JavaScript: the programming language that runs in web browsers and makes pages interactive.
  • JSON: a text format for structured data, using braces for objects and square brackets for lists.
  • LegacyOrderId: an older, purely numeric order identifier used by previous systems.
  • MQTT: a lightweight messaging protocol where clients subscribe to named topics on a broker.
  • Multi-tenant: one system serving many separate customer organisations while keeping their data apart.
  • Namespace: the full collection of topic names in use on a broker.
  • OrderId: the identifier of a single order.
  • Payload: the actual content of a message, the body inside the envelope.
  • PII: personally identifiable information, data that points at a specific person.
  • Publish: sending a message to a topic on a broker.
  • QoS: Quality of Service, a setting controlling how hard the broker tries to deliver a message; qos=0 is the lightest.
  • Query string: the part of a URL after the question mark, carrying parameters such as an order number.
  • RCE: remote code execution, running your own commands on someone else's machine.
  • Reconnaissance: gathering information about a target before testing it, such as reading its JavaScript.
  • Source map: a file that maps minified JavaScript back to readable original code.
  • SUBACK: the broker's acknowledgement of a subscription request; 0x00 means success.
  • Subscribe: asking a broker to send you messages from a topic.
  • Tenant: one customer organisation inside a shared system.
  • Token: a piece of text proving your identity, issued after you log in.
  • Topic: a named channel on a broker that messages are published to and subscribed from.
  • Wildcard: a symbol matching many names at once; # matches every level and + matches one level.
  • Zero-day: a previously unknown flaw in widely used software.

More by Mohammed Ashraf

View all

1 more disclosed report, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.