How I Found a $250 BOLA in a Government Transport App’s Real-Time API
The real-time GraphQL API of a transport app did not check that a client-supplied trip or user ID belonged to the caller, so any registered user could subscribe to and publish messages on another user's trip chat and inject events into their live feed. The attacker needed only a free account and a victim's trip ID.
Published on medium.com
A smart-mobility mobile app runs its real-time features — trip chat, live driving events, push-notification triggers — on an AWS AppSync GraphQL API using a publish/subscribe model. Every channel is keyed by an ID (a tripId or a userId) that the client passes as an argument.
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.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The API authorised the operation (whether a user may call it) but trusted the client-supplied object ID instead of verifying that the ID belonged to the caller.
Impact
An attacker with a free account and a victim's trip ID could read and inject messages into that trip's chat and push fake events into the victim's live feed, though the chat is real-time only and some injected content was dropped server-side.
What the attacker needed
A free account via the app's sign-in; victim's trip ID or user ID; residential IP (WAF blocks datacenter IPs); app-like User-Agent for WebSocket
The fix
The report says the bug was fixed; the recommended fix is to enforce per-object authorization in every resolver and subscription by binding the client-supplied ID to the caller's identity from the token.
How it was found
- Decompile the mobile app to extract the GraphQL endpoint, real-time endpoint, region, and login configuration.
- Complete the app's federated sign-in to obtain a Cognito JWT.
- Open the real-time WebSocket with the token and subscribe to a trip ID that is not yours; the server accepts it.
- Publish a message to that same trip ID and observe your subscription receive it.
- Send event mutations with arbitrary non-owner user IDs; the server accepts them.
- Call correctly protected operations with the same token and observe 'Not Authorized' responses.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
The app's live features (chat, alerts) use a channel identified by an ID that the app sends. The server accepted any ID without checking if it belonged to the person asking. So anyone with a normal account could join someone else's chat or send fake alerts to them.
What is IDOR?
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.