Firebase rules "if true": how to find open Firestore and Storage rules and fix them
Firebase and Firebase Studio apps often ship with Firestore or Realtime Database rules that let anyone read and write. It happens because the quick-start rules work, so nobody changes them. The rule to look for In Firestore, allow read, write: if true; means any visitor can read and write that collection. In Realtime Database, ".read": true and ".write": true at the root do the same. Test mode…
The article discusses the importance of securing Firebase Firestore and Storage rules to prevent unauthorized access to data. By default, these rules allow anyone to read and write data, which can pose a security risk. The article provides a step-by-step guide on how to check for open rules using the Firebase console's Rules tab and the Rules Playground.
It also suggests a best practice of tying access to signed-in user rules for Firestore and storing an `ownerId` on documents for Storage. For Cloud Storage, the rules should be set to allow read and write only if the user is authenticated and matches the expected user. The article also mentions a free tool, ProofForge, which can scan for exposed Firebase signals in public apps.
Brief written by urgent.news; may contain errors — check the original.
Source: dev.to