CVE-2026-75858: CodeWhale Remote Code Execution Vulnerability

HIGH
Advisory Identifier: GHSA-wrj3-vj8c-784f
CVSS 7.8
CWE-94 CWE-862
Published
Advisory Summary

CVE-2026-75858 is a HIGH (CVSS 7.8) remote code execution vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting CodeWhale libraries in the crates.io ecosystem. The issue involves rlm_eval auto-approves arbitrary python execution, bypassing the user's approval policy (rce). Remediation is available by upgrading affected packages to version 0.8.41, 0.8.64.

CVE-2026-75858 at a Glance

CVE Identifier CVE-2026-75858
GHSA Identifier GHSA-wrj3-vj8c-784f
Severity HIGH
CVSS v3.1 Base Score 7.8
CWE Classification CWE-94: Improper Control of Generation of Code ('Code Injection')
Affected Product CodeWhale
Package Ecosystem crates.io
Published Date
Last Updated

Security Impact

CVSS: 7.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-75858

To remediate this vulnerability, upgrade all affected CodeWhale dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

deepseek-tui fixed: Latest secure release
Upgrade deepseek-tui to Latest secure release
deepseek-tui fixed: 0.8.41
npm install deepseek-tui@0.8.41
codewhale-tui fixed: 0.8.64
Upgrade codewhale-tui to 0.8.64
codewhale fixed: 0.8.64
npm install codewhale@0.8.64
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for deepseek-tui

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-75858, inspect your project dependencies for CodeWhale:

inspect dependencies for deepseek-tui

Analyze the terminal output to locate any version of CodeWhale in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.8.41), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In CodeWhale, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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 The `rlm_eval` tool runs an arbitrary Python string chosen by the model in a real `python3` interpreter. Its `approval_requirement()` returns `ApprovalRequirement::Auto`, which the engine treats as "never prompt," regardless of the user's configured `--approval-policy`. A single tool call — which prompt injection from any untrusted content the agent reads (a web page, a fetched URL, a repo file, an MCP tool result) can induce — runs code on the user's machine at the user's privilege with no prompt and no audit step. This is the same defect that was already patched on the sibling `run_tests` tool (CVE-2026-45311); the fix never reached `rlm_eval` or `rlm_open`, which expose a broader surface (full Python on the host, not just `cargo test`). ### Details `rlm_eval`'s `execute()` reads the LLM-controlled `code` field and runs it (`crates/tui/src/tools/rlm.rs:215-300`): ```rust fn capabilities(&self) -> Vec<ToolCapability> { vec![ToolCapability::Network, ToolCapability::ExecutesCode] } fn approval_requirement(&self) -> ApprovalRequirement { ApprovalRequirement::Auto // overrides the safe default below } async fn execute(&self, input: Value, context: &ToolContext) -> Result<ToolResult, ToolError> { let name = required_non_empty_str(&input, "name")?; let code = required_non_empty_str(&input, "code")?; // LLM-controlled ... let round = kernel.run(code, Some(&bridge)).await... // runs that code in python3 ``` The trait default at `crates/tui/src/tools/spec.rs:632-633` would have returned `Required` for any tool whose capabilities include `ExecutesCode`. `rlm_eval` deliberately overrides that to `Auto`. The engine's approval gate (`crates/tui/src/core/engine.rs:845`) is two AND-ed conditions, and a per-tool `Auto` makes the first one false: ```rust let approval_required = spec.approval_requirement() != ApprovalRequirement::Auto && !registry.context().auto_approve; ``` When `approval_requirement()` is `Auto`, `approval_required` is `false`, no `Event::ApprovalRequired` is emitted, and the user's `--approval-policy` (`on-request`, `unless-trusted`, `never`) is never consulted. The companion tool `rlm_open` (`rlm.rs:142-143`, same `Auto`, capabilities include `ExecutesCode` + `Network`) spawns the same Python kernel via `PythonRuntime::spawn_with_context` (`rlm.rs:181`) and can stage a `content` string, a `file_path` read, or a `url` fetch into the kernel before `rlm_eval` runs against it. Both tools are registered unconditionally by the default registry (`crates/tui/src/tools/registry.rs:802-803`); there is no flag to disable them. ### PoC Source-level reproduction. Point a provider's `base_url` at a local mock that returns canned `tool_calls`, then have the agent call `rlm_open` followed by `rlm_eval` with a `code` payload such as: ```python import os, getpass, socket open('/tmp/pwned_by_rlm_eval','w').write(getpass.getuser()+'@'+socket.gethostname()+':'+os.getcwd()) ``` Run it through the non-interactive path (`codewhale exec --auto`) to confirm the tool executes, and through the plain interactive TUI under `--approval-policy on-request` (no `--auto`, no `--yolo`) to confirm no approval dialog appears. The sentinel file is written either way; the interactive run is the one that proves the policy is bypassed rather than waived. ### Impact Unsandboxed code execution on the user's workstation at the user's UID: read SSH keys, cloud credentials, `~/.codewhale/auth.json`, and other secrets; write to shell rc files or `authorized_keys` for persistence; spawn subprocesses; reach the network. No filesystem, network, or process sandbox is applied to the spawned interpreter. Reachable with user interaction (running the agent over attacker-influenced content), no further prompt. ### Credit [sai-sh](https://github.com/sai-sh)

