Firebase
Security FAQ

How to do a security audit of a Firebase app?

Get instant answers about your app's security.

Short Answer

A Firebase security audit is not a generic checklist — it's a targeted probe of the failure modes specific to Firebase's stack (Firebase (Firestore + Security Rules) as the database). The audit order: fingerprint the deployment, test Firestore Security Rules, scan bundles for secrets, probe auth endpoints, then verify remediation with a second pass.

Detailed Answer

Why a Firebase-specific audit (not a generic web audit)

A generic OWASP audit will tell you your Firebase app "needs CSP headers." A Firebase-aware audit tells you that your specific Firebase app has an RPC function callable without auth or a service key in a client bundle — the issues that actually appear when Firebase apps get compromised. The difference in output value is why the audit should be scoped to Firebase's real failure modes.

Step 1 — Fingerprint the deployment

Confirm the Firebase stack components: database (firebase), hosting, auth provider, third-party integrations. For Firebase apps this is often visible in the Firebase endpoint URL in network requests. Document every component — each is an independent audit target.

Step 2 — Automated scan with Firebase-aware rules

Run VAS against the deployed URL. The scan probes the specific issue classes found in Firebase apps: security rules, credential exposure, auth configuration, security headers. This is the 80/20 — most critical and high findings surface here. Fix anything critical before continuing to manual steps.

Step 3 — Manual Firestore Security Rules review

Open the Firebase Console → Firestore → Rules. Every match path needs explicit `allow read/write: if request.auth.uid == resource.data.userId` (or similar ownership check). Storage rules require the same. Use the Firebase Emulator to test: a `firebase emulators:exec` with a write attempt as an anonymous user must fail.

Step 4 — Authentication & authorization probing

Test every endpoint with no session (expect 401), with a valid session for a different user (expect 403 on user-owned resources), and with session tokens that have been tampered with (expect 401 if signatures are enforced). For Firebase specifically, watch for auth without authorization — rules check if user is logged in but not if they own the data.

Step 5 — Re-scan to verify

Fix findings in severity order (critical → high → medium → low), re-scan after each batch of fixes. "I applied the fix" is not evidence — the fix might not have been deployed, might have been partial, or might have been reverted. Only the scan output proves the gap is closed. Log each finding + fix + verification scan for compliance records.

Firebase-specific checks often missed

  • Test Mode Rules in Production (fix: Replace test rules immediately)
  • Auth Without Authorization (fix: Add request)
  • Admin SDK Credential Exposure (fix: Admin SDK is server-only)
  • Storage Rules Misconfiguration (fix: Write storage)

Security Research & Statistics

10.3%

of Lovable applications (170 out of 1,645) had exposed user data in the CVE-2025-48757 incident

Source: CVE-2025-48757 security advisory

91%

of data breaches involve databases with misconfigured access controls

Source: Verizon Data Breach Investigations Report

4.45 million USD

average cost of a data breach in 2023

Source: IBM Cost of a Data Breach Report 2023

Expert Perspectives

Vibe coding your way to a production codebase is clearly risky. Most of the work we do as software engineers involves evolving existing systems, where the quality and understandability of the underlying code is crucial.

Simon WillisonSecurity Researcher, Django Co-creator

The problem with AI-generated code isn't that it doesn't work - it's that it works just well enough to ship, but contains subtle security flaws that are hard to spot.

Security Research CommunityCollective wisdom from security researchers

Check Your Firebase App's Security

VAS scans for all the security issues mentioned above. Get a comprehensive security report in minutes.

Get Starter Scan

More Questions About This Topic

How often should I audit a Firebase app?

Audit triggers for Firebase apps: before every production release, after any AI-assisted refactor that touches auth or data, after adding a new Firebase table, after any dependency update that affects auth/session handling, and on a rolling weekly basis for live apps. Full manual re-audit every quarter. The faster feature velocity on Firebase makes scan frequency more important than on traditionally-built apps.

What tools do I need to audit a Firebase app?

Core: VAS (automated scan), browser DevTools (bundle inspection), Firebase Console + Firebase Emulator Suite for rule testing. Optional depth: Burp Suite for auth flow tampering, OWASP ZAP for injection probing. For a first audit, VAS + manual Firestore Security Rules review covers ~90% of findings.

How much does a Firebase app security audit cost?

Self-serve with VAS: minutes of your time, no per-scan cost for the core findings. External pentest of a Firebase app: typically $5,000–$20,000 given the stack is well-understood and scope is bounded. The cost-effective path for most Firebase apps is VAS → fix findings → re-scan → then budget external testing only if you have specific compliance requirements or high-value data.