Summary
CodeWhale configurations before 0.8.64 may improperly trust the allow_shell parameter in a repository's project configuration file. A malicious repository can enable shell tools for the AI model, potentially causing arbitrary commands to run on a user's machine when the repository is cloned and opened without explicit consent.
Affected context
The vulnerability occurs in CodeWhale environments that automatically read project configuration from repositories and use the allow_shell setting to control access to shell-execution tools. Risk is present when a user opens a repository containing a configuration file that can alter this setting without sufficiently strict validation, review, or user confirmation.
Exploit preconditions
- Attack surface: Repository project configuration processing
- Required access: Ability to commit or otherwise distribute a malicious project configuration file
- Trigger point: The victim clones and opens the repository in CodeWhale
- Why exploitation is possible: Insufficient validation allows the configuration to enable shell tools, which can then be used by the AI model to execute commands on the host
Why this happens
The underlying bug is inadequate validation and trust handling for a security-sensitive configuration parameter. CodeWhale treats the allow_shell value from repository-controlled configuration as sufficient to authorize shell-capable tools, rather than treating it as untrusted input requiring strict policy enforcement and explicit user approval. This maps to CWE-94 because attacker-controlled configuration can influence the availability of functionality that executes commands as code.
Potential impact
- An attacker could execute arbitrary shell commands on the victim's machine
- Local files or credentials may be accessed or modified
- Malicious processes or persistence mechanisms could be created
- The user's development environment could be compromised
- Repository-based supply-chain attacks could affect additional systems
General mitigation guidance
Mitigation generally focuses on reducing trust in repository-controlled
configuration and keeping shell execution disabled by default.
Common defensive patterns include:
- Require explicit, interactive user approval before enabling shell-capable tools
- Treat configuration values from repositories as untrusted and apply strict allowlists
- Separate model tool availability from project configuration whenever possible
- Require elevated confirmation for commands with filesystem, network, or process impact
- Run optional shell operations with least privilege and appropriate sandboxing
- Apply repository trust policies and avoid automatically activating sensitive features
- Preserve clear audit records for configuration changes and tool invocations
How teams detect issues like this
Detection approaches can include:
- Static analysis for configuration values that directly enable command execution
- Code review checks for security-sensitive settings sourced from repository files
- Tests verifying that malformed, unexpected, or untrusted allow_shell values cannot activate tools
- Policy enforcement that blocks automatic activation of shell capabilities in untrusted repositories
- Runtime logging and alerting for shell-tool enablement and command execution
- Automated security review tools that identify trust-boundary violations in configuration handling

