⌚All Xiaomi watches hacked (Cross Tenant IDOR)
The Xiaomi Mi Fitness API trusted a user_id supplied in a request header instead of deriving it from the authenticated token, so any logged-in user could read, modify or delete another user's profile and health data. Because user IDs were sequential and rate limiting was weak, an attacker could enumerate and harvest data from many accounts.
infosecwriteups.com
Published on infosecwriteups.com
So there I was, late at night, wearing my Xiaomi smartwatch and thinking about how much data these little devices collect about us. Heart rate, sleep patterns, GPS locations, activity levels… everything.
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
Likely the server authenticated the token but never authorised the requested user_id against the identity inside the token, and used sequential user IDs with no rate limiting.
Impact
An attacker with any valid account could read, modify or delete other users' profiles and health data, and could enumerate sequential IDs to harvest data at scale, though the text notes the fix added rate limiting and HTTPS.
What the attacker needed
A valid Xiaomi account; ability to intercept app traffic; certificate pinning bypass; target user ID known or guessed
The fix
The server was fixed to extract the user_id from the verified token and reject requests where it differs from the requested user_id, and HTTPS and rate limiting were added.
How it was found
- Intercept the app's traffic, including unencrypted HTTP requests to the Xiaomi API.
- Bypass certificate pinning with a runtime hook so HTTPS traffic can be inspected.
- Identify the profile update endpoint and its protobuf payload structure.
- Capture a legitimate profile update request with its authentication token and headers.
- Change the user_id header to another user's ID while keeping your own valid token.
- Send the modified request and observe that the other user's profile is updated.
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.
When you log in, the app sends a token that proves who you are. This API also let the app say which user account it wanted to act on, and the server believed that claim without checking it matched the token. So anyone with a normal account could change the number to another person's ID and read or alter their private health data.
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.