Tech News
← Back to articles

Google API keys weren't secrets, but then Gemini changed the rules

read original related products more articles

tl;dr Google spent over a decade telling developers that Google API keys (like those used in Maps, Firebase, etc.) are not secrets. But that's no longer true: Gemini accepts the same keys to access your private data. We scanned millions of websites and found nearly 3,000 Google API keys, originally deployed for public services like Google Maps, that now also authenticate to Gemini even though they were never intended for it. With a valid key, an attacker can access uploaded files, cached data, and charge LLM-usage to your account. Even Google themselves had old public API keys, which they thought were non-sensitive, that we could use to access Google’s internal Gemini.

The Core Problem

Google Cloud uses a single API key format ( AIza... ) for two fundamentally different purposes: public identification and sensitive authentication.

For years, Google has explicitly told developers that API keys are safe to embed in client-side code. Firebase's own security checklist states that API keys are not secrets.

Note: these are distinctly different from Service Account JSON keys used to power GCP.

Source: https://firebase.google.com/support/guides/security-checklist#api-keys-not-secret

Google's Maps JavaScript documentation instructs developers to paste their key directly into HTML.

Source: https://developers.google.com/maps/documentation/javascript/get-api-key?setupProd=configure#make_request

This makes sense. These keys were designed as project identifiers for billing, and can be further restricted with (bypassable) controls like HTTP referer allow-listing. They were not designed as authentication credentials.

Then Gemini arrived.

... continue reading