How I Accidentally Became an API Archaeologist (and Found a Data Leak)
A Supabase anonymous key was exposed in the frontend JavaScript, and the backend API allowed unauthenticated read access to the entire user profiles table. An attacker could retrieve emails, usernames, full names, and other profile data for all users.
Published on shrivarshan81.medium.com
Because let’s be honest — Frontend devs sometimes overshare more than your talkative friend at 2AM.
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 missing Row-Level Security (RLS) on the Supabase table, combined with an exposed anonymous key that had full read access.
Impact
An attacker could read all user profile data, including emails, usernames, and full names, without authentication.
What the attacker needed
Access to the public website; no account needed
The fix
The issue was fixed after being responsibly reported; the recommended fix is to enable Row-Level Security and restrict API access.
How it was found
- View the page source and download JavaScript chunks.
- Search the chunks for keywords like supabase and apiKey.
- Extract a Supabase URL and an anonymous JWT key.
- Send an API request to the profiles endpoint with the key.
- Observe that the response contains the entire user table.
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 website's public code contained a key meant for limited use, but the database behind it did not check who was asking. So anyone who found the key could ask the database for all user records and get them back.
What is Access control?
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.