/

CVE-2026-119025

Severity:

HIGH RISK

(7.5)

OS Command Injection (CWE-78) in open on Windows/WSL

CVE-2026-119025

Awaiting Analysis

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Arbitrary PowerShell Code Execution

Severity:

HIGH RISK

(7.5)

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

An OS command injection vulnerability in open allows crafted URLs to inject PowerShell subexpressions when URL values are passed to PowerShell without adequate escaping. On Windows and WSL, an attacker may achieve code execution when the application processes attacker-controlled URLs, including authorization endpoints supplied by a malicious MCP server.

An OS command injection vulnerability in open allows crafted URLs to inject PowerShell subexpressions when URL values are passed to PowerShell without adequate escaping. On Windows and WSL, an attacker may achieve code execution when the application processes attacker-controlled URLs, including authorization endpoints supplied by a malicious MCP server.

Affected context

The vulnerability affects deployments of open on Windows or WSL where URL values can be influenced by an attacker and are later incorporated into a PowerShell command. Risk is higher when the application consumes authorization endpoint values or other URL fields from untrusted MCP servers without enforcing a trusted source or validating the complete URL structure.

The vulnerability affects deployments of open on Windows or WSL where URL values can be influenced by an attacker and are later incorporated into a PowerShell command. Risk is higher when the application consumes authorization endpoint values or other URL fields from untrusted MCP servers without enforcing a trusted source or validating the complete URL structure.

Exploit preconditions

  • Attack surface: URL-processing logic that invokes PowerShell on Windows or WSL
  • Required access: Ability to provide or influence a URL consumed by the application, potentially through a malicious MCP server
  • Trigger point: Processing of the crafted URL by index.js and its subsequent use with powershell -EncodedCommand
  • Why exploitation is possible: URL content is passed into a command context without sufficient escaping or separation from PowerShell expression syntax
  • Attack surface: URL-processing logic that invokes PowerShell on Windows or WSL
  • Required access: Ability to provide or influence a URL consumed by the application, potentially through a malicious MCP server
  • Trigger point: Processing of the crafted URL by index.js and its subsequent use with powershell -EncodedCommand
  • Why exploitation is possible: URL content is passed into a command context without sufficient escaping or separation from PowerShell expression syntax

Why this happens

The underlying flaw is the construction of a PowerShell command from attacker-influenced URL data without treating that data as strictly inert input. PowerShell subexpressions such as $() can be interpreted as executable expressions when they reach the command parser. This behavior maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command, commonly known as OS command injection.

The underlying flaw is the construction of a PowerShell command from attacker-influenced URL data without treating that data as strictly inert input. PowerShell subexpressions such as $() can be interpreted as executable expressions when they reach the command parser. This behavior maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command, commonly known as OS command injection.

Potential impact

  • An attacker may execute arbitrary PowerShell commands in the application process context.
  • The vulnerability could expose local files, credentials, tokens, or environment variables.
  • A compromised process may alter application data or configuration.
  • Attackers could use the affected host as a foothold for broader Windows or WSL compromise.
  • The impact may be limited or expanded by the privileges granted to the application.
  • An attacker may execute arbitrary PowerShell commands in the application process context.
  • The vulnerability could expose local files, credentials, tokens, or environment variables.
  • A compromised process may alter application data or configuration.
  • Attackers could use the affected host as a foothold for broader Windows or WSL compromise.
  • The impact may be limited or expanded by the privileges granted to the application.

General mitigation guidance

Mitigation generally focuses on preventing attacker-controlled URL data from becoming executable command syntax.

Common defensive patterns include:

  • Avoiding shell invocation when a native library or direct process API can perform the required operation.
  • Passing untrusted values as separated, typed arguments rather than concatenating them into command strings.
  • Applying strict URL parsing and allowlisting for schemes, hosts, paths, and permitted authorization endpoints.
  • Treating MCP-provided metadata as untrusted and requiring explicit trust validation before use.
  • Applying context-appropriate escaping and command construction controls when PowerShell is unavoidable.
  • Running the application with least privilege and restricting access to sensitive files, credentials, and administrative operations.

