安全研究員 Alvin Ferdiansyah 發現 Google Gemini Live API 嘅 ephemeral token 系統喺 token minting 時漏咗 live connect constraints 欄位,黑客取得 token 後就可以 hijack 瀏覽器 AI 語音會話,任意設定模型同工具。 如果漏洞屬實,黑客可以透過注入惡意工具定義達到 sandboxed 代碼執行、濫用 victim 嘅 API quota、篡改 system prompt,甚至可以不斷申請新 token 來循環攻擊。

Create a landscape editorial hero image for this Studio Global article: Search & fact-check with cited sources for What is the Gemini Live API flaw discovered by Alvin Ferdiansyah, how does it allow attackers to. Article summary: ## The Vulnerability. Topic tags: general, documentation, general web, user generated. Style: premium digital editorial illustration, source-backed research mood, clean composition, high detail, modern web publication hero. Use reference image context only for broad subject, composition, and topical grounding; do not copy the exact image. Avoid: logos, brand marks, copyrighted characters, real person likenesses, fake screenshots, UI text, readable text, watermarks, charts with fake numbers, clickbait thumbnails, icons, and tiny thumbnail layouts. Make it useful as an illustrative visual, not as factual evidence.
2026年6月尾,安全研究員 Alvin Ferdiansyah 公開咗一篇詳細分析,指出 Google Gemini Live API 嘅 ephemeral token 系統存在一個嚴重嘅配置漏洞。如果呢個漏洞屬實,黑客只要拎到一個短命嘅 WebSocket token,就可以 hijack 瀏覽器入面嘅 AI 語音會話——控制模型、system prompt,甚至係會話可以用嘅工具 。
漏洞嘅核心係 token minting 嗰陣漏咗一個安全欄位。以下係我哋知道嘅嘢、仲未確認嘅部分,以及開發者可以點樣即刻保護自己嘅部署。
Gemini Live API 支援瀏覽器直接連接到伺服器嘅 WebSocket 連接,用嘅係 ephemeral tokens——呢啲係短命嘅認證令牌,好快就過期,仲可以限制佢嘅用途 。呢啲 token 由後端伺服器 mint 出嚟,然後交俾客戶端,客戶端就可以用佢直接連接 Gemini API,唔使暴露底層嘅 API key。
Google 文件解釋,ephemeral tokens 係專為注重安全嘅客戶端到伺服器實作而設計,因為就算 token 喺瀏覽器俾人抽取出嚟,佢嘅短命特性都限制咗破壞力 。呢啲受限連接嘅端點係
BidiGenerateContentConstrained,佢接受 ephemeral token 作為 access_token 查詢參數 。
live_connect_constraints 欄位根據 Ferdiansyah 嘅文章,Google 嘅參考實作喺 token minting 時 冇用到 live_connect_constraints 欄位 。呢個欄位應該包含一個
bidi_generate_content_setup 物件,將 token 綁定到指定嘅模型、system instruction 同工具集。
當 live_connect_constraints 係空或者冇嘅時候,就冇任何限制被執行。黑客只要拎到呢個 ephemeral token,就可以發送一個 由客戶端控制嘅 setup frame,指定任何模型、system prompt 同工具。伺服器因為冇 token 綁定嘅值做驗證,就會接受黑客嘅配置。
重要提示: 提供嘅來源並冇包括 Google 官方關於
live_connect_constraints嘅文件、CVE 或者 Google 安全公告。呢個講法係根據 Ferdiansyah 嘅 Medium 文章,未經官方證實,但好可能係真嘅。
如果呢個漏洞係真嘅,對於任何喺瀏覽器環境用 Gemini Live API 嘅應用程式嚟講,後果都相當嚴重:
Google AI 論壇嘅開發者都報告過 ephemeral tokens 忽略 system instructions 同埋喺 constrained 端點上失效嘅問題,反映成個生態系統仲喺發展階段 。
Ferdiansyah 提出嘅修復方法好直接:喺 token minting 時候補返 live_connect_constraints.bidi_generate_content_setup
model — 要用嘅確切 Gemini 模型(例如 models/gemini-2.5-flash-native-audio-latest)。system_instruction — 預期嘅 system prompt,結構係 parts 入面包含 text。tools — 一個空陣列 [] 或者只係允許嘅工具,防止客戶端注入。以下係 Ferdiansyah 文章入面嘅示範 Python 代碼 :
token = gemini_client.auth_tokens.create({
"uses": 1,
"expire_time": now + timedelta(seconds=60),
"new_session_expire_time": now + timedelta(seconds=60),
"live_connect_constraints": {
"bidi_generate_content_setup": {
"model": "models/gemini-2.5-flash-native-audio-latest",
"system_instruction": {
"parts": [{"text": "你係一個客戶支援助理..."}]
},
"tools": []
}
}
})注意: 因為
live_connect_constraints喺提供嘅 Google API 官方參考文件度冇記載,呢個例子係根據 Ferdiansyah 自己嘅描述,應該喺用到生產環境前先測試一下。
以下關鍵點喺提供嘅來源入面都未經證實:
live_connect_constraints 嘅存在或者結構。BidiGenerateContentConstrained 端點喺收到冇限制 token 時嘅確切行為,喺提供嘅官方參考文件度冇記載 喺 Google 發布官方公告之前,最安全嘅做法係當呢個漏洞好大機會係真嘅,主動修復:
live_connect_constraints 或者類似嘅欄位。newSessionExpireTime 設為大約 60 秒,限制 token 被盜用嘅時間窗 Gemini Live API 係一個好強大嘅工具,用嚟建立即時語音同影片體驗。一個喺 token minting 過程入面漏咗嘅欄位唔應該削弱佢嘅能力——但開發者一定要確保自己嘅實作係完整嘅。
呢篇文章係根據 27 個提供嘅來源做事實核查,包括 Google 官方文件、社群論壇討論同研究員嘅原文。研究員嘅關鍵講法未能喺官方來源得到獨立證實。
Studio Global AI
Use this topic as a starting point for a fresh source-backed answer, then compare citations before you share it.
安全研究員 Alvin Ferdiansyah 發現 Google Gemini Live API 嘅 ephemeral token 系統喺 token minting 時漏咗 live connect constraints 欄位,黑客取得 token 後就可以 hijack 瀏覽器 AI 語音會話,任意設定模型同工具。
安全研究員 Alvin Ferdiansyah 發現 Google Gemini Live API 嘅 ephemeral token 系統喺 token minting 時漏咗 live connect constraints 欄位,黑客取得 token 後就可以 hijack 瀏覽器 AI 語音會話,任意設定模型同工具。 如果漏洞屬實,黑客可以透過注入惡意工具定義達到 sandboxed 代碼執行、濫用 victim 嘅 API quota、篡改 system prompt,甚至可以不斷申請新 token 來循環攻擊。
解決方法好簡單:喺 token minting 時補返 live connect constraints.bidi generate content setup 欄位,指定 model、system instruction 同 tools(可以留空)。但官方文件同 CVE 都未有,開發者應該當佢係真嘅漏洞即刻修復。