Back to blog
Firebasetechnicalvulnerabilities

Firebase Firestore: why 'allow read, write: if request.auth != null' is not security

Published on 2026-03-256 min readCleanIssue

> TL;DR: The basic Firestore authentication rule doesn't protect your data. Here's why and how to fix it.

The false sense of security

The rule allow read, write: if request.auth != null is the most common Firestore configuration. It seems secure. In reality, it allows ANY authenticated user to read and modify ALL other users' data.

The fix

Replace with: allow read, write: if request.auth.uid == resource.data.userId

What we find

70% of Firebase applications we audit use this basic rule.

Key Takeaways

  • Identify and test your exposed attack surfaces before a third party does.
  • Client-side security controls never replace server-side validation.
  • Regular audits are more effective than one-time checks — vulnerabilities appear with every deployment.
  • Building software? CleanIssue performs security audits for your product in real-world conditions, no source code access needed. For a first read of your exposure, start with an external review of your application.

    Sources

    Written by CleanIssue
    Reviewed on 2026-03-25

    Editorial analysis based on official vendor, project, and regulator documentation.

    Related services

    If this topic maps to a real risk in your stack, these are the most relevant CleanIssue audits.

    Want to know what your AI agent can do?

    Tell us about your agent, its tools, and client context. We will come back with the right review scope.

    Discuss your audit