HN
Today

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

Google's long-standing advice that API keys weren't secrets was upended by Gemini, as existing public keys silently gained sensitive access to private data and billing functions. This retroactive privilege expansion, affecting thousands of sites (including Google's own), reveals a major security oversight caused by rushed AI integration. The discussion on HN reflects frustration with Google's initial response and debates the implications of such architectural missteps.

81
Score
12
Comments
#1
Highest Rank
18h
on Front Page
First Seen
Feb 26, 4:00 AM
Last Seen
Feb 26, 9:00 PM
Rank Over Time
1121111223236811121010

The Lowdown

Google's decades-long assertion that its API keys (for services like Maps and Firebase) were merely public identifiers, safe to embed client-side, has been fundamentally challenged by the advent of Gemini. Truffle Security discovered that enabling the Generative Language API in a Google Cloud project retroactively grants all existing keys within that project full, sensitive access to Gemini's endpoints, without warning or developer consent. This transforms previously innocuous keys into potent credentials capable of accessing private data and incurring significant billing charges.

  • The Problem: Google used a single API key format for both public identification and sensitive authentication, leading to 'Retroactive Privilege Expansion' where old public keys silently gained sensitive Gemini access. New keys also default to unrestricted access, creating 'Insecure Defaults'.
  • Attack Vector: An attacker can scrape an API key from a public website, and if that key's project has Gemini enabled, use it to access uploaded files, cached content, or exhaust billing quotas on the victim's account.
  • Scale of Issue: A scan of the Common Crawl dataset revealed 2,863 live Google API keys vulnerable to this, including keys on Google's own infrastructure.
  • Disclosure & Response: Truffle Security reported the issue to Google, who initially dismissed it as 'intended behavior.' After providing concrete examples from Google's own sites, Google reclassified it as a bug and committed to remediation, including blocking leaked keys and implementing scoped defaults for new keys.
  • User Action: Developers are advised to check all GCP projects for the Generative Language API, audit existing API keys for unrestricted access or Gemini-specific permissions, and verify that no such keys are publicly exposed. Exposed keys should be rotated immediately.

This incident underscores the complex security challenges that arise when new, sensitive API capabilities are grafted onto existing, legacy authentication systems, highlighting the critical need for distinct credential types and secure-by-default configurations.

The Gossip

Google's Growing Growing Pains

The primary sentiment revolves around Google's architectural decision-making, particularly the retroactive change in API key behavior without clear developer notification. Commenters express frustration that keys previously deemed harmless public identifiers for services like Maps silently gained sensitive access to Gemini, turning a non-secret into a critical vulnerability. The initial dismissal of the report by Google and the potential for remediation to disrupt existing workflows are also sources of concern.

The Conundrum of Credential Classification

Discussion delves into the fundamental nature of API keys and credential management. Many agree that the core problem lies in the blurred lines between public identifiers and sensitive authentication tokens, exacerbated by Google's use of a single key format for both. This architectural choice is seen as inherently problematic, leading to confusion and potential for abuse, even if some forms of API key abuse predate Gemini.

AI Authorship Accusations

A surprising side-discussion emerged regarding the writing style of the blog post itself. Several users speculated it was AI-generated (specifically by ChatGPT) due to its highly structured, clear, and 'actionable' presentation, prompting a brief debate on the evolving patterns in human versus AI-assisted writing.