# CVE-2026-65321: PyAthena SQL Injection via DefaultParameterFormatter DELETE/CTAS

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** CRITICAL 9.3
- **CVSS:** 9.3 (v4.0, CNA) `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Attack requirements: None; Privileges required: None; User interaction: None; Confidentiality impact: High; Integrity impact: High; Availability impact: High; Confidentiality impact on other systems: None; Integrity impact on other systems: None; Availability impact on other systems: None
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 0.77% (percentile 52, 2026-11-26)
- **CWE:** CWE-89
- **Published:** 2026-08-02T14:56:28.910Z
- **Modified:** 2026-10-23T22:10:00.160Z

## Who should check

- Anyone running laughingman7743 PyAthena \<= 3.35.3

## 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.

## Affected and fixed versions

- laughingman7743 PyAthena: \<= 3.35.3 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-65321. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-65321.md
Affected: laughingman7743 PyAthena <= 3.35.3
Fixed in: no fixed version listed yet

Steps:
1. Search this machine and project for laughingman7743 PyAthena: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2026-65321 being exploited?

There is no confirmed exploitation: CVE-2026-65321 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.77% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2026-65321?

Critical: CVSS 9.3 (v4.0, scored by CNA). Remote, no login needed.

### Which versions are affected by CVE-2026-65321?

laughingman7743 PyAthena \<= 3.35.3.

### Is there a fix for CVE-2026-65321?

No fixed version is listed in the sources yet. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2026-65321?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/laughingman7743/PyAthena/security/advisories/GHSA-xwj5-g6cv-4r5c>
- patch: <https://github.com/pyathena-dev/PyAthena/commit/27901d12245ea722b3b4e211c60e2ade4e7c8efd>
- article: <https://rahulkarne.com/#/cve/CVE-2026-65321>
- other: <https://github.com/laughingman7743/PyAthena>
- other: <https://www.vulncheck.com/advisories/pyathena-sql-injection-via-defaultparameterformatter-delete-ctas>
- other: <https://github.com/rahulreddykarne/CVE-2026-65321-pyathena>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2026-65321>

HTML: <https://flawdb.com/CVE-2026-65321> · JSON: <https://flawdb.com/api/v1/entries/CVE-2026-65321>
