Friday, April 17, 2026

Google API Keys Leak Sensitive Data Without Warning via Gemini

Security researchers at Truffle Security discovered that legacy public-facing Google API keys can silently gain unauthorized access to Google’s sensitive Gemini AI endpoints.

This flaw exposes private files, cached data, and billable AI usage to attackers without any warning or notification to developers.

The vulnerability highlights the severe danger of retrofitting modern AI capabilities onto older cloud security architectures.

Leak Sensitive Data

For over a decade, Google explicitly instructed developers to embed API keys directly into client-side code for public services like Google Maps.

These keys were designed primarily as project identifiers for billing and were considered completely safe to share publicly.

thousands of API keys that were deployed as benign billing tokens are now live Gemini credentials sitting on the public internet.  ( Source: Truffle Security)
thousands of API keys that were deployed as benign billing tokens are now live Gemini credentials sitting on the public internet. ( Source: Truffle Security)

However, when a developer enables the Generative Language API on an existing project, any previously deployed public keys are silently upgraded into highly sensitive credentials.​

This issue stems from insecure defaults and improper privilege assignment within the Google Cloud Platform.

Researchers at Truffle Security said that when a new API key is created, its default architectural state is set to “unrestricted,” making it automatically valid for every enabled API within that project.

Because Google relies on a single key format for both public identification and authentication, there is a dangerous lack of separation between publishable and secret environments.​

Exploiting this privilege escalation flaw is remarkably simple for malicious actors who scrape public code repositories.

Example Google API key in front-end source code used for Google Maps, but also can access Gemini ( Source: Truffle Security)
Example Google API key in front-end source code used for Google Maps, but also can access Gemini ( Source: Truffle Security)

An attacker merely needs to copy an exposed key from a public website and send a direct request to the Gemini platform to gain authorized access.

From there, they can steal private datasets, view cached project contexts, and execute expensive AI queries that could rack up thousands of dollars in usage fees.​

Privilege Escalation Impact

The transition from legacy identifiers to sensitive credentials creates a massive attack surface spanning thousands of vulnerable websites.

Google's Own Keys (Source: trufflesecurity)
Google’s Own Keys (Source: trufflesecurity)

The table below highlights the critical differences between how these keys were originally designed and how they function when Gemini is enabled.​

FeatureLegacy Public API KeysUpgraded Gemini Keys
Primary PurposePublic project identification and billing â€‹.Sensitive authentication and data access â€‹.
Deployment LocationClient-side HTML and JavaScript â€‹.Secure backend environments â€‹.
Exposure RiskLow risk; harmless if public â€‹.High risk; exposes private AI data â€‹.
Default ConfigurationUnrestricted access across projects â€‹.Unrestricted, requiring manual scoping â€‹.

Google is addressing this crisis by defaulting new keys in AI Studio to Gemini-only access and proactively blocking known leaked credentials.

Organizations must immediately check all projects for the Generative Language API and audit their dashboard for unrestricted keys.

Security teams should immediately rotate any public-facing keys with Gemini access and use code scanners to detect exposed credentials.​

Follow us on Google NewsLinkedIn, and X to Get Instant Updates and Set GBH as a Preferred Source in Google.

​

Divya
Divya
Divya is a Senior Journalist at GBhackers covering Cyber Attacks, Threats, Breaches, Vulnerabilities and other happenings in the cyber world.

Hot this week

How To Access Dark Web Anonymously and know its Secretive and Mysterious Activities

What is Deep Web The deep web, invisible web, or...

How to Build and Run a Security Operations Center (SOC Guide) – 2023

Today’s Cyber security operations center (CSOC) should have everything...

Network Penetration Testing Checklist – 2025

Network penetration testing is a cybersecurity practice that simulates...

Russian Hackers Bypass EDR to Deliver a Weaponized TeamViewer Component

TeamViewer's popularity and remote access capabilities make it an...

Web Server Penetration Testing Checklist – 2026

Web server pentesting is performed under three significant categories: identity,...

TP-Link Routers Hit by Mirai in CVE-2023-33538 Attacks

Hackers are actively scanning for vulnerable TP-Link home routers...

SEO Poisoning Attack Uses Microsoft Binary to Install RMM Tool

New research has exposed a search engine poisoning campaign...

Operation PowerOFF Knocks Out 75,000 DDoS Attackers and Over 50 Service Domains

A major international law enforcement campaign has hit the...

Industrial Systems Hit by New Email-Worm Threat Wave

Email-borne worms are driving a fresh wave of incidents...

OpenAI Extends GPT-5.4-Cyber Access to Trusted Organizations Worldwide

OpenAI has announced the expansion of its "Trusted Access...

Microsoft Acknowledges Reboot Loop Issue on Windows Servers Following April Patches

Microsoft has confirmed a critical known issue affecting Windows...

Fake Zoom SDK Update Spreads Sapphire Sleet Malware in New macOS Attack Chain

A sophisticated macOS-focused cyber campaign orchestrated by the North...

PoC Released for FortiSandbox Flaw Enabling Arbitrary Command Execution

A proof-of-concept (PoC) exploit has been publicly released for...

Related Articles

Recent News