{"id":"CVE-2026-75858","aliases":["CVE-2026-75858","GHSA-wrj3-vj8c-784f"],"related":[],"kind":"vulnerability","state":"published","title":"CodeWhale rlm_eval before 0.8.64 Remote Code Execution","summary":"CodeWhale (packages codewhale / codewhale-tui) versions >= 0.8.41 and < 0.8.64 contain a remote code execution vulnerability in the rlm_eval tool. The tool's approval_requirement() returns ApprovalRequirement::Auto, which the engine treats as 'never prompt,' causing arbitrary model-supplied Python code to run in a python3 interpreter without consulting the user's configured --approval-policy and without any approval prompt or audit step. An attacker can induce the agent to execute arbitrary code via prompt injection in untrusted content the agent reads (a web page, fetched URL, repository file, or MCP tool result); the companion rlm_open tool can stage such content. Code runs on the user's machine at the user's privilege level. Fixed in 0.8.64.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"CodeWhale (packages codewhale / codewhale-tui) versions >= 0.8.41 and < 0.8.64 contain a remote code execution vulnerability in the rlm_eval tool. The tool's approval_requirement() returns ApprovalRequirement::Auto, which the engine treats as 'never prompt,' causing arbitrary model-supplied Python code to run in a python3 interpreter without consulting the user's configured --approval-policy and without any approval prompt or audit step. An attacker can induce the agent to execute arbitrary code via prompt injection in untrusted content the agent reads (a web page, fetched URL, repository file, or MCP tool result); the companion rlm_open tool can stage such content. Code runs on the user's machine at the user's privilege level. Fixed in 0.8.64.","source":"cvelist"},{"lang":"en","text":"### 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)","format":"markdown","source":"ghsa"},{"lang":"es","text":"Las versiones de CodeWhale (paquetes codewhale / codewhale-tui) >= 0.8.41 y < 0.8.64 contienen una vulnerabilidad de ejecución remota de código en la herramienta rlm_eval. La función approval_requirement() de la herramienta devuelve ApprovalRequirement::Auto, que el motor trata como ’nunca preguntar’, lo que provoca que código Python arbitrario suministrado por el modelo se ejecute en un intérprete python3 sin consultar la política de aprobación (--approval-policy) configurada por el usuario y sin ninguna solicitud de aprobación o paso de auditoría. Un atacante puede inducir al agente a ejecutar código arbitrario a través de inyección de prompt en contenido no confiable que el agente lee (una página web, URL obtenida, archivo de repositorio o resultado de herramienta MCP); la herramienta complementaria rlm_open puede preparar dicho contenido. El código se ejecuta en la máquina del usuario con el nivel de privilegio del usuario. Corregido en 0.8.64.","source":"nvd"}],"published":"2026-08-18T15:21:57.245Z","modified":"2026-10-22T22:10:00.250Z","severity":{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"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","score":8.5,"rating":"HIGH"},"severities":[{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"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","score":8.5,"rating":"HIGH"},{"scorer":"VulnCheck","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"HIGH"}],"cwes":["CWE-94","CWE-862"],"affected":[{"ranges":[{"type":"semver","introduced":"0.8.33","fixed":"0.8.41","status":"affected"},{"type":"semver","version":"0.8.41","status":"unaffected"}],"vendor":"Hmbown","product":"CodeWhale","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0.8.33","fixed":"0.8.41","status":"affected"},{"type":"semver","version":"0.8.41","status":"unaffected"}],"vendor":"Hmbown","product":"CodeWhale","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0.8.41","fixed":"0.8.64","status":"affected"},{"type":"semver","version":"0.8.64","status":"unaffected"}],"vendor":"Hmbown","product":"CodeWhale","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0.8.41","fixed":"0.8.64","status":"affected"},{"type":"semver","version":"0.8.64","status":"unaffected"}],"vendor":"Hmbown","product":"CodeWhale","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0.8.33","status":"affected","lastAffected":"0.8.41"}],"ecosystem":"crates.io","package":"deepseek-tui","purl":"pkg:cargo/deepseek-tui","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.8.33","status":"affected","fixed":"0.8.41"}],"ecosystem":"npm","package":"deepseek-tui","purl":"pkg:npm/deepseek-tui","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.8.41","status":"affected","fixed":"0.8.64"}],"ecosystem":"crates.io","package":"codewhale-tui","purl":"pkg:cargo/codewhale-tui","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.8.41","status":"affected","fixed":"0.8.64"}],"ecosystem":"npm","package":"codewhale","purl":"pkg:npm/codewhale","source":"ghsa"}],"references":[{"url":"https://github.com/Hmbown/CodeWhale/security/advisories/GHSA-wrj3-vj8c-784f","tags":["exploit","vendor-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/Hmbown/CodeWhale/commit/57f3c89471e27ac4032d9791f6885e5d4408c381","tags":["patch","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://www.vulncheck.com/advisories/codewhale-rlm-eval-before-remote-code-execution","tags":["third-party-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-75858","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/Hmbown/CodeWhale","tags":["package"],"sources":["ghsa"]}],"credits":["sai-sh"],"assigner":"VulnCheck","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2026-08-18T17:58:18.257Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-75858","url":"https://www.cve.org/CVERecord?id=CVE-2026-75858","licence":"CVE Terms of Use","modified":"2026-08-18T17:59:11.646Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-wrj3-vj8c-784f","url":"https://github.com/advisories/GHSA-wrj3-vj8c-784f","licence":"CC-BY-4.0","modified":"2026-09-04T19:00:04.292Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-75858","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-75858","licence":"Public domain","modified":"2026-10-22T22:10:00.250Z"}],"updatedAt":"2026-11-25T22:59:33.511Z","epss":{"score":0.00364,"percentile":0.22485,"date":"2026-11-30T12:00:22.000Z"}}