惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

雷峰网
雷峰网
博客园 - 聂微东
酷 壳 – CoolShell
酷 壳 – CoolShell
宝玉的分享
宝玉的分享
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
罗磊的独立博客
Hugging Face - Blog
Hugging Face - Blog
T
Tailwind CSS Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
IT之家
IT之家
博客园_首页
博客园 - 三生石上(FineUI控件)
博客园 - 叶小钗
Apple Machine Learning Research
Apple Machine Learning Research
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
量子位
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
人人都是产品经理
人人都是产品经理
美团技术团队
小众软件
小众软件
Jina AI
Jina AI
S
SegmentFault 最新的问题
博客园 - Franky
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
I had real backend auth. The browser just walked around it.
Vadym Arnaut · 2026-06-18 · via DEV Community
Cover image for I had real backend auth. The browser just walked around it.

Vadym Arnaut

Here's the thing nobody warns you about when you put Supabase behind a "real" backend.

My stack is React + FastAPI + Supabase Postgres. Every write goes through FastAPI. Every endpoint checks the user, the role, the ownership. I audited that backend HARD — rate limits, JWT validation, RLS, the whole thing. I was proud of it.

And none of it mattered for the two holes I actually shipped.

Because the Supabase anon key lives in the browser. It HAS to — that's how supabase-js talks to your project. Which means every logged-in user is holding a key that talks to Postgres directly. Not through my FastAPI. Around it.

That anon key is a SECOND API. And I'd spent months hardening the first one while the second one sat there, wide open, the whole time.

Hole #1 — the answers were just... readable

Quiz questions live in quiz_options, one is_correct boolean per option. My backend never sends is_correct to a student before they submit. Obviously.

But the browser doesn't have to ask my backend.

// any logged-in student, straight from the console:
const { data } = await supabase
  .from('quiz_options')
  .select('question_id, label, is_correct')   // <- the answer key. all of it.

The RLS policy said "authenticated users can read quiz_options." Totally true for the rows. It just also handed back the column that decides the grade. The answer key. To anyone with a login and ten seconds of curiosity.

Fix: column-level REVOKE SELECT from the client role, and let the backend be the only thing that ever reads is_correct. (PR #775.)

Hole #2 — they could WRITE things they shouldn't

Same class of bug, bigger blast radius. The default Postgres grants let the client role insert/update far more than I'd realized — including a path toward forging a certificate. Nobody did it. But "nobody did it yet" is not a security model!

So I stopped patching table by table and flipped the whole thing:

-- kill the client's entire write surface, then grant back the ONE thing it needs
ALTER DEFAULT PRIVILEGES IN SCHEMA public
  REVOKE INSERT, UPDATE, DELETE ON TABLES FROM authenticated;
GRANT UPDATE (/* your own profile fields */) ON public.profiles TO authenticated;

After that migration the browser can write exactly one thing: your own profile. EVERYTHING else goes through FastAPI, where the real checks live. (PR #794.)

The lesson I wish I'd had on day one

If your anon key ships to the browser — and with supabase-js, it does — then your RLS grants ARE your API. Not "a backend detail." The actual, public, internet-facing contract.

So audit them like it. Read every GRANT. For every table, ask one question: if a logged-in user typed this select (or insert) in their console, what comes back, and what changes? Default the client to read-almost-nothing, write-nothing — and earn each grant back on purpose.

Your backend auth can be flawless and still be theater, if the front door right next to it is unlocked.


Equip is open source under MIT: github.com/ArVaViT/equip. Both fixes are in main — PR #775 (the answer-key leak) and PR #794 (the write-surface lockdown).

What's the worst RLS grant you've ever found in your own project? I genuinely want to hear it.

GitHub logo ArVaViT / equip

Free, open-source LMS for Bible schools, ministries, and nonprofit educational programs. React + FastAPI + Supabase.

Equip logo

Equip

A free, open-source learning management system built for Bible schools church ministries, and nonprofit educational programs

MIT License Backend CI Frontend CI Good first issues Code coverage OpenSSF Scorecard

Live demo · Roadmap · Contributing · Support · Changelog


Screenshots


Equip login page — two-column layout with scripture on the left and a clean sign-in form on the right

Sign in (light)


Equip login page in dark mode

Sign in (dark)


Equip account creation with a Student or Teacher role chooser

Account creation — student / teacher role picker


Equip sign-in on a 390px mobile viewport

Mobile (390px)

Live at equipbible.com. Teacher and admin views (gradebook, course editor, analytics) are behind sign-in — create a free account to explore.


Why this project?

Hundreds of small Bible schools, home churches, and missionary training programs around the world still manage courses on paper, WhatsApp, or spreadsheets. Commercial LMS platforms are expensive, overkill, or require technical expertise that volunteer-run organizations simply don't have.

Equip is designed to change that:

  • Free forever — MIT-licensed, no paywalls, no "premium" tiers.
  • Simple to deploy — one-click Vercel deploy with a free Supabase database. No Docker, no servers to manage.
  • Built for small scale — optimized for 20-100 students, not…