CVE-2026-65321 is a SQL injection vulnerability in PyAthena versions prior to 3.35.4. The flaw is caused by improper quote escaping in DefaultParameterFormatter.format(), which routes DELETE and CTAS statements to the _escape_hive function. That function escapes single quotes with backslashes rather than doubling them. Because Athena and Trino do not treat backslashes as valid escape characters inside string literals, attacker-controlled input containing a single quote can prematurely terminate the intended string literal and inject arbitrary SQL. Successful exploitation can alter the semantics of the original query, including injecting UNION SELECT clauses, executing destructive statements, or manipulating CREATE TABLE AS SELECT operations.
Mallory correlates every CVE against your assets, your vendors, and active adversary campaigns. Know which vulnerabilities matter for you, not just which ones are loud.
What it means. What to do now. Patch path, mitigations, and the assume-compromise checklist.
What an attacker gets, and what they’ve been doing with it.
If you can’t patch tonight, do this now.
Patch, then assume compromise.
1 valid exploit after Mallory filtered fakes, detection scripts, and README-only repos.
This repository is a small standalone proof-of-concept for CVE-2026-65321 affecting PyAthena <= 3.35.3. It contains two files: a detailed README advisory and a single Python demo script, poc_pyathena_cna_demo.py. The script is not a framework module and is intended as a safe local CNA demonstration rather than a weaponized exploit. The exploit capability is SQL injection in PyAthena's DefaultParameterFormatter when formatting attacker-controlled string parameters into non-SELECT statements. The root issue is statement-type-dependent escaping: SELECT/WITH/INSERT/UPDATE/MERGE use a safe quote-doubling routine, while other statements such as DELETE and CREATE TABLE AS SELECT fall back to Hive-style backslash escaping, which is unsafe for Trino/Athena semantics. This allows an attacker to terminate a quoted string and inject arbitrary SQL logic. The PoC demonstrates two concrete impacts locally without contacting AWS: (1) unauthorized deletion by generating a DELETE statement with payload "missing' OR 1=1 -- ", causing the WHERE clause to be neutralized and all rows in the demo table to be deleted; and (2) CTAS-style data exfiltration by generating a CREATE TABLE leaked AS SELECT ... statement with payload "nobody' UNION SELECT secret FROM admin_credentials -- ", causing protected data to be copied into an attacker-visible table. The script also includes control cases showing that SELECT and UPDATE statements are escaped safely and do not break out. Repository structure is minimal: README.md documents the vulnerability, impact, affected/fixed versions, references, and disclosure timeline; poc_pyathena_cna_demo.py is the executable entry point. The script expects a local vulnerable PyAthena source tree at pyathena-3.35.2/pyathena-3.35.2, inserts it into sys.path, imports the real formatter implementation, and uses an in-memory DuckDB or SQLite database to safely prove the injection primitive. No external network endpoints, AWS APIs, credentials, or remote command payloads are used. This is a valid exploit PoC focused on demonstrating SQL injection impact, not code execution.
15 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.
A critical SQL injection vulnerability in PyAthena caused by improper quote-escaping in DefaultParameterFormatter.format(), allowing unauthenticated attackers to inject arbitrary SQL against Amazon Athena-backed workflows.
A SQL injection vulnerability in PyAthena prior to 3.35.4 caused by improper quote-escaping in DefaultParameterFormatter.format(), enabling unauthenticated arbitrary SQL injection, data exfiltration, destructive statements, and attacker-controlled CTAS behavior.
Query your assets running an affected version, and investigate the blast radius.
Every observed campaign linking this CVE to a named adversary.
Malware families riding this exploit, with evidence and IOCs.
YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.
Cross-references every affected SKU, including bundled OEM variants.
Community discussion across Reddit, Mastodon, and other social sources.