CVE-2026-65321 Details
Description
PyAthena prior to 3.35.4 contains a sql injection vulnerability that allows unauthenticated attackers to inject arbitrary SQL by exploiting improper quote-escaping in DefaultParameterFormatter.format(), which routes DELETE and CTAS statements to the _escape_hive function that backslash-escapes single quotes rather than doubling them. Because Athena and Trino do not treat backslashes as escape characters inside string literals, attacker-supplied input such as a single quote followed by SQL syntax causes the parser to terminate the string literal prematurely, enabling data exfiltration via UNION SELECT, execution of destructive statements, and attacker-controlled CTAS destination and content.
A SQL injection vulnerability has been identified in PyAthena versions prior to 3.35.4. The issue arises in the DefaultParameterFormatter.format() method, which improperly escapes quotes in DELETE and CTAS (CREATE TABLE AS SELECT) statements. This flaw allows unauthenticated attackers to inject arbitrary SQL. The vulnerability exploits the fact that Athena and Trino do not recognize backslashes as escape characters within string literals. By supplying input such as a single quote followed by SQL syntax, an attacker can prematurely terminate a string literal, leading to SQL injection. The consequences include data exfiltration via UNION SELECT, execution of destructive SQL statements, and manipulation of CTAS destinations and content.
Users can upgrade to PyAthena version 3.35.4, which addresses the vulnerability by correcting the quote-escaping method for DELETE and CTAS statements. Alternatively, until an upgrade is possible, avoid using untrusted parameter values in DELETE or CTAS statements.
Metrics
CVSS 4.0 Severity and Vector Strings:
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
Volerion
Assessed Aug 2, 2026CISA-ADP
Assessed Aug 3, 2026References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| laughingman7743 PyAthena | <= 3.35.3 (semver) |
CPE
Remediation
| |
Change History
4 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Aug 6, 2026 | CVE Modified | [email protected] |
| Aug 3, 2026 | CVE Modified | [email protected] |
| Aug 3, 2026 | CVE Modified | CISA-ADP |
| Aug 2, 2026 | New CVE Received | [email protected] |
Volerion