Skip to content
IDOR Write-up Intermediate

READING The JavaScript Gave Me a Cross-Tenant Write + SSRF

An Edge Function that zipped submission files fetched any URL supplied by the client and wrote the resulting archive to a storage path derived from a client-supplied submission ID, using the service role that bypasses Row-Level Security. An authenticated user could therefore write attacker-controlled files into any workspace's storage bucket and make the server fetch arbitrary external URLs.

medium.com

Published on medium.com

A multi-tenant, Supabase-backed SaaS had a “zip my submission files” Edge Function that (1) fetched any URL I handed it (SSRF) and (2) wrote the resulting archive into any workspace’s storage folder — because it trusted a client-supplied path and wrote with the service role, bypassing the Row-Level Security (RLS) that…

httpzuz, 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

The Edge Function trusted client-supplied values for both the URLs to fetch and the destination path, and ran with the service role that bypasses Row-Level Security, so it never checked that the submission ID belonged to a workspace the caller was a member of.

Impact

Any authenticated user could write or overwrite arbitrary attacker-controlled files in any tenant's storage bucket, potentially poisoning content served back to that workspace's users, and could make the server fetch arbitrary external URLs; internal addresses and cloud metadata were not reachable from the locked-down runtime.

What the attacker needed

A free account; access to the frontend JavaScript bundle; knowledge of a victim workspace ID

How it was found

  1. Pull the frontend JavaScript bundle and search it for calls to the Supabase client to list tables, RPCs and Edge Functions.
  2. Read the in-app API docs and the invoke call to learn the request body fields, including the file URLs and the submission ID.
  3. Send a request with an external URL as the file URL, download the returned zip and confirm it contains that page's content.
  4. Send a request with a submission ID belonging to a different workspace and observe a success response with the file written under that workspace's path.
  5. From the same session, confirm the app reports no membership in the victim workspace and that a direct upload is denied by Row-Level Security, while the function still writes there.

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 web app let users ask a server-side helper to download files from links and bundle them into a zip. The helper did not check that the links or the destination folder belonged to the user asking, and it ran with extra database privileges that skip the normal per-user access rules. So any logged-in user could make the server fetch a page of their choice and drop the result into another customer's storage area.

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.

Similar reports

View all

Same bug class and techniques, clearest first.

Insecure direct object reference (IDOR)

The lesson behind this report.

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.