Impact
PyAthena prior to version 3.35.4 contains a SQL injection flaw due to improper quote‑escaping in DefaultParameterFormatter.format(). The formatter backslash‑escapes single quotes for DELETE and CTAS statements, while Athena and Trino do not treat backslashes as escape characters inside string literals. Consequently an attacker can supply a payload containing a single quote followed by SQL syntax, causing the parser to terminate the string prematurely and inject arbitrary statements. This enables data exfiltration via UNION SELECT, execution of destructive commands, and manipulation of CTAS destination and content. The flaw is exploitable by unauthenticated attackers.
Affected Systems
PyAthena, a Python client for Amazon Athena and Trino, versions 3.35.3 and earlier. Any environment that uses the library to build DELETE or CTAS queries from user input is vulnerable.
Risk and Exploitability
The CVSS score is 9.3, indicating critical severity. EPSS is not available and the vulnerability is not listed in the CISA KEV catalog, yet the high severity suggests a substantial impact if exploited. The likely attack vector involves an unauthenticated user triggering the library, such as through a web application or microservice that passes untrusted input to DELETE or CTAS queries. Because the flaw resides in code executed with the application’s privileges, an attacker can gain data access, modify or delete data, and potentially disrupt service availability.
OpenCVE Enrichment