Have You Ever Opened Google Drive and Found Someone Else’s Files?
An API endpoint that returned project members exposed Google Drive OAuth refresh tokens, client secrets and Firebase tokens for any project ID, and sequential numeric IDs allowed enumeration of about 5,000 projects. An attacker could use the leaked refresh tokens to obtain access tokens and read, upload and delete files in victims' Google Drives.
Published on medium.com
Pure panic. Someone has full read/write access to your Drive.
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 project members endpoint lacked an authorization check and returned sensitive credential fields, while projects used sequential numeric identifiers that could be enumerated.
Impact
An attacker could obtain persistent Google Drive access for thousands of users, enabling file listing, upload and deletion, and potentially leading to full employee compromise through Gmail, Docs and Calendar.
What the attacker needed
A free account; ability to intercept HTTP requests; no special permissions needed
The fix
The endpoint was patched after disclosure; it should enforce an authorization check, strip sensitive fields from responses and use UUIDs instead of sequential IDs.
How it was found
- Create a test account and a dummy project, then intercept requests when refreshing the projects page.
- Find the request to the project members endpoint containing the project ID.
- Change the project ID to another number and observe that the request still returns 200 OK.
- Repeat with many different numbers to confirm that every ID returns data.
- Inspect the response and find Google Drive refresh tokens, client secrets and Firebase tokens.
- Use a leaked refresh token to obtain a fresh access token and list files in the linked Google Drive.
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 into a website with Google, the site receives a special key called a refresh token that lets it keep accessing your Google Drive without asking you again. This company's server sent those keys back to anyone who asked for a project's member list, and because project numbers were simple counting numbers, anyone could ask for every project. With a stolen key, a person could open, change or delete files in someone else's Drive.
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.