Menu

The Firebase security rules checklist for AI-built apps
πŸ“°

The Firebase security rules checklist for AI-built apps

DEV Community: firebaseΒ·Frank GilroyΒ·2 days ago
#8wKa2yXk
#devtofirebase#devto#dev#rules#test
Reading 0:00
15s threshold

Your Firebase web config, apiKey included, is public by design: it ships in your JavaScript and anyone can read it. The only thing between that config and your users' data is your security rules, and AI tools often leave them in test mode or loosen them until the app "works". Here's how to check them in about ten minutes.

1. Find test-mode and allow-all rules

From your project folder:

grep -nE "if true|request.time <|\"\.(read|write)\": *true" firestore.rules storage.rules database.rules.json

Enter fullscreen mode

Exit fullscreen mode

Any hit is an open door. allow read, write: if request.time < timestamp.date(...) is the default test-mode rule: everything is public until that date, and when it passes the app breaks and someone "fixes" it with if true .

2. "Signed in" is not "allowed"

allow read, write: if request.auth != null; lets every user who signs up read and change every other user's documents.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.