Loading HuntDB...

CVE-2025-59834

CRITICAL
Published 2025-09-25T13:41:15.676Z
Actions:

Expert Analysis

Professional remediation guidance

Get tailored security recommendations from our analyst team for CVE-2025-59834. We'll provide specific mitigation strategies based on your environment and risk profile.

CVSS Score

V3.1
9.8
/10
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Base Score Metrics
Exploitability: N/A Impact: N/A

Attack Vector Metrics

Attack Vector
NETWORK
Attack Complexity
LOW
Privileges Required
NONE
User Interaction
NONE
Scope
UNCHANGED

Impact Metrics

Confidentiality
HIGH
Integrity
HIGH
Availability
HIGH

Description

ADB MCP Server is a MCP (Model Context Protocol) server for interacting with Android devices through ADB. In versions 0.1.0 and prior, the MCP Server is written in a way that is vulnerable to command injection vulnerability attacks as part of some of its MCP Server tool definition and implementation. This issue has been patched via commit 041729c.

Available Exploits

No exploits available for this CVE.

Related News

No news articles found for this CVE.

Affected Products

EU Vulnerability Database

Monitored by ENISA for EU cybersecurity

EU Coordination

EU Coordinated

Exploitation Status

No Known Exploitation

ENISA Analysis

Malicious code in bioql (PyPI)

Affected Products (ENISA)

srmorete
adb-mcp

ENISA Scoring

CVSS Score (3.1)

9.8
/10
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

EPSS Score

0.350
probability

Data provided by ENISA EU Vulnerability Database. Last updated: October 3, 2025

GitHub Security Advisories

Community-driven vulnerability intelligence from GitHub

✓ GitHub Reviewed CRITICAL

Command Injection in adb-mcp MCP Server

GHSA-54j7-grvr-9xwg

Advisory Details

# Command Injection in adb-mcp MCP Server The MCP Server at https://github.com/srmorete/adb-mcp is written in a way that is vulnerable to command injection vulnerability attacks as part of some of its MCP Server tool definition and implementation. The MCP Server is also published publicly to npm at www.npmjs.com/package/adb-mcp and allows users to install it. ## Vulnerable tool The MCP Server defines the function `executeAdbCommand()` which executes commands via string as a parameter and wraps the promise-based `exec` function. The MCP Server then exposes the tool `inspect_ui` which relies on Node.js child process API `exec` (through the function wrapper) to execute the Android debugging command (`adb`). Relying on `exec` is an unsafe and vulnerable API if concatenated with untrusted user input. Data flows from the tool definition [here](https://github.com/srmorete/adb-mcp/blob/master/src/index.ts#L334-L343) which takes in `args.device` and calls `execPromise()` in [this definitino](https://github.com/srmorete/adb-mcp/blob/master/src/index.ts#L346-L348C13) that uses `exec` in an insecure way. Vulnerable line of code: [https://github.com/srmorete/adb-mcp/blob/master/src/index.ts#L334-L352](https://github.com/srmorete/adb-mcp/blob/master/src/index.ts#L334-L355) ```js // Add adb UI dump tool server.tool( "inspect_ui", AdbUidumpSchema.shape, async (args: z.infer<typeof AdbUidumpSchema>, _extra: RequestHandlerExtra) => { log(LogLevel.INFO, "Dumping UI hierarchy"); const deviceArg = formatDeviceArg(args.device); const tempFilePath = createTempFilePath("adb-mcp", "window_dump.xml"); const remotePath = args.outputPath || "/sdcard/window_dump.xml"; try { // Dump UI hierarchy on device const dumpCommand = `adb ${deviceArg}shell uiautomator dump ${remotePath}`; await execPromise(dumpCommand); // Pull the UI dump from the device const pullCommand = `adb ${deviceArg}pull ${remotePath} ${tempFilePath}`; await execPromise(pullCommand); // Clean up the remote file await execPromise(`adb ${deviceArg}shell rm ${remotePath}`); ``` The argument to the tool, `AdbDevicesSchema`, is a Zod inferred type defined in the `src/types.ts` file in the project: ```js export const inspectUiInputSchema = { device: z.string().optional().describe("Specific device ID (optional)"), outputPath: z.string().optional().describe("Custom output path on device (default: /sdcard/window_dump.xml)"), asBase64: z.boolean().optional().default(false).describe("Return XML content as base64 (default: false)") }; ``` and exposes `device` as a string which is an open way to trick the LLM into pushing arbitrary strings into it and hence achieve the command injection exploitation. ## Exploitation When LLMs are tricked through prompt injection (and other techniques and attack vectors) to call the tool with input that uses special shell characters such as `; rm -rf /tmp;#` (be careful actually executing this payload) and other payload variations, the full command-line text will be interepted by the shell and result in other commands except of `ps` executing on the host running the MCP Server. Reference example from prior security research on this topic, demonstrating how a similarly vulnerable MCP Server connected to Cursor is abused with prompt injection to bypass the developer's intended command: ![Cursor defined MCP Server vulnerable to command injection](https://res.cloudinary.com/snyk/image/upload/f_auto,w_2560,q_auto/v1747081395/Screenshot_2025-05-07_at_9.22.11_AM_d76kvm.png) ## Impact User initiated and remote command injection on a running MCP Server. ## Recommendation - Don't use `exec`. Use `execFile` instead, which pins the command and provides the arguments as array elements. - If the user input is not a command-line flag, use the `--` notation to terminate command and command-line flag, and indicate that the text after the `--` double dash notation is benign value. ## References and Prior work 1. Command Injection in codehooks-mcp-server MCP Server project https://www.nodejs-security.com/blog/command-injection-vulnerability-codehooks-mcp-server-security-analysis identified as CVE-2025-53100 2. Command Injection in ios-simulator-mcp-server MCP Server project https://www.nodejs-security.com/blog/ios-simulator-mcp-server-command-injection-vulnerability identified as CVE-2025-52573 3. Liran's [Node.js Secure Coding: Defending Against Command Injection Vulnerabilities](https://www.nodejs-security.com/book/command-injection) ## Credit Disclosed by [Liran Tal](https://lirantal.com)

Affected Packages

npm adb-mcp
ECOSYSTEM: ≥0 ≤0.1.0

CVSS Scoring

CVSS Score

9.0

CVSS Vector

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Advisory provided by GitHub Security Advisory Database. Published: September 24, 2025, Modified: September 26, 2025

References

Published: 2025-09-25T13:41:15.676Z
Last Modified: 2025-09-25T14:36:27.801Z
Copied to clipboard!