Skip to main content
Back
ExposureGoogle Cloud
5 min read

Public Google API keys that also open the Gemini API

Owner
Owners of Google Cloud projects with a public API key and the Generative Language API enabled; Truffle Security counted 2,863 live keys
When
Not stated; keys captured in the Nov 2025 Common CrawlDisclosed Feb 25, 2026
Entry
A Google API key published in page source for Maps or Firebase authenticates to the Gemini API as well, once the Generative Language API is enabled on the same project and the key is not restricted to specific APIs.

Google Cloud API keys placed in public pages for Maps or Firebase authenticate to the Gemini API as well, once the Generative Language API is enabled on the same project and the key is not restricted to specific APIs. Truffle Security found 2,863 live keys of this kind in the November 2025 Common Crawl, reported the issue to Google on November 21, 2025 and published on February 25, 2026. Google reportedly restricted the exposed keys from Gemini, with no date given, and no source says anyone other than the researchers used a key.

What was exposed

External Parties
Truffle Security
Common Crawl
Internet
Gemini APIaccepts the project key
Google Cloud Project
Public Pages · Client Code
Project API Key
Gemini Files + Quota
Pages With the Key

Replaying the Google API key and Gemini exposure

  1. 1

    Configured: a public key and a new API

    Not stated; one key public since at least Feb 2023

    Project owners publish API keys in page source for Maps or Firebase, and enabling the Generative Language API makes the same keys Gemini credentials, with no notice. The date for any key is not stated.

  2. 2

    Reachable from the internet

    While a key was public and unrestricted; period not stated

    Anyone with a key copied from page source can call the Gemini API of its project and, per the research, read files and cached content. Charges and quota use are possible; no source says anyone did either.

  3. 3

    Found and closed

    Nov 21, 2025 – Feb 27, 2026

    Truffle Security finds 2,863 live keys in a public web archive and reports the issue to Google; Google reportedly restricts the exposed keys from Gemini, with no date given. Whether anyone else used a key is not stated.

Impact

Live Google API keys in public pages could call the Gemini API of their projects, with a read path to files and cached content and a path to charges and quota use. Truffle Security counted 2,863 live keys in the November 2025 Common Crawl, held by organizations that included financial institutions, security companies, recruiting firms and Google. No source says anyone other than the researchers called Gemini with a public key, read data or ran up charges, and the period of exposure is not stated.

Outcome

Where cloud-provider controls fit

An API restriction on each key, listing only the APIs the page calls, would have kept the Gemini API from accepting a key copied from page source, and a Google Cloud custom Organization Policy constraint that denies unrestricted keys would have kept new unrestricted keys from being created. For projects that do not use Gemini, the gcp.restrictServiceUsage constraint restricts runtime access to the service, and Google's documentation does not say whether it evaluates a call that carries only an API key. A quota override would have bounded the usage for a project that does use Gemini. Publishing the key in page source is the documented use of a Maps or Firebase key and sits in your web code, and whether anyone other than the researchers used a key is not stated.

Could this have been prevented?

In hindsight, not as a whole. 2 controls would have refused a step outright, and 5 controls would have limited one. 3 steps have no cloud-provider control. The counts below are control assessments, not attack stages: several can address the same step. The same replay with the controls in place before the incident shows where each phase would have been refused or bounded.

2
Prevented
5
Contained
3
Not covered

How it could have been prevented

The same replay with the controls in place. Green marks where a step is refused, blue where it is bounded, and red where no control reaches it. Open a row to read the control, why it acts, and its caveat.

External Parties
Truffle Security
Common Crawl
Internet
Gemini APIaccepts the project key
Google Cloud Project
Public Pages · Client Code
Project API Key
Gemini Files + Quota
Pages With the Key

Replaying the Google API key and Gemini exposure

1 · Configured: a public key and a new API

1 Prevented2 Contained1 Not covered

2 · Reachable from the internet

1 Prevented3 Contained6 on other clouds

3 · Found and closed

2 Not covered

Key facts

  • Enabling the Generative Language API on a project let its existing keys call Gemini endpoints with no warning, confirmation or notice; new keys defaulted to Unrestricted, valid for every enabled API, and the console showed a warning
  • Truffle Security scanned the November 2025 Common Crawl archive, about 700 TiB of public pages, and found 2,863 live keys with Gemini access; the figure counts keys, not organizations
  • A Google-owned key returned a 200 response from the /models endpoint; the research says a key holder could read data from the /files/ and /cachedContents/ endpoints, run up Gemini charges and exhaust quotas, and no source says anyone did
  • One Google-owned key was public since at least February 2023, before the Gemini API existed, per the Internet Archive as Truffle Security cites it
  • Truffle Security reported the issue on November 21, 2025; Google first judged the behavior intended on November 25, reclassified it as a bug on December 2 and classified it as a single-service privilege escalation (read), Tier 1, on January 13, 2026
  • The 90-day disclosure window ended on February 19, 2026 with the root-cause fix still in progress; CSO Online says Google reportedly restricted the 2,863 exposed keys from Gemini, with no date given

Sources

Every fact in this breakdown comes from the public reporting below. The replay is a model of that reporting, not a reconstruction of the environment it describes.

  1. 1.
    Google API Keys Weren't Secrets. But then Gemini Changed the Rules.Truffle Security · Feb 25, 2026 · ResearchMechanism, default key restriction, scan method and counts, disclosure timeline, attacker capabilities, mitigations
  2. 2.
    Previously harmless Google API keys now expose Gemini AI dataBleepingComputer · Feb 26, 2026 · NewsGoogle's statement, Google's measures, key count, Quokka mobile app scan
  3. 3.
    'Silent' Google API key change exposed Gemini AI dataCSO Online · Feb 27, 2026 · NewsGemini API timing as relayed, Google's reported restriction of the exposed keys
  4. 4.
    Google Cloud API keys documentation (authentication)Google Cloud · undated · Vendor reportAPI restrictions, application restrictions, unrestricted keys, related Organization Policy constraints
  5. 5.
    Using Gemini API keysGoogle AI Studio · undated · Vendor reportUnrestricted key handling, authorization keys, leaked key enforcement

The estate in the replay is illustrative and drawn at the level of the exposure; the owner's real environment is not public. Verdicts describe what a control does when it is in place before the data is exposed. They are not an assessment of the owner's security program.

More cloud attack breakdowns

All breakdowns