CVE-2026-75857
JSON

7.3high

CodeWhale before 0.8.64 Privilege Escalation via exec_shell_interact

Severity
7.3high CVSS:4.0 by VulnCheck
Exploit likelihood
0.22% (higher than 14% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
VulnCheck
Also known as
GHSA-g29h-pfmp-qp9r

Description

CodeWhale versions >= 0.3.10 and < 0.8.64 (published as deepseek-tui >= 0.3.10 and < 0.8.41 on npm and 0.3.10 through 0.8.41 on crates.io, and as codewhale / codewhale-tui >= 0.8.41 and < 0.8.64) contain a vulnerability in the exec_shell_interact (alias exec_interact) tool, whose approval_requirement returns ApprovalRequirement::Auto. This overrides the default Required approval for code-executing tools, so LLM-controlled stdin is written into an already-approved long-running interactive shell (e.g., a python3 -i REPL, mysql, ssh, or sudo -i session) without any approval prompt. An attacker who can inject instructions via untrusted content the agent ingests (a fetched page, MCP result, or repo file) can cause commands to run at the privilege level of that approved process. Fixed in codewhale / codewhale-tui 0.8.64; the deprecated deepseek-tui crate has no fixed release.

Affected

Product or packageVersionsReported by
Hmbown CodeWhalefrom 0.3.10 up to 0.8.41, from 0.3.10 before 0.8.41, from 0.8.41 before 0.8.64
Not affected: 0.8.41, 0.8.64
CVE List
deepseek-tui (crates.io)from 0.3.10 up to 0.8.41GitHub Advisory Database
deepseek-tui (npm)from 0.3.10 before 0.8.41GitHub Advisory Database
codewhale-tui (crates.io)from 0.8.41 before 0.8.64GitHub Advisory Database
codewhale (npm)from 0.8.41 before 0.8.64GitHub Advisory Database

All scores

VulnCheck7.3high CVSS:4.0CVSS:4.0/AV:L/AC:H/AT:P/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
VulnCheck7.0high CVSS:3.1CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H
GitHub7.0high CVSS:3.1CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H
GitHubhigh CVSS:4.0CVSS:4.0/AV:L/AC:H/AT:P/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Classification

CWE-269

SSVC (CISA-ADP): exploitation poc, automatable no, technical impact total.

What each source says

CVE List

CodeWhale versions >= 0.3.10 and < 0.8.64 (published as deepseek-tui >= 0.3.10 and < 0.8.41 on npm and 0.3.10 through 0.8.41 on crates.io, and as codewhale / codewhale-tui >= 0.8.41 and < 0.8.64) contain a vulnerability in the exec_shell_interact (alias exec_interact) tool, whose approval_requirement returns ApprovalRequirement::Auto. This overrides the default Required approval for code-executing tools, so LLM-controlled stdin is written into an already-approved long-running interactive shell (e.g., a python3 -i REPL, mysql, ssh, or sudo -i session) without any approval prompt. An attacker who can inject instructions via untrusted content the agent ingests (a fetched page, MCP result, or repo file) can cause commands to run at the privilege level of that approved process. Fixed in codewhale / codewhale-tui 0.8.64; the deprecated deepseek-tui crate has no fixed release.

GitHub Advisory Database
Maintainer resolution

The CodeWhale maintainers validated this report. The affected package ranges are recorded in the advisory metadata. Version 0.8.64 contains the fix in commit 57f3c89471e27ac4032d9791f6885e5d4408c381. Users should upgrade to 0.8.64 or later. The original reporter analysis is preserved below.

Summary

exec_shell is correctly approval-gated. Its sibling exec_shell_interact returns ApprovalRequirement::Auto, so when the model writes input into a shell the user already approved (a python3 -i REPL, mysql, ssh, sudo -i, etc.), no prompt fires. Inside those processes, "stdin" is the command surface, so the model gets to run commands at whatever privilege that process holds. The user approved opening the shell once, for a stated purpose; the input that then runs in it is chosen by the model, and can be steered by any prompt injection the agent ingests afterward.

Details

The vulnerability requires two ordinary preconditions: shell tools are enabled (the normal config for using CodeWhale as a coding agent), and the session already has one approved long-running interactive process. After that, any untrusted content the agent reads can drive a exec_shell_interact call.

crates/tui/src/tools/shell.rs:2834-2910:

fn capabilities(&self) -> Vec<ToolCapability> {
    vec![ToolCapability::ExecutesCode]
}

fn approval_requirement(&self) -> ApprovalRequirement {
    ApprovalRequirement::Auto          // overrides the Required-for-ExecutesCode default
}

async fn execute(&self, input: Value, context: &ToolContext) -> Result<ToolResult, ToolError> {
    let task_id = required_task_id(&input)?;
    let close_stdin = optional_bool(&input, "close_stdin", false);
    let interaction_input = input
        .get("input").or_else(|| input.get("stdin")).or_else(|| input.get("data"))  // LLM-controlled
        .and_then(serde_json::Value::as_str).unwrap_or("");
    {
        let mut manager = context.shell_manager.lock()...;
        if !interaction_input.is_empty() || close_stdin {
            manager.write_stdin(task_id, interaction_input, close_stdin)...;          // no prompt
        }
    }
    ...
}

Same gate as the rlm_eval finding: the Auto at approval_requirement() makes approval_required false at engine.rs:845, so the --approval-policy is never consulted for the stdin write. The trait default at spec.rs:632 would have been Required. The tool is registered unconditionally (registry.rs:527), and an alias exec_interact on the same struct is registered at registry.rs:530, so a fix must cover both names (it does, since they share ShellInteractTool).

PoC
  1. User asks the agent to open a REPL; the model calls exec_shell command="python3 -i"; the user sees and approves it once.
  2. Later in the session, untrusted content (a fetched page, an MCP result, a repo AGENTS.md) instructs the model to send a payload to the open REPL.
  3. The model calls exec_shell_interact task_id=<repl> input="import os; os.system('...')\n". No prompt fires; Python runs it.

Driving the interactive TUI through a pty and scanning the output for an approval dialog shows the only Approval needed: lines are for the initial exec_shell; exec_shell_interact never produces one, while a sentinel file proves the injected input ran.

When the approved process is privileged, the reach scales with it: mysql -u root becomes arbitrary SQL, ssh host becomes commands on the remote host, sudo -i becomes root — none re-prompted.

Impact

Code or command execution inside an already-approved process, at that process's privilege level, with no prompt for the escalating input. Lower severity than the rlm_eval finding because it needs a prior user approval of an interactive shell, but higher reach when that shell is privileged.

Credit

sai-sh

NVD (es)

Las versiones de CodeWhale >= 0.8.41 y < 0.8.64 contienen una vulnerabilidad en la herramienta exec_shell_interact (alias exec_interact), cuyo approval_requirement devuelve ApprovalRequirement::Auto. Esto anula la aprobación predeterminada ’Required’ para herramientas de ejecución de código, por lo que la entrada estándar (stdin) controlada por LLM se escribe en un shell interactivo de larga duración ya aprobado (por ejemplo, un REPL de python3 -i, MySQL, ssh o una sesión de sudo -i) sin ninguna solicitud de aprobación. Un atacante que puede inyectar instrucciones a través de contenido no confiable que el agente ingiere (una página obtenida, un resultado de MCP o un archivo de repositorio) puede hacer que los comandos se ejecuten con el nivel de privilegio de ese proceso aprobado. Corregido en 0.8.64.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-75857 changed 2026-10-29CVE Terms of Use
GitHub Advisory DatabaseGHSA-g29h-pfmp-qp9r changed 2026-09-04CC-BY-4.0
NVDCVE-2026-75857 changed 2026-10-29Public domain