数千个公开的 Google Cloud API 密钥在启用 API 后通过 Gemini 访问被泄露

发布: (2026年2月28日 GMT+8 17:56)
8 分钟阅读

Source: The Hacker News

Google Cloud API 密钥可以用于 Gemini 认证

Gemini 图像

新的研究发现,Google Cloud API 密钥——通常用作计费的项目标识符——可以被滥用来对敏感的 Gemini 端点进行身份验证并访问私人数据。

该发现来自 Truffle Security,他们在客户端代码中发现了近 3,000 个以 AIza 为前缀的 Google API 密钥,这些密钥用于提供嵌入式地图等 Google 相关服务。

“只要拥有有效的密钥,攻击者就可以访问已上传的文件、缓存数据,并将 LLM 使用费用计入你的账户,”安全研究员 Joe Leon 说,并补充道这些密钥“现在也可以用于 Gemini,尽管它们从未被设计用于此。”
Truffle Security 博客

问题产生的方式

当用户在 Google Cloud 项目中启用 Gemini API(生成式语言 API)时,就会出现此问题。启用后,项目中所有现有的 API 密钥——包括那些在网站 JavaScript 中暴露的密钥——都会在不发出任何警告的情况下获得对 Gemini 端点的隐蔽访问权限。

Gartner 图示

这实际上使得任何抓取网站并收集这些 API 密钥的攻击者都可以将其用于恶意目的和配额盗窃,包括:

  • 通过 /files/cachedContents 端点访问敏感文件。
  • 发起 Gemini API 调用,为受害者产生巨额账单。

Truffle Security 还发现,在 Google Cloud 中创建新 API 密钥默认是“无限制”的,这意味着它适用于项目中启用的所有 API,包括 Gemini。

“结果是:成千上万的 API 密钥本来是作为无害的计费令牌部署的,如今却成为了公开互联网上的 Gemini 活跃凭证。”
—Joe Leon

该公司共报告了 2,863 个可在公共互联网上访问的活跃密钥,其中包括一个与 Google 关联的网站

相关发现

此披露恰逢 Quokka 发布了类似报告,在对 250,000 个 Android 应用的扫描中发现了超过 35,000 个唯一的 Google API 密钥。

“除了通过自动化 LLM 请求可能导致的费用滥用外,组织还必须考虑 AI 启用的端点如何与提示、生成内容或连接的云服务交互,从而扩大受损密钥的冲击范围。”
Quokka 博客

API 密钥泄露示意图

“即使没有直接访问客户数据的权限,密钥的组合也可能导致更大的安全风险……”

of inference access, quota consumption, and possible integration with broader Google Cloud resources creates a risk profile that is materially different from the original billing‑identifier model developers relied upon.”

Google’s Response

Although the behavior was initially deemed intended, Google has since stepped in to address the problem.

“We are aware of this report and have worked with the researchers to address the issue,” a Google spokesperson told The Hacker News via email. “Protecting our users’ data and infrastructure is our top priority. We have already implemented proactive measures to detect and block leaked API keys that attempt to access the Gemini API.”

It is currently unknown whether the issue has been exploited in the wild. However, a recent Reddit post claimed a “stolen” Google Cloud API key resulted in $82,314.44 in charges between Feb 11‑12 2026, up from a regular spend of $180 per month.

We have reached out to Google for further comment and will update the story if we hear back.


推理访问、配额消耗以及可能与更广泛的 Google Cloud 资源集成的风险,使其风险概况与开发者原本依赖的计费标识模型有实质性差异。

Google 的回应

虽然最初认为该行为是有意的,但 Google 随后已介入解决此问题。

“我们已知晓此报告,并已与研究人员合作解决该问题,”一位 Google 发言人在通过电子邮件向 The Hacker News 透露。“保护用户的数据和基础设施是我们的首要任务。我们已经实施了主动措施,以检测并阻止尝试访问 Gemini API 的泄漏 API 密钥。”

目前尚不清楚该问题是否已在野外被利用。然而,最近的 Reddit post 声称,一把“被盗”的 Google Cloud API 密钥在 2026 年 2 月 11‑12 日期间产生了 $82,314.44 的费用,远高于每月约 $180 的常规支出。

我们已联系 Google 以获取进一步评论,若有回复将更新报道。

对 Google Cloud 用户的建议

  1. 审计您的 API 和服务 – 核实是否启用了任何与 AI 相关的 API(例如 Gemini/Generative Language)。
  2. 检查是否公开暴露 – 确保 API 密钥未出现在客户端 JavaScript 中或提交到公共代码库。
  3. 轮换已暴露的密钥先从最旧的密钥开始,因为这些密钥最有可能在旧的“API 密钥安全共享”指南下被公开部署。
  4. 应用限制 – 创建新密钥时,明确将其限制在所需的 API 上,并设置合适的引用来源或 IP 限制。

“这是一个很好的例子,说明风险是动态的,API 事后可能被过度授权。” – Truffle Security。

Tim Erlin,Wallarm 的安全策略师,补充道:

“安全测试、漏洞扫描以及其他评估必须是持续进行的。”

“API 尤其棘手,因为它们的操作或可访问的数据的变化不一定是漏洞,但会直接提升风险。AI 在这些 API 上运行并被使用,只会加速问题的出现。仅仅发现漏洞对 API 来说并不够。组织必须对行为和数据访问进行画像,识别异常并主动阻止恶意活动。”

保持更新

觉得这篇文章有趣吗?关注我们:

0 浏览
Back to Blog

相关文章

阅读更多 »

关于Moltbook

概述 MIT Technology Review 有一篇关于 Moltbook——所谓的仅 AI 社交网络——的好文章。许多人指出,很多病毒式的 co…