Google Antigravity IDE browser extension flaw enables arbitrary file write and RCE via SaveScreenRecording path traversal ($10,000 bounty)
Hacktron researcher sudi disclosed a vulnerability in the browser extension bundled with Google's AI IDE Antigravity, which is built on the same internals as Windsurf. The extension's externally_connectable setting allows any web page to send messages to it. The SaveScreenRecording action forwards attacker-controlled filename and L fields to the local language server, which allows path traversal and an arbitrary file write anywhere the user can write. Google paid a $10,000 bounty. The article describes writing to the user's Startup folder as an easy route to code execution at the next reboot. The researcher also describes a bypass of Google's first fix, but the article is truncated before the full details.
Technical Details
- Antigravity runs a Golang language server (
language_server_windows_x64.exe) that validates thex-codeium-csrf-tokenheader to defend against DNS rebinding. The token comes fromcrypto.randomUUID()and is injected only into the extension service worker via Playwright, so the researcher could not leak it. - Agent overlay functions such as
window.updateActuationOverlayare exposed to web pages while the agent is running. They allow spoofing of UI prompts, but nothing more impactful was found. - The extension manifest sets
externally_connectableto<all_urls>, so any website can callchrome.runtime.sendMessage()against the extension. - The
SaveScreenRecordingaction calls the language server endpoint/exa.language_server_pb.LanguageServerService/SaveScreenRecording. The final path isC:\Users\<Username>\.gemini\antigravity\brain\[L]\[filename]. - Traversal sequences in
filename(for example../poc.txt) and inLwrite attacker-controlled content outside the intended directory. The file is written even when the server returns an error. - Google's fix added an
sh()sender check that validates the sender URL contains/static/offscreen.html, that the sender id equalschrome.runtime.id, and that the sender has no tab. - The URL check is bypassable by appending
?/static/offscreen.htmlto an attacker page URL. The researcher notes that thechrome.runtime.idcheck could be bypassed through a content-script message proxy, but Antigravity restricts the allowed actions. The article is cut off while discussing the tab check.
Remediation
- Update Antigravity and its browser extension to the latest version.
- Restrict
externally_connectableto explicitly trusted origins. - Validate the sender in the extension rather than relying on
url.includes()checks. - Canonicalize and validate file paths server-side to reject traversal sequences.
Linha do tempo
-
Google Antigravity IDE browser extension flaw enables arbitrary file write and RCE via SaveScreenRecording path traversal ($10,000 bounty)
ler a análise desta fonte ocultar
Hacktron researcher sudi disclosed a vulnerability in the browser extension bundled with Google's AI IDE Antigravity, which is built on the same internals as Windsurf. The extension's
externally_connectablesetting allows any web page to send messages to it. TheSaveScreenRecordingaction forwards attacker-controlledfilenameandLfields to the local language server, which allows path traversal and an arbitrary file write anywhere the user can write. Google paid a $10,000 bounty. The article describes writing to the user's Startup folder as an easy route to code execution at the next reboot. The researcher also describes a bypass of Google's first fix, but the article is truncated before the full details.Technical Details
- Antigravity runs a Golang language server (
language_server_windows_x64.exe) that validates thex-codeium-csrf-tokenheader to defend against DNS rebinding. The token comes fromcrypto.randomUUID()and is injected only into the extension service worker via Playwright, so the researcher could not leak it. - Agent overlay functions such as
window.updateActuationOverlayare exposed to web pages while the agent is running. They allow spoofing of UI prompts, but nothing more impactful was found. - The extension manifest sets
externally_connectableto<all_urls>, so any website can callchrome.runtime.sendMessage()against the extension. - The
SaveScreenRecordingaction calls the language server endpoint/exa.language_server_pb.LanguageServerService/SaveScreenRecording. The final path isC:\Users\<Username>\.gemini\antigravity\brain\[L]\[filename]. - Traversal sequences in
filename(for example../poc.txt) and inLwrite attacker-controlled content outside the intended directory. The file is written even when the server returns an error. - Google's fix added an
sh()sender check that validates the sender URL contains/static/offscreen.html, that the sender id equalschrome.runtime.id, and that the sender has no tab. - The URL check is bypassable by appending
?/static/offscreen.htmlto an attacker page URL. The researcher notes that thechrome.runtime.idcheck could be bypassed through a content-script message proxy, but Antigravity restricts the allowed actions. The article is cut off while discussing the tab check.
Remediation
- Update Antigravity and its browser extension to the latest version.
- Restrict
externally_connectableto explicitly trusted origins. - Validate the sender in the extension rather than relying on
url.includes()checks. - Canonicalize and validate file paths server-side to reject traversal sequences.
- Antigravity runs a Golang language server (