Summary
A code injection vulnerability in CHIRP allows crafted CSV data to reach an unsafe eval operation in the Kenwood ITM driver's _clean_tmode function. If an attacker can supply or induce processing of malicious CSV content, the application may execute unintended Python expressions with the privileges of the CHIRP process.
Affected context
The issue occurs in CHIRP's Kenwood ITM driver when imported or otherwise processed CSV data is passed through _clean_tmode. Deployments are at risk when CSV files can be obtained from untrusted sources, uploaded by users, synchronized from external systems, or processed without adequate content validation.
Exploit preconditions
- Attack surface: CSV import or processing through the Kenwood ITM driver
- Required access: Ability to provide, modify, or cause processing of a crafted CSV file
- Trigger point: Handling of the affected data in
_clean_tmode - Why exploitation is possible: CSV-derived content reaches an evaluation mechanism that interprets input as executable Python expression content rather than treating it solely as data
Why this happens
The underlying bug is dynamic evaluation of input-derived text. Use of eval on values originating from CSV data allows attacker-controlled content to be interpreted as code, matching CWE-95: Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection'). The insecure pattern is treating external data as executable logic instead of parsing it with explicit, non-executable conversion rules.
Potential impact
- An attacker may execute arbitrary code in the CHIRP process context
- Local files or configuration data could be read, altered, or deleted
- Sensitive credentials available to the process could be exposed
- The host environment could be modified or used for further compromise
- Imported radio configuration data could be corrupted or manipulated
General mitigation guidance
Mitigation generally focuses on removing dynamic evaluation from data-processing paths.
Common defensive patterns include:
- Replacing
evalwith explicit parsing, mapping, or type-conversion logic - Treating CSV fields as untrusted data regardless of their source
- Applying allowlisted formats and strict schema validation before transformation
- Rejecting unexpected characters, structures, and values without attempting interpretation
- Processing imported files with least-privileged operating-system accounts
- Isolating file-processing workflows and limiting access to sensitive resources
- Keeping imported data and executable application logic in separate trust domains
How teams detect issues like this
Detection can include static analysis rules that identify eval or equivalent dynamic execution APIs operating on file, CSV, or user-controlled input. Code review should examine data flows from import functions into expression evaluators, conversion routines, and driver-specific cleanup methods.
Policy enforcement may require approved parsing libraries, prohibit dynamic evaluation in ingestion code, and add regression tests for hostile and malformed CSV values. Automated code review and security scanning tools can help identify these patterns during development.

