Built a side project called OneDollarChat - a global chat where every message costs $1. Posted it on Reddit, got some traction, went to bed.

Woke up to find a user with a balance of $21,474,836.47. That's INT_MAX. On Christmas morning.

What happened:

My Supabase RLS policy said "users can update their own row." Sounds safe, right?

Except "their own row" included the balance column. So they just... updated it.

-- What I had (bad) CREATE POLICY "Users can update own row" ON users FOR UPDATE USING (auth.uid() = id); -- What I needed (good) CREATE POLICY "Users can update own profile" ON users FOR UPDATE USING (auth.uid() = id) WITH CHECK ( -- o...

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help