Summary
aider automatically loads a repository-level .aider.conf.yml file and can execute configured test or lint commands through a shell without confirmation. A user who launches aider from a crafted repository may therefore allow arbitrary commands to run on their local machine, even without an API key or LLM interaction.
Affected context
The issue occurs when aider is launched from a Git repository containing an attacker-controlled .aider.conf.yml file. Risk depends on whether the configuration is automatically discovered and whether configured test-cmd or lint-cmd values are executed through a shell during startup or after a file edit. Users who clone or otherwise open untrusted repositories and run aider in them are most exposed.
Exploit preconditions
- Attack surface: Repository-local configuration loading and command execution
- Required access: Ability to supply or modify the repository contents
- Trigger point: aider startup for
test-cmd, or the first file edit forlint-cmd - User interaction: No additional confirmation, LLM request, or API key is required after aider is launched in the repository
- Why exploitation is possible: Configuration values are treated as shell commands and executed with shell interpretation
Why this happens
The underlying flaw is a trust-boundary failure in repository configuration handling. aider automatically accepts command-bearing configuration values from a potentially untrusted repository and passes them to a shell, allowing configuration data to become executable behavior. This maps to CWE-94: Improper Control of Generation of Code, because attacker-controlled input influences the generation or execution of commands.
Potential impact
- Arbitrary commands could execute with the privileges of the aider process
- Local files, credentials, or source code may be accessed or modified
- Developer environments could be altered or compromised
- Malware or persistence mechanisms could be installed
- Connected development, build, or deployment systems may be exposed
General mitigation guidance
Mitigation generally focuses on reducing trust in repository-local configuration and avoiding implicit shell execution.
Common defensive patterns include:
- Treating configuration files from untrusted repositories as untrusted input
- Requiring explicit user consent before executing configured commands
- Disabling automatic execution of repository-defined hooks by default
- Using narrowly defined executable and argument representations instead of shell command strings
- Avoiding shell interpretation where it is not required
- Running repository automation with least-privilege accounts and isolated environments
- Separating editing functionality from command execution and applying clear trust-boundary checks
How teams detect issues like this
Organizations can look for:
- Static analysis rules identifying
shell=Trueor equivalent shell-spawning APIs - Code review signals where repository configuration values flow into subprocess execution
- Tests that launch tools from repositories containing unexpected command-bearing configuration
- Policy checks requiring confirmation for commands sourced from project files
- Endpoint monitoring for child processes spawned by developer tools during startup or file-edit events
- Automated security review tools that trace untrusted configuration data into command execution

