/

CVE-2026-117559

Severity:

HIGH RISK

(7.8)

Command Injection (CWE-78) in DroidMind Android Tools

CVE-2026-117559

Deferred

Vulnerability type

Category:

Command Injection

CWE:

CWE-78

Impact:

Arbitrary Command Execution on Connected Android Devices

Severity:

HIGH RISK

(7.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

DroidMind through version 0.4.0 contains a command injection vulnerability in device-management operations. An MCP client, including a prompt-injected agent, may bypass the shell command allowlist and cause blocked commands to execute on a connected Android device when attacker-controlled parameters reach vulnerable command-handling paths.

DroidMind through version 0.4.0 contains a command injection vulnerability in device-management operations. An MCP client, including a prompt-injected agent, may bypass the shell command allowlist and cause blocked commands to execute on a connected Android device when attacker-controlled parameters reach vulnerable command-handling paths.

Affected context

The vulnerability occurs in DroidMind deployments through 0.4.0 that expose MCP operations for Android device management. It becomes risky when client-controlled values are interpolated into Device.run_shell() or accepted by Device.list_directory() without effective validation and are subsequently interpreted by a shell. The practical impact depends on the connected device's permissions, enabled operations, and deployment trust boundaries.

The vulnerability occurs in DroidMind deployments through 0.4.0 that expose MCP operations for Android device management. It becomes risky when client-controlled values are interpolated into Device.run_shell() or accepted by Device.list_directory() without effective validation and are subsequently interpreted by a shell. The practical impact depends on the connected device's permissions, enabled operations, and deployment trust boundaries.

Exploit preconditions

  • Attack surface: MCP-exposed Android device-management functions
  • Required access: The ability to submit requests or parameters to an MCP client connected to DroidMind
  • Trigger point: Processing parameters through Device.run_shell() or unvalidated Device.list_directory()
  • Why exploitation is possible: Shell metacharacter substitution can be interpreted after the command allowlist check, allowing injected operations to evade intended command restrictions
  • Attack surface: MCP-exposed Android device-management functions
  • Required access: The ability to submit requests or parameters to an MCP client connected to DroidMind
  • Trigger point: Processing parameters through Device.run_shell() or unvalidated Device.list_directory()
  • Why exploitation is possible: Shell metacharacter substitution can be interpreted after the command allowlist check, allowing injected operations to evade intended command restrictions

Why this happens

The underlying flaw is insufficient separation between data and shell syntax. Parameters are incorporated into command strings or passed through insufficiently validated directory-handling logic, while allowlist enforcement does not account for shell substitution semantics. This maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command, because attacker-controlled input can alter the command interpreted by the operating system.

The underlying flaw is insufficient separation between data and shell syntax. Parameters are incorporated into command strings or passed through insufficiently validated directory-handling logic, while allowlist enforcement does not account for shell substitution semantics. This maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command, because attacker-controlled input can alter the command interpreted by the operating system.

Potential impact

  • An attacker may execute commands that the allowlist intended to block
  • Connected Android devices could be rebooted, disrupted, or otherwise modified
  • Device data could be exposed, altered, or deleted
  • Compromised devices could be used to affect connected development or testing workflows
  • Prompt-injected agents could unintentionally trigger unauthorized device operations
  • An attacker may execute commands that the allowlist intended to block
  • Connected Android devices could be rebooted, disrupted, or otherwise modified
  • Device data could be exposed, altered, or deleted
  • Compromised devices could be used to affect connected development or testing workflows
  • Prompt-injected agents could unintentionally trigger unauthorized device operations

General mitigation guidance

Mitigation generally focuses on removing shell interpretation from device-management operations and treating all MCP parameters as untrusted input.

Common defensive patterns include:

  • Prefer direct process or Android API calls with structured argument arrays instead of concatenated shell commands
  • Apply strict allowlists to operation names and individual arguments before execution
  • Reject shell metacharacters and unexpected argument forms where shell invocation cannot be avoided
  • Validate directory and device identifiers against constrained schemas and permitted locations
  • Enforce least privilege on connected devices and isolate automation accounts from sensitive devices
  • Require explicit authorization for disruptive operations and use secure-by-default client policies
  • Add confirmation or human approval controls for high-impact device actions

Mitigation generally focuses on removing shell interpretation from device-management operations and treating all MCP parameters as untrusted input.

Common defensive patterns include:

  • Prefer direct process or Android API calls with structured argument arrays instead of concatenated shell commands
  • Apply strict allowlists to operation names and individual arguments before execution
  • Reject shell metacharacters and unexpected argument forms where shell invocation cannot be avoided
  • Validate directory and device identifiers against constrained schemas and permitted locations
  • Enforce least privilege on connected devices and isolate automation accounts from sensitive devices
  • Require explicit authorization for disruptive operations and use secure-by-default client policies
  • Add confirmation or human approval controls for high-impact device actions

How teams detect issues like this

Organizations can look for this class of issue through:

  • Static analysis rules identifying string interpolation or concatenation in shell execution paths
  • Code review checks for allowlists applied before, rather than after, shell parsing
  • Tests using metacharacter-containing inputs to verify that command boundaries cannot be changed
  • Review of MCP tool schemas for unconstrained strings passed to device operations
  • Runtime monitoring for unexpected shell processes, blocked-command attempts, reboot activity, and unusual device changes
  • Policy enforcement requiring structured process APIs and approval gates for destructive actions

Automated code-review and security-scanning tools may help identify risky command-construction patterns, but should be supplemented with behavioral testing.

Organizations can look for this class of issue through:

  • Static analysis rules identifying string interpolation or concatenation in shell execution paths
  • Code review checks for allowlists applied before, rather than after, shell parsing
  • Tests using metacharacter-containing inputs to verify that command boundaries cannot be changed
  • Review of MCP tool schemas for unconstrained strings passed to device operations
  • Runtime monitoring for unexpected shell processes, blocked-command attempts, reboot activity, and unusual device changes
  • Policy enforcement requiring structured process APIs and approval gates for destructive actions

Automated code-review and security-scanning tools may help identify risky command-construction patterns, but should be supplemented with behavioral testing.

Sources

SourceLink
github.comgithub.com/hyperb1iss/droidmind
github.comgithub.com/hyperb1iss/droidmind/blob/v0.4.0/droidmind/security.py#L338-L402
github.comgithub.com/hyperb1iss/droidmind/issues/17
vulncheck.comvulncheck.com/advisories/droidmind-through-0.4.0-command-injection-via-shell-allowlist-bypass

Frequently asked

questions

It can be exploitable through an exposed MCP interaction path when a requester or prompt-injected agent can provide parameters to the affected device operations. Exploitability depends on how the MCP client and connected devices are deployed.

Direct device access is not necessarily required. The relevant prerequisite is access to an MCP client or workflow that can invoke the vulnerable DroidMind operations, although the resulting impact is limited by the connected device's permissions.

Avoid invoking a shell with interpolated input. Use structured APIs or argument arrays, validate every parameter against a narrowly defined schema, and apply authorization before executing sensitive operations.

Combine secure command construction, strict MCP tool schemas, least-privilege device accounts, adversarial input testing, and approval controls for disruptive actions. Allowlist checks should be enforced at the operation and argument levels rather than relying on text matching alone.

It can be exploitable through an exposed MCP interaction path when a requester or prompt-injected agent can provide parameters to the affected device operations. Exploitability depends on how the MCP client and connected devices are deployed.

Direct device access is not necessarily required. The relevant prerequisite is access to an MCP client or workflow that can invoke the vulnerable DroidMind operations, although the resulting impact is limited by the connected device's permissions.

Avoid invoking a shell with interpolated input. Use structured APIs or argument arrays, validate every parameter against a narrowly defined schema, and apply authorization before executing sensitive operations.

Combine secure command construction, strict MCP tool schemas, least-privilege device accounts, adversarial input testing, and approval controls for disruptive actions. Allowlist checks should be enforced at the operation and argument levels rather than relying on text matching alone.

Find out what's already
exploitable in your codebase.