/

CVE-2026-43990

Severity:

HIGH RISK

(8.4)

OS Command Injection in JunoClaw plugin-shell run_command

CVE-2026-43990

Deferred

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-77, 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

JunoClaw's plugin-shell run_command helper previously wrapped agent-supplied commands in sh -c / cmd /C and forwarded the entire argument string directly to the shell parser. This allowed shell metacharacters provided by an agent to be treated as command syntax rather than data.

In deployments where agents can influence or generate commands, this behavior may enable OS command injection, letting an attacker execute arbitrary system commands under the privileges of the JunoClaw worker process.

Affected context

The vulnerability arises in JunoClaw environments that:

  • Enable the plugin-shell capability for agents, and
  • Allow agents (or upstream users prompting agents) to supply or influence command strings, and
  • Execute those commands through run_command, which previously wrapped them in sh -c / cmd /C and passed them as a single unstructured string.

In such setups, any shell metacharacters present in the command text are interpreted by the system shell, potentially chaining additional commands or altering the intended behavior.

Exploit preconditions

  • Attack surface: The plugin-shell run_command interface exposed inside the JunoClaw runtime (e.g., agent tools, plugins, or workflows that trigger shell execution).
  • Required access: Ability to cause an agent to issue or relay commands to plugin-shell (for instance, by crafting prompts, controlling agent inputs, or operating an agent with shell access).
  • Trigger point: Execution of a command via run_command that is wrapped in sh -c / cmd /C and passed as a single string to the shell.
  • Why exploitation is possible: The shell treats the supplied string as full command syntax, so metacharacters such as ;, &&, ||, pipes, redirection, and subshell operators are parsed and executed instead of being handled as literal data. There is no strict separation between command and arguments, nor robust quoting/escaping, making injection feasible.

Why this happens

The core issue matches CWE-78: Improper Neutralization of Special Elements used in an OS Command, sometimes combined with CWE-77: Command Injection via Argument Injection. The run_command implementation constructed shell invocations like sh -c "<agent-string>" or cmd /C "<agent-string>", where the agent-controlled string was treated as a complete shell script fragment.

By delegating parsing to the shell, the code implicitly trusted agent-supplied text to be safe command syntax. Shell metacharacters were not neutralized or structurally separated from the intended command, so an attacker could append new commands, alter control flow, or change redirections. Conceptually, this is an insecure pattern where high-level application logic uses generic shell interpreters as a command dispatcher without enforcing a strict, argument-based API.

Potential impact

  • Execution of arbitrary OS commands under the privileges of the JunoClaw process or container.
  • Reading, modifying, or deleting files accessible to the runtime environment.
  • Accessing secrets, API keys, or configuration files present on the host or in the container.
  • Establishing outbound network connections for data exfiltration or pivoting to other services.
  • Disrupting workflows by terminating processes, corrupting intermediate artifacts, or consuming system resources.

General mitigation guidance

Effective mitigation focuses on removing shell parsing from the trust boundary and treating commands as structured data rather than free-form text.

Common hardening patterns include:

  • Prefer direct process execution APIs that take an argument list (e.g., execve-style, spawn with an array) instead of invoking sh -c / cmd /C with a single string.
  • When a shell is truly necessary, construct a fixed, non-agent-controlled command template and pass untrusted values only as data (e.g., through environment variables or safely quoted arguments), avoiding concatenation into a script-like string.
  • Apply strict allowlists for executable paths and permitted subcommands, reducing the space of what agents are allowed to run.
  • Limit the privileges of the plugin-shell runtime using OS-level sandboxing, dedicated low-privilege users, and minimal filesystem and network access.
  • Reduce the scope of inputs that agents can translate into shell commands, and avoid exposing raw shell access where possible.

How teams detect issues like this

Detection typically involves both code-centric and behavior-centric approaches:

  • Static analysis and linting:
  • Flag usages of generic shell execution APIs where untrusted or dynamically constructed strings are passed to sh -c, bash -c, or cmd /C.
  • Identify concatenation or interpolation of agent- or user-controlled data into command strings.
  • Enforce policies that prefer argument-based process execution functions over shell-based ones.
  • Code review patterns:
  • Scrutinize any plugin or tool that grants agents access to system-level commands.
  • Look for places where "convenience wrappers" around shell execution might inadvertently reintroduce string-based command invocation.
  • Runtime and operational signals:
  • Monitor process invocation logs for suspicious patterns such as frequent use of ;, &&, ||, or unexpected binaries being launched by the JunoClaw worker.
  • Use host or container security tooling to detect anomalous command sequences originating from JunoClaw components.

Automated code scanning tools, including SAST and security-focused linters, can be configured with rules to highlight this class of shell invocation patterns across the codebase.

Sources

SourceLink
github.comgithub.com/Dragonmonk111/junoclaw/commit/2bc54f6
github.comgithub.com/Dragonmonk111/junoclaw/releases/tag/v0.x.y-security-1
github.comgithub.com/Dragonmonk111/junoclaw/security/advisories/GHSA-gpvm-3chf-2649

Frequently asked

questions

It can be, depending on how JunoClaw agents are exposed. If an attacker can influence agent behavior remotely—for example, by sending prompts to an agent that has plugin-shell enabled—then they may be able to trigger command injection without direct system access.

The attacker needs the ability to cause an agent to submit or relay commands to plugin-shell, either by operating an agent directly, controlling an upstream integration, or manipulating prompts in multi-tenant or shared-agent scenarios. No direct shell or OS-level login is required if the agent can be steered to run commands.

The most robust pattern is to eliminate sh -c / cmd /C wrappers and route all executions through APIs that accept a command plus a list of arguments, with strict separation between code and data. Combine this with allowlisting of permitted commands and careful control over which agents are allowed to invoke the shell.

Design agent tools and plugins so that they operate on structured, typed parameters rather than raw strings passed to a shell. Establish development guidelines that prohibit untrusted input from reaching shell interpreters, enforce these guidelines with static analysis and code review, and run potentially risky tools under strong sandboxing and least-privilege configurations.

Find out what's already
exploitable in your codebase.