Skip to content
Access control Write-up Beginner

I Breached a Hacker’s Platform by Reading Their Source Code

Two Supabase-backed sites lacked proper access control: on the first, anyone could register an account and reach the admin panel; on the second, a JWT token exposed in client-side code allowed reading the full user table, including plain-text passwords and payment records.

medium.com

Published on medium.com

While scrolling through Facebook, a CTF (Capture The Flag) event post by a university cybersec club caught my eye. What really pulled me in?

KonaN, on medium.com

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 server-side role checks on Supabase tables and an exposed service token in client-side code.

Impact

An attacker could view, approve or reject all CTF form submissions and read full user data on the first site, and could read the full user table including plain-text passwords and payment records on the second.

What the attacker needed

Internet access; a free account on the target; victim interaction not required

The fix

The text does not say the issues were fixed; it recommends using environment variables, role-based access control, password hashing and security audits.

How it was found

  1. Submit a dummy form and intercept the request to spot the Supabase endpoint.
  2. Probe common admin paths and find the /admin login panel.
  3. Use the Supabase API documentation to create a new user account.
  4. Log in with the new account and reach the admin panel.
  5. Register on the second service and inspect the Next.js front-end code.
  6. Use the exposed JWT token to query the users endpoint and retrieve the 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.

A backend service called Supabase was used to store form submissions and user accounts. On the first site, the admin panel did not check who was logging in, so creating a normal account gave admin powers. On the second site, a login token was left in the code that browsers download, and that token could read the whole user database.

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.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

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.