CVE-2026-75858 Affected CodeWhale Versions

4 component(s)
Fixed Versions:
0.8.410.8.64
Product / Package Ecosystem Affected Versions Fixed Version
deepseek-tui
crates.io
≥ 0.8.33
≤ 0.8.41
deepseek-tui
npm
≥ 0.8.33
< 0.8.41
0.8.41
codewhale-tui
crates.io
≥ 0.8.41
< 0.8.64
0.8.64
codewhale
npm
≥ 0.8.41
< 0.8.64
0.8.64

References

Frequently Asked Questions

What is CVE-2026-75858?
CVE-2026-75858 is a security vulnerability in CodeWhale involving rlm_eval auto-approves arbitrary Python execution, bypassing the user's approval policy (RCE) under CWE-94: Improper Control of Generation of Code ('Code Injection').
Which CodeWhale versions are affected?
Affected versions include releases prior to 0.8.41, 0.8.64 across affected packages: deepseek-tui, codewhale-tui, codewhale.
What version fixes CVE-2026-75858?
Upgrading to 0.8.41, 0.8.64 (or the latest patched release for your respective branch) resolves the vulnerability.
Is deepseek-tui affected?
Yes, deepseek-tui is affected in releases prior to Latest secure release, 0.8.41. Upgrade your dependency to Latest secure release, 0.8.41 or later.
Is codewhale-tui affected?
Yes, codewhale-tui is affected in releases prior to 0.8.64. Upgrade your dependency to 0.8.64 or later.
What is the CVSS score of CVE-2026-75858?
CVE-2026-75858 has a CVSS v3.1 base score of 7.8 (HIGH) with vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2026-75858?
CVE-2026-75858 is classified under CWE-94: Improper Control of Generation of Code ('Code Injection') (The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.).
How can I check crates.io dependencies for CVE-2026-75858?
Run the dependency tree command: 'inspect dependencies for deepseek-tui'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-wrj3-vj8c-784f",
  "modified" : "2026-09-04T18:12:15Z",
  "published" : "2026-09-04T18:12:15Z",
  "aliases" : [ "CVE-2026-75858" ],
  "summary" : "CodeWhale: rlm_eval auto-approves arbitrary Python execution, bypassing the user's approval policy (RCE)",
  "details" : "### Maintainer resolution\n\nThe 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.\n\n### Summary\nThe `rlm_eval` tool runs an arbitrary Python string chosen by the model in a real `python3` interpreter. Its `approval_requirement()` returns `ApprovalRequirement::Auto`, which the engine treats as \"never prompt,\" regardless of the user's configured `--approval-policy`. A single tool call — which prompt injection from any untrusted content the agent reads (a web page, a fetched URL, a repo file, an MCP tool result) can induce — runs code on the user's machine at the user's privilege with no prompt and no audit step. This is the same defect that was already patched on the sibling `run_tests` tool (CVE-2026-45311); the fix never reached `rlm_eval` or `rlm_open`, which expose a broader surface (full Python on the host, not just `cargo test`).\n\n### Details\n`rlm_eval`'s `execute()` reads the LLM-controlled `code` field and runs it (`crates/tui/src/tools/rlm.rs:215-300`):\n\n```rust\nfn capabilities(&self) -> Vec<ToolCapability> {\n    vec![ToolCapability::Network, ToolCapability::ExecutesCode]\n}\n\nfn approval_requirement(&self) -> ApprovalRequirement {\n    ApprovalRequirement::Auto          // overrides the safe default below\n}\n\nasync fn execute(&self, input: Value, context: &ToolContext) -> Result<ToolResult, ToolError> {\n    let name = required_non_empty_str(&input, \"name\")?;\n    let code = required_non_empty_str(&input, \"code\")?;   // LLM-controlled\n    ...\n    let round = kernel.run(code, Some(&bridge)).await...   // runs that code in python3\n```\n\nThe trait default at `crates/tui/src/tools/spec.rs:632-633` would have returned `Required` for any tool whose capabilities include `ExecutesCode`. `rlm_eval` deliberately overrides that to `Auto`.\n\nThe engine's approval gate (`crates/tui/src/core/engine.rs:845`) is two AND-ed conditions, and a per-tool `Auto` makes the first one false:\n\n```rust\nlet approval_required = spec.approval_requirement() != ApprovalRequirement::Auto\n    && !registry.context().auto_approve;\n```\n\nWhen `approval_requirement()` is `Auto`, `approval_required` is `false`, no `Event::ApprovalRequired` is emitted, and the user's `--approval-policy` (`on-request`, `unless-trusted`, `never`) is never consulted. The companion tool `rlm_open` (`rlm.rs:142-143`, same `Auto`, capabilities include `ExecutesCode` + `Network`) spawns the same Python kernel via `PythonRuntime::spawn_with_context` (`rlm.rs:181`) and can stage a `content` string, a `file_path` read, or a `url` fetch into the kernel before `rlm_eval` runs against it. Both tools are registered unconditionally by the default registry (`crates/tui/src/tools/registry.rs:802-803`); there is no flag to disable them.\n\n### PoC\nSource-level reproduction. Point a provider's `base_url` at a local mock that returns canned `tool_calls`, then have the agent call `rlm_open` followed by `rlm_eval` with a `code` payload such as:\n\n```python\nimport os, getpass, socket\nopen('/tmp/pwned_by_rlm_eval','w').write(getpass.getuser()+'@'+socket.gethostname()+':'+os.getcwd())\n```\n\nRun it through the non-interactive path (`codewhale exec --auto`) to confirm the tool executes, and through the plain interactive TUI under `--approval-policy on-request` (no `--auto`, no `--yolo`) to confirm no approval dialog appears. The sentinel file is written either way; the interactive run is the one that proves the policy is bypassed rather than waived.\n\n### Impact\nUnsandboxed code execution on the user's workstation at the user's UID: read SSH keys, cloud credentials, `~/.codewhale/auth.json`, and other secrets; write to shell rc files or `authorized_keys` for persistence; spawn subprocesses; reach the network. No filesystem, network, or process sandbox is applied to the spawned interpreter. Reachable with user interaction (running the agent over attacker-influenced content), no further prompt.\n\n### Credit\n[sai-sh](https://github.com/sai-sh)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "deepseek-tui"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.8.33"
      }, {
        "last_affected" : "0.8.41"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "deepseek-tui"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.8.33"
      }, {
        "fixed" : "0.8.41"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "codewhale-tui"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.8.41"
      }, {
        "fixed" : "0.8.64"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "codewhale"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.8.41"
      }, {
        "fixed" : "0.8.64"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/Hmbown/CodeWhale/security/advisories/GHSA-wrj3-vj8c-784f"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-75858"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Hmbown/CodeWhale/commit/57f3c89471e27ac4032d9791f6885e5d4408c381"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/Hmbown/CodeWhale"
  }, {
    "type" : "WEB",
    "url" : "https://www.vulncheck.com/advisories/codewhale-rlm-eval-before-remote-code-execution"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-862", "CWE-94" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-09-04T18:12:15Z",
    "nvd_published_at" : "2026-08-18T16:18:21Z"
  }
}