/

CVE-2026-37751

Severity:

CRITICAL RISK

(9.8)

OS Command Injection (CWE-78) in ai-maestro Runtime

CVE-2026-37751

Deferred

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Arbitrary Command Execution

Severity:

CRITICAL RISK

(9.8)

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 critical OS command injection vulnerability in ai-maestro's killSessionSync function may allow arbitrary operating-system command execution when crafted input reaches the session-termination logic. The risk is greatest when an attacker can influence the relevant session or process input processed by the agent runtime.

Affected context

The vulnerability occurs in the agent runtime implementation, specifically the killSessionSync function in lib/agent-runtime.ts. Deployments may be exposed when externally influenced or insufficiently trusted input is incorporated into a system command used to terminate or manage sessions. Actual exposure depends on how session data reaches this function and what operating-system privileges the runtime possesses.

Exploit preconditions

  • Attack surface: The ai-maestro agent runtime and its session-management

functionality

  • Required access: The ability to supply or influence input consumed by

killSessionSync; the exact access path depends on deployment design

  • Trigger point: Processing of session termination or cleanup through the

affected function

  • Why exploitation is possible: Crafted input may be interpreted as command

syntax rather than as data when used in an operating-system command

Why this happens

The underlying bug is an OS command construction and execution flaw. Input associated with session handling is apparently allowed to reach a system command without sufficient separation between data and command syntax. This behavior maps to CWE-78, Improper Neutralization of Special Elements used in an OS Command, commonly called OS command injection. The insecure pattern is dynamically composing shell commands from values that have not been treated as strictly trusted, structured arguments.

Potential impact

  • An attacker may execute arbitrary commands in the ai-maestro runtime context.
  • The vulnerability could expose application data, credentials, or secrets accessible to the process.
  • An attacker may alter, delete, or tamper with files and runtime state.
  • The compromise could enable lateral movement or broader system impact when excessive privileges are available.

General mitigation guidance

Mitigation generally centers on avoiding shell interpretation for session management operations. Secure-by-default alternatives include direct process APIs that pass a fixed executable and structured argument arrays, rather than constructing shell command strings. Input trust should be reduced through strict allowlists, typed validation, and canonicalization before values reach process-control logic; validation should not be the sole defense. Where shell execution cannot be eliminated, command templates and narrowly constrained arguments should be isolated behind a small trusted interface. Runtime processes should operate with least privilege, restricted filesystem and network permissions, and limited access to secrets.

How teams detect issues like this

Detection approaches include static analysis for shell-spawning APIs, interpolated command strings, string concatenation near process execution, and session-derived values passed to command runners. Code review should flag dynamic command construction, unclear trust boundaries, and cleanup paths that invoke shells. Runtime monitoring can enforce policies on child process creation, unexpected command interpreters, and unusual process ancestry. Automated security review tools may help identify these patterns in source and pull requests.

Sources

SourceLink
github.comgithub.com/23blocks-OS/ai-maestro/commit/06d54f0687ad1fc5898a688a92f7e1f2df56c475
github.comgithub.com/23blocks-OS/ai-maestro/security/advisories/GHSA-mf7j-vfrr-jmfh
github.comgithub.com/rajukani100/CVE-research/tree/main/ai-maestro-rce-advisory

Frequently asked

questions

It may be remotely exploitable if a network-facing feature or other exposed

interface allows an attacker to influence input processed by

killSessionSync. Exploitability depends on the application's access

controls and data flow.

Not necessarily. Authentication requirements depend on which interface

supplies the affected input and whether that interface is restricted to

trusted users or internal services.

Avoid shell command construction and invoke a fixed operation through a

structured process API with strictly validated arguments. Apply least

privilege to the runtime as defense in depth.

Define explicit trust boundaries, use allowlisted typed inputs, review all

process-execution paths, and enforce static-analysis and runtime policies

that detect unexpected command execution.

Find out what's already
exploitable in your codebase.