Findings
F1High
A creator can point their own episode at another creator's paid video
What could happen
Any approved creator could watch, and re-publish as free, every paid video on the platform without buying it.
Evidence
The update rule on video_assets checks only that the episode belongs to the caller. It does not restrict which columns change, so r2_object_key is writable from the browser. Object keys follow a fixed pattern built from the uploader's user id and the episode id, and both ids are publicly readable. The playback route then signs whatever key is stored.
CREATE POLICY "video_assets_update" ON public.video_assets FOR UPDATE
USING (
EXISTS (SELECT 1 FROM public.episodes e
JOIN public.stories s ON s.id = e.story_id
WHERE e.id = video_assets.episode_id AND s.creator_id = auth.uid())
AND public.is_approved_creator()
);
-- object key written by the server: videos/<user id>/story/<episode id>/master.mp4
Fix
Remove browser write access to video_assets altogether. The upload routes already write this table with the service role, so the insert and update rules are not needed. As a second layer, have the playback route refuse any key that does not start with the episode owner's own prefix.
DROP POLICY "video_assets_insert" ON public.video_assets;
DROP POLICY "video_assets_update" ON public.video_assets;
Fixed price to fix: $90
F2High
A leftover rule lets a creator request a payout larger than their balance
What could happen
A creator could file a payout request for any amount, to any account details, with no matching ledger entry. An admin working through the payout queue could pay it.
Evidence
A later migration added a request_payout function that locks, checks the balance and writes the ledger. The app uses it. But the original insert rule on payouts was never dropped, so the same table still accepts a direct insert from the browser that skips every one of those checks.
CREATE POLICY "payouts_insert" ON public.payouts FOR INSERT
WITH CHECK (creator_id = auth.uid() AND status = 'requested'
AND public.is_approved_creator());
Fix
Drop the rule. The function runs with its own rights and does not need it.
DROP POLICY "payouts_insert" ON public.payouts;
Fixed price to fix: $40
F3Medium
Pressing Buy again on an episode you own resets the purchase
What could happen
A buyer who already paid loses access, and a second payment cannot complete. They pay twice and stay locked out.
Evidence
The purchase route upserts on (buyer, episode) and always writes status 'pending', including over a row that is already 'completed'. When the second payment arrives, the ledger insert hits the unique index on (purchase_id, entry_type), fails, and the route rolls the purchase back to pending.
await supabaseAdmin.from('purchases').upsert({
buyer_id: user.id, episode_id: episode.id, /* ... */ status: 'pending',
}, { onConflict: 'buyer_id,episode_id' })
Fix
Look the purchase up first. If it is completed, return it and stop. Only create or refresh rows that are pending, failed or cancelled.
Fixed price to fix: $70
F4Medium
Row owners can change fields that belong to moderators and the platform
What could happen
An author can un-hide a comment a moderator hid. A creator can mark their own story as featured and set its view count to any number.
Evidence
The update rules on comments and stories check who owns the row and nothing else. is_hidden, is_featured and view_count are ordinary columns under those rules. The profiles and creator_profiles tables already solve this correctly with a trigger that restores protected fields for non-admins; these two tables were missed.
CREATE POLICY "comments_update" ON public.comments FOR UPDATE
USING (user_id = auth.uid() OR public.is_admin());
Fix
Add the same kind of trigger used on profiles: for non-admins, copy is_hidden, is_featured and view_count back from the old row before the update is saved.
Fixed price to fix: $80
F5Low
The playback route ignores publish status and counts views without limit
What could happen
A free episode that is still a draft, or has been archived, plays for anyone who has its id. Anyone can also inflate an episode's view count by repeating the request.
Evidence
The route reads the episode with the service role, which bypasses the access rules, and then authorises on is_free or authorship only. Status is selected but never checked. Each call inserts a view and adds one to the counter with no sign-in, no rate limit and a read-then-write that loses counts under load.
Fix
Require status 'published' on both the episode and its story unless the caller is the author. Count a view once per signed-in user per episode per day, with an atomic increment.
Fixed price to fix: $60
F6Low
Every profile, including its role, is readable without signing in
What could happen
Anyone can list which accounts are admins, which makes them the obvious targets for phishing. Display names default to the first half of the sign-up email, so those leak too.
Evidence
The select rule on profiles is USING (true), and the sign-up trigger falls back to split_part(email, '@', 1) when no display name is given.
CREATE POLICY "profiles_select" ON public.profiles FOR SELECT USING (true);
Fix
Expose a view with only id, display_name and avatar_url for public cards, and restrict the table itself to the owner and admins. Default the display name to something that is not derived from the email.
Fixed price to fix: $50
F7Low
No security headers, and the image optimiser accepts any host
What could happen
No clickjacking or content-type protection in the browser, and the app's image endpoint can be used to proxy and resize images from anywhere at the owner's cost.
Evidence
next.config.ts sets no headers and allows remote images from hostname '**'.
Fix
Add CSP, X-Content-Type-Options, frame rules and a referrer policy. List the two or three image hosts the app really uses.
Fixed price to fix: included with any other fix
Prices shown are an example of how a report quotes each fix. Yours are set from your own findings.