Sep 26, 2026·5 min read·21 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.
CVE-2026-126298 (also tracked as GHSA-r53h-rw34-8h97) is an algorithmic complexity Denial of Service (DoS) vulnerability in the Natural Language Toolkit (NLTK) Python library affecting all versions prior to 3.10.4. The vulnerability resides in the nltk.tree.transforms.chomsky_normal_form function and its corresponding public method Tree.chomsky_normal_form(). When transforming a parse tree into Chomsky Normal Form using the default right-factoring strategy, the function repeatedly invokes list.pop(0) inside a loop iterating over all children of a node. In CPython, removing the initial element of a standard list requires an O(N) memory shift operation, causing the overall binarization algorithm to degrade to O(N^2) quadratic time complexity relative to the width of a node. Furthermore, converting horizontal node width into vertical tree depth bypasses initial parsing depth bounds, triggering subsequent stack exhaustion (RecursionError) when recursive methods traverse the mutated structure. Unauthenticated remote attackers who can submit bracketed tree strings to applications invoking this transformation can exhaust single-threaded CPU resources or induce unhandled application exceptions.
An algorithmic complexity vulnerability (CWE-407) in the Natural Language Toolkit (NLTK) before version 3.10.4 allows remote unauthenticated attackers to cause a denial of service via crafted Combinatory Categorial Grammar (CCG) lexicon strings. The parser in nltk.ccg.lexicon.fromstring performs repeated immutable string slicing, concatenation, and regex tail capturing, resulting in O(n^2) CPU consumption when processing wide, flat category definitions.
CVE-2026-126295 (also tracked as GHSA-fg9w-wfp5-j933) is a path confinement bypass vulnerability in the Natural Language Toolkit (NLTK) affecting versions 3.10.0 prior to 3.10.4. The flaw resides in nltk/parse/bllip.py within the BllipParser class and its factory method BllipParser.from_unified_model_dir(). Unlike sibling tool wrappers in NLTK that enforce data-root confinement via the nltk.pathsec module, BllipParser passes caller-supplied filesystem paths directly into the third-party bllipparser native C extension without validation. When an application passes untrusted input as model paths or directories to BllipParser, an attacker can force the native extension to open arbitrary files on the local filesystem. This leads to information disclosure through parser diagnostic oracles, local model tampering via shared directories, and denial of service by hanging worker threads on blocking special files (such as FIFOs or device nodes) or exhausting memory via oversized files.
CVE-2026-126300 (GHSA-ffr9-mgrr-wcvr) is an inefficient algorithmic complexity vulnerability (CWE-407) in the Natural Language Toolkit (NLTK) Python library affecting versions 3.2.5 prior to 3.10.4. The flaw resides in the quote-restoration routine of TreebankWordTokenizer.span_tokenize and NLTKWordTokenizer.span_tokenize, where repeated calls to list.pop(0) over matched quote tokens introduce quadratic O(n^2) time complexity. An unauthenticated remote attacker who supplies input containing long sequences of double-quote characters can exhaust CPU resources and degrade service availability.
The Natural Language Toolkit (NLTK) versions 3.6 through 3.10.3 contain an algorithmic complexity vulnerability in the LegalitySyllableTokenizer.tokenize method. When processing tokens composed of continuous runs of vowels, an unguarded string reversal and set membership lookup loop executes in quadratic time relative to the input token length. Remote attackers capable of submitting arbitrary text to applications utilizing this tokenizer can trigger sustained single-core CPU exhaustion and application-level denial of service.
CVE-2026-126304 is a symlink path traversal vulnerability (CWE-59) in the Natural Language Toolkit (NLTK) versions 3.10.0 prior to 3.10.4. The YCOECorpusReader class constructs internal sub-readers for the 'psd' and 'pos' subdirectories using FileSystemPathPointer.join(), which relies exclusively on lexical string-prefix validation rather than canonical path resolution. An attacker who supplies a crafted YCOE corpus containing symbolic links in place of the 'psd' or 'pos' subdirectories can bypass directory confinement and read arbitrary files from sibling corpora or sensitive directories within the NLTK data sandbox.