byted-bytehouse-ai-query
Audited by Socket on Sep 21, 2026
3 alerts found:
Anomalyx2SecurityNo clear malicious behavior or supply-chain backdoor is present in the supplied fragment. The code does contain a significant potential SQL-injection and query-integrity risk because caller-controlled identifiers, filters, and parameters are interpolated into SQL without robust validation or parameterization. The fragment also appears corrupted or incomplete, with embedded SQL/prose and undefined variables, preventing reliable execution analysis. Review and repair the source, validate identifiers and numeric parameters, and use parameterized queries before deployment.
The code is a straightforward ClickHouse connection and query helper with no clear malicious behavior or supply-chain attack indicators. The primary security issue is verify=False, which disables TLS certificate validation and can expose credentials and database traffic to man-in-the-middle attacks. Raw SQL execution and result printing require careful caller control and may create injection or data-disclosure risks in consuming applications.
This module is security-sensitive because it turns external JSON file content into shell code and executes it using eval. Even with jq @sh applied to values, the JSON keys are not validated as safe shell identifiers, leaving a potential command-injection vector if an attacker can modify ~/.bytehouse_config.json (or otherwise influence its contents). No explicit malware (exfiltration/persistence/backdoors) is visible in the provided fragment, but the eval-based design is a significant risk that warrants review and likely replacement with a safer non-eval approach (e.g., strict key validation and direct environment assignment).