Security context

What an agent needs to avoid regressing past fixes and find the next vuln in this repo.

tobymao/sqlglot
main @ 075eaf5
3
Fixes
0
CVEs
HIGH
Peak severity
66.7%
Coverage
Highlights
Code Injection: 1 prior fix. Scrutinize any change in this area.
sqlglot/executor/python.py: most-fixed (1 issue). Treat as high-risk during review.
3 high-severity fixes in this history; regressions here are high-impact.
Recurring patterns

The bug types that recur here, drawn from past fixes, not open vulnerabilities.

Code Injection: The SQLGlot Python executor generated Python code from an AST without adequately escaping backslashes in string literals. This allowed malicious input to escape string boundaries and inject arbitrary Python commands during execution. Developers must ensure string-escaping mechanisms are consistently applied to all nodes when emitting Python code.
Path Traversal: During table qualification in query optimization, the engine automatically scanned and read local CSV files if a user-supplied query referenced them. Disabling automatic file reading/schema inference by default prevents unauthorized reading of arbitrary local system files.
SQL Injection: An issue in the dialect generator allowed unescaped block comment markers (such as /* and */) to pass into generated SQL. A malicious input could prematurely terminate comments to inject arbitrary SQL statements. Escaping comment syntax is critical across all generated dialects.