Silent Backdoor: How Old Google API Keys Suddenly Became Gateways to Gemini AI Data
Subtitle: API keys once considered harmless are now exposing sensitive AI data - and organizations are scrambling to respond.
It started as a routine internet scan, but what researchers at TruffleSecurity uncovered could change how developers think about Google Cloud security forever. For years, thousands of Google API keys sat quietly in public code, powering maps, videos, and analytics - never considered sensitive, never thought to be dangerous. But with the arrival of Gemini, Google’s generative AI assistant, these keys have transformed from innocuous snippets into potential skeleton keys for private data and costly abuse.
When Google rolled out Gemini, its powerful AI assistant, it inadvertently changed the risk profile of its Cloud API keys. Suddenly, keys that had been embedded in JavaScript for years - sometimes even by Google itself - could be used not just for public-facing services, but to authenticate directly with the Gemini API. TruffleSecurity’s scan of the November 2025 Common Crawl dataset revealed over 2,800 such keys, many tied to major financial institutions, security firms, and recruiting agencies.
In one instance, a key found in the source code of a Google product’s public site had been live since early 2023. Using this key, researchers were able to query Gemini’s available AI models - a function never intended to be public. The implications are twofold: attackers could siphon sensitive AI data, and they could rack up massive usage bills for the victim organization. According to TruffleSecurity, a determined attacker could generate thousands of dollars in charges per day with a single compromised key.
The crux of the issue lies in how Google Cloud API keys, once used only as identifiers for low-risk services, have quietly gained new privileges as the company expanded its AI offerings. Many developers, unaware of this shift, left their keys exposed in client-side code. Google, alerted to the issue in late 2025, acknowledged the risk as a “single-service privilege escalation” and has since implemented new safeguards: leaked keys are now blocked from Gemini access, and new keys are automatically scoped to AI services only.
But the remediation effort is ongoing. Google urges all developers to check if the Generative Language API (Gemini) is enabled for their projects, audit all API keys for potential exposure, and rotate any that are public. Tools like TruffleHog can assist in finding exposed credentials before attackers do.
The lesson is clear: in the rapidly evolving world of cloud and AI, yesterday’s harmless code can become tomorrow’s security disaster. Developers and organizations must remain vigilant, because the keys to the kingdom may be hiding in plain sight.
WIKICROOK
- API Key: An API key is a unique code that lets programs access data or services. If not properly secured, it can pose a cybersecurity risk.
- Client: A client is a device or application that connects to a server to request and use network services, such as browsing websites or accessing email.
- Privilege Escalation: Privilege escalation occurs when an attacker gains higher-level access, moving from a regular user account to administrator privileges on a system or network.
- Common Crawl: Common Crawl is a public dataset of billions of web pages, used in cybersecurity for research, threat detection, and large-scale web analysis.
- Key Rotation: Key rotation is the routine changing of digital keys or passwords to prevent unauthorized access and limit damage if a breach occurs.