Not a leaked API key: 13 foreign projects were attached to our dormant billing account – from ~$7/month to a six-figure bill in 8 days

Hi everyone,

A heads-up for anyone paying for the Gemini API through a Google Cloud billing account.

In June, an attacker used a hijacked admin session to attach thirteen projects from other organizations to our practically dormant billing account (at most ~$7 a month). They ran the Gemini API and GPU Compute Engine on it for about eight days. The Gemini spend cap paused only Gemini, at about $100,000. Compute Engine kept running until we closed the account ourselves.

This was not a leaked API key. The same actor later did the reverse: attached one of our own projects to billing accounts that aren’t ours, enabled the Gemini API on it and created API keys. So other accounts are almost certainly affected too.

Three quick checks:

  • Billing → Account management: do you recognize every project linked to your billing account?

  • Billing account permissions: any principal from outside your own domain?

  • Billing → Cost management → Anomalies: open the list in the console. We had 28 anomalies listed there and not one notification reached us.

The full timeline, the reasons we didn’t see it and the complete checklist are in the main thread on the Google Cloud Community: Not a leaked API key: 13 foreign projects were attached to our dormant billing account – from ~$7/month to a six-figure bill in 8 days - Compute Infrastructure - Google Developer forums

Please reply there, so the discussion stays in one place.

Luděk Svoboda

Hi Ludek, I read your thread about the 13 foreign projects. The detail that stuck with me was that the Gemini cap paused Gemini while Compute kept running.

I built an open-source audit for exactly that: GitHub - jhelbling/billfuse: Spend guard for AI APIs on GCP and AWS: audit, per-minute watch, kill switch · GitHub. billfuse audit gcp lists every project billed to your billing accounts and flags the ones you can’t read as critical, in about 2 minutes and read-only.

Would you have 15 minutes to tell me what would have caught it earlier? Happy to go through the audit on your current setup with you.

Jo

Hi Jo,

we added similar spend monitoring to the billing account. We read current spend and trigger an alert when a spend spike occurs. But the Compute spending data is delayed. Google’s spike alerts did not unfortunately reach us.

Regarding Compute, my understanding is that Google employs tiers that limit the scale of new compute resources—and consequently, the associated spending—that a project can allocate within a short timeframe. Spending is thus controlled by enforcing a gradual increase in allocated resources, rather than through an absolute hard cap (as is the case with the Gemini API). However, external projects linked to our billing account may have already had an existing history, which allowed an attacker to bypass this restriction.

We recently received a recommendation that it is possible to capture an event whenever a project is linked to a billing account by using Cloud Asset Inventory Real-Time Feeds. This cannot be done via audit logs. We intend to implement this.

Luděk