/

CVE-2026-62312

Severity:

HIGH RISK

(8.8)

Command Injection (CWE-78) in 9Router MCP Plugin Routing

CVE-2026-62312

Deferred

Vulnerability type

Category:

Command Injection

CWE:

CWE-78

Impact:

Remote Code Execution on Host OS

Severity:

HIGH RISK

(8.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

9Router contains a command injection issue where unvalidated MCP plugin arguments are passed into child_process.spawn(), allowing arbitrary command execution on the host.

When combined with a Host header bypass of localhost-only routes, an authenticated remote attacker can use the /api/mcp//sse endpoint to run malicious commands via custom plugins.

Affected context

This vulnerability appears in 9Router deployments that expose the MCP plugin routing functionality and rely on localhost-only routes for protection.

It is most relevant where:

  • The application trusts the HTTP Host header for access control to internal routes
  • MCP plugin arguments are forwarded directly to child_process.spawn() without strict validation
  • Authenticated users can register or invoke custom MCP plugins via the /api/mcp//sse endpoint

Exploit preconditions

  • Attack surface: HTTP interface exposing /api/mcp//sse and related MCP plugin endpoints
  • Required access: Authenticated user with the ability to invoke or define MCP plugins
  • Trigger point: Host header manipulation to reach localhost-only routes, followed by plugin invocation with crafted arguments
  • Why exploitation is possible: The application uses the Host header for route protection and passes unvalidated plugin arguments into child_process.spawn(), enabling command injection within the host operating system context

Why this happens

The underlying bug is a classic command injection pattern (CWE-78) in which user-controlled values are used as arguments to process execution APIs without sufficient validation or restriction.

In this case, MCP plugin arguments are treated as trusted input and passed directly to child_process.spawn(), allowing an attacker to influence the commands or parameters executed on the host.

The trust in the HTTP Host header for segregating localhost-only routes further expands the reachable attack surface, letting remote authenticated users access internal endpoints intended to be shielded from external traffic.

Potential impact

  • Remote execution of arbitrary system commands on the host operating system
  • Full compromise of the 9Router runtime environment and associated credentials
  • Lateral movement to other services or data stores reachable from the host
  • Tampering with AI routing behavior and token usage patterns
  • Exfiltration or destruction of sensitive data accessible from the compromised host

General mitigation guidance

Mitigation should focus on reducing trust in user-controlled inputs and hardening process execution boundaries.

Recommended patterns include:

  • Decouple route protection from the HTTP Host header and rely on server-side checks, explicit binding, or authentication/authorization controls
  • Avoid passing raw user or plugin inputs into child_process.spawn() or similar APIs; restrict execution to predefined commands with fixed argument sets
  • Apply strict validation and sanitization to any parameters that must reach process execution APIs, using allowlists and structured types
  • Run components that execute commands with least privilege, using dedicated service accounts and constrained OS-level permissions
  • Segment internal management or plugin endpoints from general user traffic to limit exposure of sensitive routes

How teams detect issues like this

Detection can leverage a combination of code-level and operational signals:

  • Static analysis rules that flag direct use of child_process.spawn(), exec, or similar APIs with tainted arguments derived from HTTP requests or plugin configuration
  • Code review checklists emphasizing validation and allowlist enforcement around process execution and plugin systems
  • Application-level logging of MCP plugin invocations and command execution paths to spot anomalous arguments or unexpected command patterns
  • Runtime monitoring and host-based intrusion detection tuned to detect suspicious process trees, unusual binaries, or shell invocations originating from the 9Router service
  • CI/CD pipeline policies that automatically highlight new usage of process execution APIs or changes to access control based on HTTP headers

Sources

SourceLink
github.comgithub.com/decolua/9router/commit/da667836cc7584bea0edd893de1d590c9ea279dc
github.comgithub.com/decolua/9router/releases/tag/v0.5.2
github.comgithub.com/decolua/9router/security/advisories/GHSA-63p9-g54h-prrp

Frequently asked

questions

Exploitation typically requires authenticated access to MCP plugin functionality and the ability to reach localhost-only routes via Host header manipulation. In environments where many users can create or invoke plugins, the exposure can be significant.

An attacker must be an authenticated user of 9Router with access to MCP plugin endpoints. They also need to be able to send crafted HTTP requests that manipulate the Host header to bypass localhost-only route restrictions.

The safest approach is to stop trusting the Host header for access control, and to prevent user-supplied or plugin-supplied arguments from reaching child_process.spawn() directly. Restrict execution to a small set of predefined commands and enforce strict validation on any parameters that remain configurable.

Future prevention should rely on secure design principles: avoid header-based access control, treat all user and plugin inputs as untrusted, enforce allowlists for process execution, integrate static analysis checks for command injection patterns, and perform focused reviews of routing and plugin subsystems before deployment.

Find out what's already
exploitable in your codebase.