Mitigation generally focuses on preventing attacker-controlled URL data from becoming executable command syntax.

Common defensive patterns include:

  • Avoiding shell invocation when a native library or direct process API can perform the required operation.
  • Passing untrusted values as separated, typed arguments rather than concatenating them into command strings.
  • Applying strict URL parsing and allowlisting for schemes, hosts, paths, and permitted authorization endpoints.
  • Treating MCP-provided metadata as untrusted and requiring explicit trust validation before use.
  • Applying context-appropriate escaping and command construction controls when PowerShell is unavoidable.
  • Running the application with least privilege and restricting access to sensitive files, credentials, and administrative operations.

How teams detect issues like this

Organizations can look for:

  • Static analysis findings involving shell or PowerShell command construction from URL, network, or configuration values.
  • Code review signals such as string concatenation, interpolation, or encoding performed before powershell -EncodedCommand invocation.
  • Tests that exercise metacharacters and expression syntax in every externally controlled URL field.
  • Runtime monitoring for unexpected PowerShell child processes, encoded command activity, or unusual parent-child process relationships.
  • Policy enforcement that requires approved URL hosts and prohibits untrusted MCP metadata from selecting authorization endpoints.

Automated code review and SAST tools may help identify command sinks and incomplete input-trust boundaries.

Organizations can look for:

  • Static analysis findings involving shell or PowerShell command construction from URL, network, or configuration values.
  • Code review signals such as string concatenation, interpolation, or encoding performed before powershell -EncodedCommand invocation.
  • Tests that exercise metacharacters and expression syntax in every externally controlled URL field.
  • Runtime monitoring for unexpected PowerShell child processes, encoded command activity, or unusual parent-child process relationships.
  • Policy enforcement that requires approved URL hosts and prohibits untrusted MCP metadata from selecting authorization endpoints.

Automated code review and SAST tools may help identify command sinks and incomplete input-trust boundaries.

Sources

SourceLink
github.comgithub.com/anomalyco/opencode/commit/29f07e0c69ad8668e0e15b0eb54f2fcb342af98c
github.comgithub.com/anomalyco/opencode/pull/51414
github.comgithub.com/modelcontextprotocol/inspector/security/advisories/GHSA-q978-78c7-phqw
github.comgithub.com/sindresorhus/open/blob/v10.2.0/index.js#L189-L203
github.comgithub.com/sindresorhus/open/blob/v7.2.0/index.js#L60-L99
github.comgithub.com/sindresorhus/open/commit/274d70446bf38a7b7d50b214dd3962ef8ea9320d
github.comgithub.com/sindresorhus/open/releases/tag/v11.0.0
vulncheck.comvulncheck.com/advisories/open-7.2.0-before-11.0.0-os-command-injection-via-powershell-on-windows

Frequently asked

questions

It can be remotely exploitable when an attacker can cause the application to process a crafted URL, such as through an untrusted or malicious MCP server. The precise scope depends on how URL values enter the application.

Not necessarily. An attacker may only need to control a URL or authorization endpoint that the application accepts. Deployment-specific authentication and trust controls determine whether that input can be supplied.

Avoid shell-based command construction where possible. Otherwise, use structured process APIs, pass values as separate arguments, strictly validate allowed URLs, and ensure untrusted data cannot become PowerShell syntax.

Establish explicit trust boundaries for MCP metadata, apply allowlists for externally selected endpoints, test command-invocation paths with hostile input, and enforce least privilege for the application process.

It can be remotely exploitable when an attacker can cause the application to process a crafted URL, such as through an untrusted or malicious MCP server. The precise scope depends on how URL values enter the application.

Not necessarily. An attacker may only need to control a URL or authorization endpoint that the application accepts. Deployment-specific authentication and trust controls determine whether that input can be supplied.

Avoid shell-based command construction where possible. Otherwise, use structured process APIs, pass values as separate arguments, strictly validate allowed URLs, and ensure untrusted data cannot become PowerShell syntax.

Establish explicit trust boundaries for MCP metadata, apply allowlists for externally selected endpoints, test command-invocation paths with hostile input, and enforce least privilege for the application process.

Find out what's already
exploitable in your codebase.