Skip to content

What does 'PERMISSION_DENIED: Permission denied' (Realtime Database) mean?

Short answer

Your Realtime Database Security Rules didn't grant .read or .write at that path for this user. Add rules scoped to auth.uid for the path. Don't set the root to ".read": true, ".write": true.

Last updated 2026-11-25 · Reviewed by ProofForge

The exact error

text
FIREBASE WARNING: set at /users/abc failed: permission_denied
Error: PERMISSION_DENIED: Permission denied

Why it happens

  • Default locked rules (false) or expired test-mode rules.
  • The user isn't signed in yet when the read or write starts.
  • The rule is on a different path than the one the code writes to.

How to fix it

  1. Start from locked rules, then open only the per-user path:
json
{
  "rules": {
    ".read": false,
    ".write": false,
    "users": {
      "$uid": {
        ".read": "auth != null && auth.uid === $uid",
        ".write": "auth != null && auth.uid === $uid"
      }
    }
  }
}

Check it's fixed

In the Rules Playground, simulate a read of /users/<your uid> as yourself (allowed) and as unauthenticated (denied).

Check your live app

A free, read-only public-surface scan. It cannot diagnose private sessions or every cause described above.

Read-only. No writes or row contents.

FAQ

Rules cascade?

Yes. In Realtime Database, a .read/.write grant at a parent path grants all children, so never grant at the root.

Is auth != null enough?

No. It lets every signed-up user read everyone's data. Compare auth.uid to the path.

Does ProofForge read my data?

No. The scan only checks whether a signed-out visitor gets access, without downloading rows.

Sources

Related

Read as Markdown · Scan methodology