A critical SQL injection flaw tracked as CVE-2026-65321 affects PyAthena versions up to and including 3.35.3, allowing unauthenticated remote attackers to inject arbitrary SQL into Amazon Athena and Trino queries. The bug lies in DefaultParameterFormatter.format(), where DELETE and CTAS statements are passed to _escape_hive, which backslash-escapes single quotes even though Athena and Trino do not treat backslashes as valid string-literal escape characters. That mismatch lets attackers terminate string literals early and alter the intended query.
The vulnerability is rated CVSS 9.8 and can enable data exfiltration through UNION SELECT, execution of destructive SQL statements, and attacker-controlled CTAS destination paths and output content. The issue is classified as CWE-89 and has been fixed in PyAthena 3.35.4. Public reporting said no active exploitation had been confirmed at publication time, but defenders were urged to upgrade immediately and review logs for suspicious DELETE, CTAS, or UNION SELECT activity.

See affected versions and whether adversaries are exploiting it.
2 events from the most recent confirmed update back to the earliest known activity.
On August 2, 2026, a new CVE entry for CVE-2026-65321 was received, disclosing a critical SQL injection flaw in PyAthena affecting versions up to and including 3.35.3 / prior to 3.35.4. The issue stems from improper quote escaping in DefaultParameterFormatter.format() for DELETE and CTAS statements, enabling unauthenticated arbitrary SQL injection.
The vulnerability was fixed in PyAthena version 3.35.4, which is identified as the first non-vulnerable release. Sources state that versions prior to 3.35.4 are affected and recommend immediate upgrading.
Vulnerabilities, threat actors, malware, products, organizations, and breaches Mallory has linked to this story.
See whether adversaries are exploiting this yet, and where the affected versions run in your environment.
2 references tracked. Mallory keeps watching after this page renders.
Map indicators from this story to your assets and identify affected systems in minutes.
Every observed campaign, victim, and pivot linked to actors named in this story.
Malware, exploits, and IOCs connected to the activity described here.
YARA, Sigma, and Snort rules deployed to your SIEM as soon as they’re published.
Get matching new stories delivered to your team as they break — not the next morning.
Ask questions about this story and take action on the answers.