CVE-2026-65321: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') in laughingman7743 PyAthena
PyAthena versions prior to 3.35.4 contain a critical SQL injection vulnerability due to improper handling of special characters in SQL commands. The issue arises from the DefaultParameterFormatter.format() method, which incorrectly escapes single quotes using backslashes instead of doubling them. Since Athena and Trino do not recognize backslashes as escape characters in string literals, this flaw allows attackers to prematurely terminate string literals and inject arbitrary SQL. This can lead to data exfiltration, execution of destructive SQL statements, and attacker-controlled creation of tables via CTAS statements.
AI Analysis
Technical Summary
CVE-2026-65321 is a critical SQL injection vulnerability in PyAthena before version 3.35.4. The vulnerability stems from improper quote-escaping in DefaultParameterFormatter.format(), which routes DELETE and CTAS statements to a 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 input containing a single quote followed by SQL syntax can prematurely terminate the string literal. This enables attackers to perform UNION SELECT queries for data exfiltration, execute destructive SQL commands, and control CTAS statement destinations and contents.
Potential Impact
An unauthenticated attacker can exploit this vulnerability to inject arbitrary SQL commands. This can lead to unauthorized data access and exfiltration, execution of destructive SQL statements that may alter or delete data, and creation of attacker-controlled tables. The vulnerability affects the confidentiality, integrity, and availability of data accessed via PyAthena.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is available, avoid using vulnerable versions of PyAthena in untrusted environments. Review and restrict the use of DELETE and CTAS statements where possible. Monitor vendor channels for updates and apply patches promptly once released.
CVE-2026-65321: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') in laughingman7743 PyAthena
Description
PyAthena versions prior to 3.35.4 contain a critical SQL injection vulnerability due to improper handling of special characters in SQL commands. The issue arises from the DefaultParameterFormatter.format() method, which incorrectly escapes single quotes using backslashes instead of doubling them. Since Athena and Trino do not recognize backslashes as escape characters in string literals, this flaw allows attackers to prematurely terminate string literals and inject arbitrary SQL. This can lead to data exfiltration, execution of destructive SQL statements, and attacker-controlled creation of tables via CTAS statements.
CVSS v4.0
Score 9.3critical
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
CVE-2026-65321 is a critical SQL injection vulnerability in PyAthena before version 3.35.4. The vulnerability stems from improper quote-escaping in DefaultParameterFormatter.format(), which routes DELETE and CTAS statements to a 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 input containing a single quote followed by SQL syntax can prematurely terminate the string literal. This enables attackers to perform UNION SELECT queries for data exfiltration, execute destructive SQL commands, and control CTAS statement destinations and contents.
Potential Impact
An unauthenticated attacker can exploit this vulnerability to inject arbitrary SQL commands. This can lead to unauthorized data access and exfiltration, execution of destructive SQL statements that may alter or delete data, and creation of attacker-controlled tables. The vulnerability affects the confidentiality, integrity, and availability of data accessed via PyAthena.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is available, avoid using vulnerable versions of PyAthena in untrusted environments. Review and restrict the use of DELETE and CTAS statements where possible. Monitor vendor channels for updates and apply patches promptly once released.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- VulnCheck
- Date Reserved
- 2026-07-21T20:57:44.880Z
- Cvss Version
- 4.0
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a6f5fd5bf32cb7a34b6ff3a
Added to database: 08/02/2026, 15:18:45 UTC
Last enriched: 08/02/2026, 15:32:52 UTC
Last updated: 08/02/2026, 16:21:55 UTC
Views: 4
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.