In February 2026, a researcher claimed to have accessed 300 million private chat messages from over 25 million users of a single AI app. Nobody cracked anything: the database was left open. It was not a one-off either. When the same researcher scanned iOS apps for the same flaw, 103 of the 200 they checked had it. If you build on Firebase, this article is about the locks that matter, and the one that is now mandatory for AI features.Why this keeps happening.Recent Firebase leaks were open doors, not clever hacks, and the pattern keeps repeating through 2026.Chat & Ask AI, February. A researcher claimed to have accessed 300 million messages from over 25 million users through an exposed database. The cause was a well-known Firebase misconfiguration: Security Rules left public, so anyone with the project URL could read, change, or delete data. The developer reportedly fixed it within hours of disclosure.The wider scan. The same researcher built a scanner and reported that 103 of the 200 iOS apps they checked had the same flaw.MyPhoto, August. A threat actor alleged that a publicly readable Firebase Realtime Database exposed customer orders and production records. BreachNews had not verified the claim, and the company had made no public statement at the time.None of these needed an exploit. A setting was wrong, and attackers only had to ask. AI apps raise the stakes, because chat histories are some of the most sensitive data an app can hold.Where App Check fits.App Check is your second lock, not your first. Security Rules decide who may read what, and every leak above was a rules problem. But with App Check enforced, a request from a script rather than your app has no valid token and is rejected. That makes scripted, app-less probing much harder. It will not rescue a badly written rule, because a genuine copy of your app can still obtain a token. Fix the rules first, then add App Check on top.A two-minute check before you ship.Search your rules for if true (Firestore and Storage) and ".read": true(Realtime Database).Confirm every collection requires sign-in and checks the user against the data they touch.Turn on App Check in monitoring mode, then enforce once the numbers look clean.The problem Authentication doesn’t solve.Firebase Authentication and Security Rules answer one question: is this user allowed to touch this data? They say nothing about the client making the call.Two abuse paths stay open even with perfect rules:A real user with a script. Someone with a legitimate account calls your endpoints repeatedly from their own code, scraping data or burning through your quota.A stranger with your public config. Someone extracts your API key and project ID from the app and hits any resource your rules leave open to unauthenticated access.App Check targets exactly these cases. It lets your backend accept only requests that come from your genuine, untampered app.How App Check works.The flow has three steps:Attestation. The app asks a platform attestation provider to prove that it is the real app, running on a real device.Token exchange. If the proof checks out, Firebase issues a short-lived App Check token.Verification. The SDK attaches the token to each request, and the backend service checks it. When enforcement is on, requests without a valid token are rejected.One consequence is worth planning for: a device that cannot obtain a token cannot reach the protected service at all. A provider outage or a configuration mistake can therefore look like a full app outage.What it protects.App Check covers the core Firebase backend products, including Cloud Firestore, Realtime Database, Cloud Storage, Cloud Functions, and Firebase AI Logic. Support for some products, such as Firebase Authentication, is still in preview, so check the current docs for the exact list before you rely on it. You can also verify App Check tokens in your own backend, which is useful if you run custom endpoints besides Firebase.Rolling it out safely: Monitor first, enforce second.The hard part of App Check is not the integration. It is the decision to switch on enforcement.Adding the SDK does not block anything. The Firebase console just starts showing the share of verified versus unverified requests. Use that view before you enforce:Leave it in monitoring mode for days or weeks.Work out who the unverified traffic belongs to. Is it your own users still on an old app version, or outsiders imitating your app?Enforce one product at a time, not everything at once.If you skip this and enforce immediately, you will lock out every user who has not updated yet.Setting it up on iOSOn Apple platforms, the production provider is App Attest, with DeviceCheck as an older alternative. For local development in the simulator, use the debug provider. A common pattern is a provider factory that chooses by environment:import FirebaseCore import FirebaseAppCheck class AppCheckFactory: NSObject, AppCheckProviderFactory { func createProvider(with app: FirebaseApp) -> AppCheckProvider? { #if targetEnvironment(simulator) return AppCheckDebugProvider(app: app) #else return AppAttestProvider(app: app) #endif } }// Set the factory before configuring Firebase AppCheck.setAppCheckProviderFactory(AppCheckFactory()) FirebaseApp.configure() When the debug provider runs, it prints a debug token in the Xcode console. Register that token in the Firebase console under Security, then App Check, then Apps, then Manage debug tokens. Treat debug tokens like secrets and never commit them to a public repository.The new requirement for Firebase AI LogicApp Check has moved from a good idea to a requirement in one important case. If you call the Gemini API directly from a mobile or web app through Firebase AI Logic, enforcement is now mandatory. The Firebase docs say that starting November 2, 2026, App Check enforcement is required to use Firebase AI Logic. Since early July 2026, the console’s guided setup has enforced it automatically for new setups.The reasoning is simple. A model endpoint that any client can call is an invitation to abuse, and the bill lands on you. App Check, together with limited-use tokens, keeps that endpoint tied to your real app.Replay protectionApp Check tokens are short-lived, but within that window a stolen token could be reused. Replay protection makes tokens single-use. It adds a little overhead and is not needed everywhere, but it is worth turning on for expensive or sensitive calls such as AI requests.Common pitfallsTreating it as a replacement for Authentication. It verifies the app, not the user. You need both.Enforcing too early. Check the verified versus unverified ratio first.Leaking debug tokens. A leaked debug token lets anyone pass as your app.No fallback thinking. Because no token means no access, test what your app does when attestation fails, and watch provider quotas as your user base grows.Web limits. For web apps, check the documented limits on domains and keep localhost out of production reCAPTCHA keys.ConclusionApp Check is a small amount of setup for a large reduction in abuse risk. Authentication protects your users’ data from other users. App Check protects your backend from software that was never your app. If your project calls Firebase services directly from the client, and especially if it calls Gemini through AI Logic, it belongs in your security baseline.SourcesMalwarebytes: AI chat app leak exposes 300 million messages tied to 25 million users (February 9, 2026)BreachNews: MyPhoto allegedly exposed customer order data through misconfigured Firebase (August 7, 2026)Firebase AI Logic: App Check documentation
The 2026 Firebase Leaks Weren’t Hacks: They Were Open Doors
Full Article
Original Source
Read the full article at Hackernoon →KhanList aggregates and links to publicly available news content. We do not host full articles from third-party sources. Always verify important information with original sources.