CVE-2026-65321

CRITICAL

PyAthena 3.35.4 SQL Injection via DefaultParameterFormatter DELETE/CTAS

Title source: cna
STIX 2.1

Exploitation Summary

EIP tracks 1 public exploit for CVE-2026-65321. PoCs published by rahulreddykarne.

AI-analyzed exploit summary This repository contains a functional proof-of-concept demonstrating a SQL injection vulnerability (CVE-2026-65321) in PyAthena <= 3.35.3. The exploit shows how improper backslash-escaping in non-SELECT statements (e.g., DELETE, CREATE TABLE AS) allows attackers to break out of string literals and inject arbitrary SQL, leading to unauthorized data deletion or exfiltration.

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.

Exploits (1)

github WORKING POC
by rahulreddykarne · pythonpoc
https://github.com/rahulreddykarne/CVE-2026-65321-pyathena

This repository contains a functional proof-of-concept demonstrating a SQL injection vulnerability (CVE-2026-65321) in PyAthena <= 3.35.3. The exploit shows how improper backslash-escaping in non-SELECT statements (e.g., DELETE, CREATE TABLE AS) allows attackers to break out of string literals and inject arbitrary SQL, leading to unauthorized data deletion or exfiltration.

Classification
Working Poc 99%
Attack Type
Sqli
Complexity
Trivial
Reliability
Reliable
Target: PyAthena <= 3.35.3
No auth needed
Prerequisites: Attacker-controlled string parameter in a non-SELECT/INSERT/UPDATE/MERGE statement (e.g., DELETE, CTAS) · PyAthena configured with default `DefaultParameterFormatter` · Athena workgroup/IAM role with permissions for the targeted operations
mistral-large-3 · analyzed Aug 03, 2026 Full analysis →

Scores

CVSS v3 9.8
EPSS 0.0044
EPSS Percentile 35.8%
Attack Vector NETWORK
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

CISA SSVC

Vulnrichment
Exploitation none
Automatable yes
Technical Impact total

Details

CWE
CWE-89
Status published
Products (2)
laughingman7743/PyAthena < 3.35.3
laughingman7743/PyAthena 3.35.4
Published Aug 02, 2026
Tracked Since Aug 02, 2026