/

CVE-2026-75857

Severity:

HIGH RISK

(7.0)

Improper Privilege Management (CWE-269) in CodeWhale Tool

CVE-2026-75857

Deferred

Vulnerability type

Category:

Improper Privilege Management

CWE:

CWE-269

Impact:

Unauthorized Command Execution

Severity:

HIGH RISK

(7.0)

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

CodeWhale versions in the affected release range allow the exec_shell_interact tool to treat an interactive shell as automatically approved, bypassing the approval normally required for code-executing tools. If an attacker can inject instructions through content ingested by the agent, commands may run through an already-approved session with that process's privileges.

Affected context

The vulnerability occurs in CodeWhale deployments that expose the exec_shell_interact or exec_interact tool and permit the agent to interact with long-running shell processes. It becomes risky when untrusted content can influence agent instructions and an interactive process, such as a Python REPL, database client, SSH session, or elevated shell, has already been approved.

Exploit preconditions

  • Attack surface: CodeWhale's interactive shell execution tool
  • Required access: Ability to influence content consumed by the agent, such as fetched pages, MCP results, or repository files
  • Trigger point: LLM-controlled input is written to an already-approved long-running interactive shell
  • Why exploitation is possible: The tool reports automatic approval instead of requiring approval for each code-executing interaction, allowing injected instructions to reuse the privileges of the approved process

Why this happens

The underlying issue is an authorization-state error in the tool's approval policy. The approval_requirement implementation returns an automatic-approval result for an interactive execution capability that should retain the default required-approval behavior.

This maps to CWE-269: Improper Privilege Management, because the system permits agent-controlled actions to inherit the authority of an approved process without sufficiently rechecking whether each subsequent command or input is authorized. The insecure pattern is treating approval for a long-running session as approval for all future commands sent to that session.

Potential impact

  • Commands may execute with the privileges of the approved interactive process
  • An attacker could alter files, access data, or modify application state
  • An elevated shell session could enable broader system compromise
  • Database, remote-host, or repository operations could be performed without an additional approval prompt
  • Agent-integrated workflows could be abused through indirect prompt injection

General mitigation guidance

Mitigation generally focuses on preserving authorization boundaries for every code-executing interaction.

Common defensive patterns include:

  • Require explicit approval for interactive shell input, including subsequent writes to an existing session
  • Avoid treating approval of a process launch as approval for all commands executed within that process
  • Separate untrusted agent content from privileged execution channels
  • Use allowlists for permitted tools, commands, destinations, and session types
  • Run agent-controlled processes with the minimum required operating-system and service privileges
  • Prefer isolated, short-lived execution environments for tasks that process untrusted content
  • Apply confirmation and policy checks before interactions with elevated shells, remote systems, databases, or credential-bearing sessions
  • Record and review approval decisions, session commands, and tool-call provenance

How teams detect issues like this

Detection approaches can include:

  • Static analysis for approval handlers that return automatic approval for code-executing or interactive tools
  • Code review checks verifying that each interactive command or stdin write is independently authorized
  • Tests that place an approved long-running process behind the normal approval policy and confirm later inputs still require authorization
  • Policy enforcement preventing agent-controlled content from directly reaching privileged shell sessions
  • Runtime monitoring for unexpected tool calls, shell input, privilege transitions, remote connections, or database activity following ingestion of external content
  • Automated security review tools configured to flag approval-state reuse and missing authorization checks

Sources

SourceLink
github.comgithub.com/Hmbown/CodeWhale/commit/57f3c89471e27ac4032d9791f6885e5d4408c381
github.comgithub.com/Hmbown/CodeWhale/security/advisories/GHSA-g29h-pfmp-qp9r
vulncheck.comvulncheck.com/advisories/codewhale-before-privilege-escalation-via-exec-shell-interact

Frequently asked

questions

It may be exploitable indirectly when the agent ingests attacker-controlled content from a fetched page, MCP result, repository file, or similar source. The attacker generally does not need direct shell access if that content can influence the agent's actions.

An attacker needs a way to inject or control instructions in content processed by the agent, and the deployment must expose the affected interactive execution tool. The existence of an already-approved interactive process is also relevant.

Preserve required approval for every code-executing interaction, including stdin written to an existing long-running shell. Approval should be tied to the specific action and context rather than reused for an entire session.

Enforce least privilege, isolate agent execution, treat external content as untrusted, test approval boundaries for stateful tools, and monitor for unexpected commands after content ingestion.

Find out what's already
exploitable in your codebase.