/

CVE-2026-30302

Severity:

CRITICAL RISK

(10.0)

OS Command Injection in CodeRider-Kilo Auto-Approval Module

CVE-2026-30302

Analyzed

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Remote Code Execution

Severity:

CRITICAL RISK

(10.0)

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

The command auto-approval module in CodeRider-Kilo contains an OS command injection flaw caused by using a Unix-style command parser against Windows CMD, making its Git command whitelist ineffective.

By abusing differences between the parser's interpretation of escape characters and the actual Windows CMD behavior, an attacker can bypass the whitelist and achieve arbitrary remote code execution.

Affected context

This vulnerability appears in environments where CodeRider-Kilo's command auto-approval module:

  • Runs Git or similar commands through Windows CMD
  • Applies a whitelist based on parsing user-controlled or project-controlled command strings
  • Uses a Unix-style shell-quote library to evaluate arguments and determine whether a command is "safe"

In such setups, any workflow that auto-approves commands (e.g., Git operations, automation hooks, or CI tasks) becomes risky when the command line can be influenced by attackers.

Exploit preconditions

  • Attack surface: Interfaces that accept or construct Git (or similar) commands passed to CodeRider-Kilo's auto-approval module (e.g., developer tools, CI jobs, or integration hooks).
  • Required access: Ability to influence command input evaluated by the auto-approval mechanism (such as controlling branch names, commit messages, arguments, or configuration values).
  • Trigger point: Submission or processing of a crafted command like git log ^" & malicious_command ^" that passes the whitelist but is later executed by Windows CMD.
  • Why exploitation is possible: The Unix-oriented shell-quote parser incorrectly treats Windows escape sequences (^) and special characters as harmless, assuming the entire payload is a single safe argument. Windows CMD later ignores or interprets these characters differently, exposing & as a real command separator and executing attacker-controlled commands.

Why this happens

The underlying issue is an OS command injection vulnerability (CWE-78) introduced by inconsistent command parsing between validation and execution.

CodeRider-Kilo relies on:

  • A Unix-centric shell-quote library to validate commands against a whitelist, and
  • The Windows CMD interpreter to execute those commands.

Because the validator does not implement Windows CMD semantics—especially handling of ^ escapes and connectors like &—it misclassifies crafted input as safe. This disconnect between the "logical" parser and the actual execution environment allows untrusted data to alter the command structure at runtime, turning what appears to be a single benign command into multiple injected commands.

Potential impact

  • Execution of arbitrary commands under the account running CodeRider-Kilo
  • Complete compromise of the CI/automation host where the auto-approval module runs
  • Access to, modification of, or exfiltration of source code repositories and build artifacts
  • Use of the compromised system as a pivot for lateral movement within the network
  • Tampering with build pipelines, leading to backdoored binaries or supply-chain attacks

General mitigation guidance

Effective mitigation focuses on aligning validation with execution semantics and minimizing reliance on shell parsing:

  • Prefer direct process invocation APIs that pass arguments as structured arrays (e.g., avoiding shell invocation entirely) instead of building command strings.
  • Use Windows-aware parsing and escaping when commands must be executed via CMD, ensuring that validation logic mirrors CMD's exact treatment of ^, &, quotes, and other metacharacters.
  • Design the whitelist at the argument level rather than on raw command strings, explicitly enumerating allowed subcommands, flags, and patterns instead of trying to parse arbitrary text.
  • Treat any user- or project-controlled input (branch names, file paths, commit messages, environment variables) as untrusted, restricting where and how it can appear in command lines.
  • Run automation with least-privilege service accounts and compartmentalized permissions so that a command injection has reduced blast radius.

How teams detect issues like this

Detection can combine code-level analysis with behavioral monitoring:

  • Static analysis / SAST: Flag code paths where:
  • Command strings are built by concatenating user-controlled data and then executed via cmd.exe, system, Runtime.exec, CreateProcess with shell, or similar APIs.
  • Validation uses a parser or quoting library that does not match the actual execution environment (e.g., Unix shell quoting on Windows).
  • Code review signals:
  • Security checks or whitelists implemented as textual pattern matching on full command lines.
  • Any logic that "approves" or "sanitizes" commands without clearly accounting for Windows CMD metacharacters and escaping rules.
  • Runtime monitoring:
  • Logging and alerting on suspicious child processes spawned from CodeRider-Kilo, especially those that do not correspond to expected Git or build commands.
  • Anomaly detection on command usage patterns from CI or automation accounts.
  • Automated review tools can be configured with custom rules to flag shell-based execution paths and mismatched parsing/OS combinations.

Sources

SourceLink
github.comgithub.com/Secsys-FDU/LLM-Tool-Calling-CVEs/issues/3

Frequently asked

questions

Exploitability depends on who can influence the commands evaluated by the auto-approval feature. In many environments, attackers could leverage repository-level control (e.g., via forks, pull requests, or compromised developer accounts) to supply crafted command inputs, making the vulnerability broadly exploitable in collaborative or CI-integrated setups.

Not necessarily local OS access. The key requirement is logical access to any interface that feeds data into the auto-approved command line—such as the ability to push commits, create branches, or trigger builds that cause CodeRider-Kilo to construct and run Git commands. Whether this requires authentication depends on how those workflows are exposed and protected.

The most robust fix is to stop executing commands through a shell when possible and instead call Git (and other tools) via direct process invocation with structured argument lists. Where shell usage is unavoidable, implement a Windows-CMD–aware validator that fully matches the execution semantics and restrict commands to a minimal, well-defined set of arguments.

Align validation logic with the actual execution environment, avoid hand-rolled or cross-OS parsing schemes, and treat all external input to command lines as untrusted. Incorporate security reviews and automated checks targeting shell execution paths, enforce least privilege for automation accounts, and adopt a design pattern that minimizes or eliminates shell involvement in build and deployment pipelines.

Find out what's already
exploitable in your codebase.