Sep 26, 2026·5 min read·2 visits
CliInvoke process runner factories are vulnerable to argument injection via double-quote manipulation. This allows local attackers to execute arbitrary system commands when wrapper shell runners are used. Fixes are available in versions 2.8.5, 2.9.4, 2.10.5, and 3.0.0-beta.2.
An argument injection vulnerability (CWE-88) in CliInvoke and AlastairLundy.CliInvoke allows local attackers to execute arbitrary system commands. By injecting double-quote characters into target file paths or arguments, attackers can terminate operating-system-level quoted boundaries and introduce new commands when shell runners are utilized.
The .NET libraries CliInvoke and AlastairLundy.CliInvoke are designed to invoke command-line programs and wrap executable processes. They provide abstraction layers for process management, configuration, and invocation. The attack surface of these libraries is exposed when applications take untrusted, user-controlled input and pass it directly to executable process configurations.\n\nThe primary flaw is classified under CWE-88 (Improper Neutralization of Argument Delimiters in a Command). The runner factories fail to adequately neutralize double-quote characters when assembling a combined argument string. This design allows local attackers to manipulate the parameters of downstream process executions, potentially achieving arbitrary system command execution.
Prior to the security patch, RunnerProcessFactory (in the 2.x release branch) and RunnerConfigurationFactory (in the 3.x release branch) dynamically combined runner configurations with target process parameters. The library consolidated the runner arguments, target file path, and target process arguments into a single string using string interpolation.\n\nThis interpolated string was then directly assigned to the ProcessStartInfo.Arguments property. While the library leveraged escaping utilities like ShellArgumentEscaper.EscapeForCmd or ShellArgumentEscaper.EscapeForPowerShell, the escaping model relied on the operating system's command parser to split the single argument string back into an argument vector. This process failed when the input path or arguments contained double quotes.\n\nInjecting a double quote (") into the target executable path or its associated arguments terminates the quoted region at the operating-system level. The parser treats subsequent characters as separate parameters or script elements rather than part of the intended path or argument. This allows for command execution under wrapper configurations.
The original vulnerable code path performed straightforward string interpolation to build the parameters. The target execution properties were merged directly:\n\ncsharp\n// Vulnerable interpolated construction\nstring combinedArgs = $"{runnerProcessConfig.Arguments} {processConfigToBeRun.TargetFilePath} {processConfigToBeRun.Arguments}".Trim();\nprocessStartInfo.Arguments = combinedArgs;\n\n\nThe patch remediates this injection vector by discarding raw string concatenation. The fix implements an internal state-machine tokenizer (ArgumentTokenizer) to tokenize argument strings into discrete, independent entries. This allows the libraries to securely isolate user input.\n\ncsharp\n// ArgumentTokenizer tokenizing loop\nfor (int i = 0; i < text.Length; i++) {\n char c = text[i];\n if (c == '"') {\n if (inQuotes && i + 1 < text.Length && text[i + 1] == '"') {\n current.Append('"');\n i++;\n continue;\n }\n inQuotes = !inQuotes;\n continue;\n }\n if (!inQuotes && char.IsWhiteSpace(c)) {\n if (current.Length > 0) {\n tokens.Add(current.ToString());\n current.Clear();\n }\n continue;\n }\n current.Append(c);\n}\n\n\nIn addition to tokenization, the patch transitions to utilizing the native .NET structured invocation mechanism. On platforms running .NET 8.0 or greater, the library populates the native ProcessStartInfo.ArgumentList collection instead of writing to the single .Arguments string property. This structured API ensures the operating system handles quote escaping safely and isolates each token from the command shell's parsing engine.
An attacker can exploit this vulnerability if they control the parameters parsed by the runner process factory. For example, if a target application executes commands through a shell runner such as PowerShell (pwsh.exe -Command), the attacker can supply a crafted file path to trigger the execution breakout.\n\nA conceptual payload targeting a PowerShell runner utilizes double quotes to terminate the path argument. The attacker configures the target file path to: app"evil.exe. The vulnerable library compiles this configuration into the following single string:\n\npowershell\npwsh.exe -NoProfile -Command & "app"evil.exe" safe\n\n\nWhen the PowerShell shell parser reads this command line, it interprets & "app" as a complete command token. The subsequent characters (evil.exe) are interpreted as a distinct, new executable token. This causes the shell interpreter to run the injected executable (evil.exe) instead of passing it as a sub-argument, resulting in unauthorized command execution.
The impact of this vulnerability depends on the permissions of the parent application calling CliInvoke. Successful exploitation results in arbitrary local command execution with the privileges of the active .NET process. This can lead to local privilege escalation, unauthorized system configuration changes, and data exfiltration if the parent process has high system privileges.\n\nThe CVSS v3.1 score of 8.4 reflects the high severity of the vulnerability. The low attack complexity and the lack of user interaction requirements increase the likelihood of success if an application processes untrusted command arguments. However, because it is an argument injection flaw targeting a local utility library, the attack vector is classified as Local (AV:L), which mitigates broader remote exploitation unless a remote interface passes input directly to the library.
The primary remediation strategy is upgrading all dependent packages to their patched versions. For the CliInvoke NuGet package, users must upgrade to version 2.8.5, 2.9.4, 2.10.5, or 3.0.0-beta.2 (or later). For the legacy AlastairLundy.CliInvoke package, users must upgrade to version 2.0.2.\n\nDevelopers should target .NET 8.0 or newer runtimes for their compiled applications. Targeting .NET 8.0 enables the library's adapter layer to map configurations directly to ProcessStartInfo.ArgumentList, fully neutralizing string-parsing breakout vectors.\n\nIf upgrading is not immediately feasible, developers can mitigate the flaw by implementing input sanitization. This involves filtering out double-quote characters from target paths and arguments before passing them to the factories. Additionally, developers can manually construct target configurations by bypassing the vulnerable factory and populating the process parameters through explicit token lists.
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H| Product | Affected Versions | Fixed Version |
|---|---|---|
CliInvoke Alastair Lundy | >= 2.0.0, <= 2.8.4 | 2.8.5 |
CliInvoke Alastair Lundy | >= 2.9.0, <= 2.9.3 | 2.9.4 |
CliInvoke Alastair Lundy | >= 2.10.0, <= 2.10.4 | 2.10.5 |
CliInvoke Alastair Lundy | >= 3.0.0-alpha.1, <= 3.0.0-beta.1 | 3.0.0-beta.2 |
AlastairLundy.CliInvoke Alastair Lundy | >= 2.0.0-alpha.1, <= 2.0.0 | 2.0.2 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-88 |
| Attack Vector | Local (AV:L) |
| CVSS Base Score | 8.4 (High) |
| EPSS Score | N/A |
| Exploit Status | Proof-of-Concept |
| CISA KEV Status | Not Listed |
The product constructs a command string by combining user-controlled input with fixed command arguments without properly neutralizing delimiters (such as double quotes) that separate arguments.
An unauthenticated path traversal vulnerability exists in the Khoj AI assistant platform via the static file serving endpoint `/home/{file_path:path}`. Due to improper path sanitization when handling user input with Python's pathlib module, a remote attacker can read arbitrary files from the server's filesystem.
An OS command injection vulnerability exists in the PowerShell and Cmd shell wrappers of the CliInvoke .NET library (specifically the CliInvoke.Specializations package). Under vulnerable configurations, arguments and targets are passed as a single flat string to ProcessStartInfo.Arguments, permitting double-quote breakout and execution of arbitrary secondary commands with host process privileges.
A critical-severity input validation vulnerability in the Elixir multi-party payment library `mpp` allows unauthenticated remote attackers to exhaust the transaction fee payer's wallet balance. By submitting a crafted Ethereum transaction envelope with artificially inflated gas parameters, an attacker can force the server to co-sign and commit to pay exorbitant fees, leading to severe financial loss and Denial of Service.
A critical gas draining vulnerability exists in the ZenHive mpp (Multi-Payment Protocol) library prior to version v0.6.0. By omitting validation of EIP-2930 access lists in custom 0x76 transaction envelopes, the library allows malicious clients to pad transaction payloads with dummy addresses, draining the gas sponsor's hot wallet.
A high-severity vulnerability exists in the Elixir library `mpp` (Multi-Party Payments) prior to version `0.6.0`. When acting as a sponsored transaction fee payer, the server co-signs and broadcasts user-provided transactions without verifying if the user-specified gas limit is sufficient. An attacker can submit transactions designed to run out of gas and revert. The transaction reversion ensures the attacker pays zero fees, while the sponsor's fee-payer wallet is fully billed for the wasted gas, resulting in a low-cost, high-impact Denial of Service (DoS) vector.
An unauthenticated remote information disclosure vulnerability exists in the SCBE-AETHERMOORE geometric AI governance framework. The API endpoint `/api/ops/check-email` allows unauthenticated network actors to trigger administrative subprocesses and retrieve sensitive operator email digests from Gmail or ProtonMail mailboxes due to missing authentication controls and overly permissive CORS configurations.