IDOR allowing to read another user's token on the Social Media Ads service
The Social Media Ads service used MongoDB ObjectIds as identifiers for tokens, and these IDs were predictable because of their timestamp, per-process random value and incrementing counter. An attacker could brute force IDs to access another user's social media access token.
- Triaged in 3 days
- Fixed in 2 months
- Paid in 4 days
- Disclosed after 7 months
Summary by the program
The hotfix was released asap. The investigation showed that there were no cases of vulnerability exploitation.
Summary by the researcher
Social Media Ads is a tool for dedicated paid social specialists working with ads. The tool needs to interact with the user's social network account. To do this, Semrush collects a token to access and modify the advertising data of the social media account. There was a possible ability to brute force ids due to weak id generation by MongoDB. As a result, it was possible to access another user's token. MongoDB Object Ids have the following pattern:
- а 4-byte timestamp, representing the ObjectId's creation, measured in seconds since the Unix epoch.
- а 5-byte random value generated once per process. This random value is unique to the machine and process.
- а 3-byte incrementing counter, initialized to a random value.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The application used MongoDB ObjectIds, which are partly predictable, as identifiers for sensitive token records.
Impact
An attacker could access another user's social media token and thereby read or modify that user's advertising data; the text says a hotfix was released quickly and no exploitation was found.
What the attacker needed
Knowledge of MongoDB ObjectId structure
The fix
The issue was fixed with a hotfix, though the text does not describe the technical change.
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 report has not been written yet. The Original tab links to the source.
The IDs were not truly random: part was a timestamp, part was fixed per process, and part counted up. Because of that, someone could guess other people's IDs and access their token.
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.