/

CVE-2026-100368

Severity:

HIGH RISK

(8.4)

OS Command Injection (CWE-78) in CliInvoke Wrappers

CVE-2026-100368

Deferred

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Arbitrary Command Execution

Severity:

HIGH RISK

(8.4)

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

A command injection vulnerability in CliInvoke.Specializations PowerShell and Cmd wrappers allows specially crafted caller-controlled targets or arguments to alter the command interpreted by the operating system shell. If untrusted input reaches these wrappers, an attacker may execute additional commands with the privileges of the host process.

Affected context

The vulnerability occurs in affected CliInvoke.Specializations and AlastairLundy.CliInvoke.Specializations releases when the PowerShell or Windows Command Prompt wrappers construct a single ProcessStartInfo.Arguments string for pwsh -Command or cmd /c. Risk depends on whether untrusted data can reach target paths or arguments and whether the resulting process has meaningful operating-system privileges.

Exploit preconditions

  • Attack surface: PowerShell or Windows Command Prompt specialization wrappers
  • Required access: Ability to influence the target path or command arguments supplied to the wrapper
  • Trigger point: Construction and execution of the shell command through ProcessStartInfo.Arguments
  • Why exploitation is possible: Caller-controlled values are embedded in a shell command using a single argument string, allowing operating-system quoting boundaries to be altered

Why this happens

The underlying bug is unsafe construction of shell command lines from untrusted values. Passing caller-controlled targets and arguments through a single ProcessStartInfo.Arguments string leaves quoting and shell interpretation responsibilities to the operating system shell. A crafted input can therefore escape the intended argument context and introduce additional command syntax, mapping to CWE-78: Improper Neutralization of Special Elements used in an OS Command.

Potential impact

  • An attacker may execute arbitrary commands with the host process's privileges.
  • The affected application could be modified, disrupted, or used to access local data.
  • Credentials, tokens, or other secrets available to the process could be exposed.
  • A compromised process could enable lateral movement or further host compromise.

General mitigation guidance

Mitigation generally focuses on removing shell interpretation from workflows that handle untrusted input.

Common defensive patterns include:

  • Invoke target executables directly rather than routing input through PowerShell or Cmd wrappers.
  • Use structured process APIs that keep the executable, executable path, and arguments separate.
  • Treat target paths and arguments as untrusted data and apply narrowly defined allowlists where feasible.
  • Reject or safely handle quoting and shell metacharacters according to the selected platform and execution model.
  • Run child processes with least privilege, restricted environment access, and limited filesystem and network permissions.
  • Keep dependency versions within maintained, security-supported release lines through normal dependency governance.

How teams detect issues like this

Organizations can identify this issue through:

  • Static analysis rules that flag ProcessStartInfo.Arguments string concatenation involving external or user-controlled data.
  • Code review checks for PowerShell or Cmd invocation using shell command strings instead of structured argument APIs.
  • Dependency policy checks for affected CliInvoke.Specializations package release ranges.
  • Runtime monitoring for unexpected child processes, shell activity, or command-line arguments originating from application input.
  • Automated code and dependency review tools that identify shell injection patterns and vulnerable package constraints.

Sources

SourceLink
github.comgithub.com/alastairlundy/CliInvoke/security/advisories/GHSA-wrvw-254r-wpmv

Frequently asked

questions

It can be remotely exploitable when a network-facing application passes attacker-controlled values to the affected PowerShell or Cmd wrappers. In local applications, exploitation generally requires control over input processed by the host application.

The attacker must influence a target path or argument that reaches a vulnerable wrapper. The resulting command executes with the permissions of the process hosting CliInvoke.

Avoid shell wrappers for untrusted input and invoke the intended executable directly through a structured process API that separates the executable from its arguments.

Use allowlisted executable and argument values, avoid command-string concatenation, apply least privilege to child processes, and continuously review dependencies and process-spawning code for shell interpretation risks.

Find out what's already
exploitable in your codebase.