Dev.to AI 🤖 Ai 👁 0 📖 1 min read

Firebase rules let anyone write, or test mode is expiring

Firestore in test mode, or rules with allow write: if true, let anyone change or delete your data, and test mode switches everything off on its expiry date. What you see firestore.rules has allow read, write:

Firestore in test mode, or rules with allow write: if true, let anyone change or delete your data, and test mode switches everything off on its expiry date.

What you see

firestore.rules has allow read, write: if true, or the test-mode rule that opens everything until a date.

Why it happens

Test mode is how Firebase starts a project. It's meant to be replaced before launch, and nothing reminds you.

How to fix it

  1. Require a signed-in user, matched to the document: allow write: if request.auth != null && request.auth.uid == userId.
  2. Deploy the rules: firebase deploy --only firestore:rules.

Or ask your AI tool to fix it

Paste this into Lovable, Bolt, v0, Replit or Cursor:

Replace the open Firestore security rules with rules that require a signed-in user and only let each user read and write their own documents. Keep public reads only where data is meant to be public.

The full page, with the request ready to copy, is at launchpad.axonscape.com/fix/firebase-rules-open. I work on Launchpad by Axonscape, which runs a free launch check for apps built with AI tools: it finds this and the other things that break at launch, from a public GitHub repo or a .zip of the code, and keeps nothing.

📰 Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.