Hacking Google Antigravity
The Antigravity browser extension exposed a privileged message handler to any website, allowing arbitrary file writes on the victim's machine. An attacker could write a malicious executable to the Startup folder, leading to code execution on reboot.
hacktron.ai
Published on hacktron.ai
In continuation of our series Hacking AI Browsers, we are back again, this time targeting Google’s Antigravity.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The extension's externally_connectable setting allowed all origins to send messages, and the SaveScreenRecording handler did not validate the sender or sanitise the file path.
Impact
An attacker could write arbitrary files to the victim's PC, potentially achieving code execution by placing an executable in the Startup folder.
What the attacker needed
Victim visits a malicious webpage; Antigravity browser extension installed
The fix
Google added checks in the message handler to validate the sender's origin and tab context, preventing messages from malicious pages.
How it was found
- Host a malicious page that sends a message to the extension with action SaveScreenRecording and a crafted filename containing path traversal.
- The extension forwards the request to the language server's SaveScreenRecording endpoint.
- The language server writes the supplied content to the traversed path, creating an arbitrary file.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
A browser extension can receive messages from web pages if it allows them. Here, the extension accepted a command to save a screen recording to a file path chosen by the sender. Because any website could send that command, a malicious site could write a file anywhere the user had permission, including a startup folder that runs programs automatically.
What is File upload?
An upload feature accepts a file that the server or other users' browsers then treat as code or as something trusted.