{"id":"CVE-2026-65321","summary":"PyAthena SQL Injection via DefaultParameterFormatter DELETE/CTAS","details":"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.","aliases":["GHSA-xwj5-g6cv-4r5c"],"modified":"2026-08-07T11:51:31.906391706Z","published":"2026-08-02T14:56:28.910Z","database_specific":{"cna_assigner":"VulnCheck","cwe_ids":["CWE-89"],"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/65xxx/CVE-2026-65321.json"},"references":[{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/65xxx/CVE-2026-65321.json"},{"type":"ADVISORY","url":"https://github.com/laughingman7743/PyAthena/security/advisories/GHSA-xwj5-g6cv-4r5c"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-65321"},{"type":"ADVISORY","url":"https://www.vulncheck.com/advisories/pyathena-sql-injection-via-defaultparameterformatter-delete-ctas"},{"type":"FIX","url":"https://github.com/pyathena-dev/PyAthena/commit/27901d12245ea722b3b4e211c60e2ade4e7c8efd"},{"type":"PACKAGE","url":"https://github.com/laughingman7743/PyAthena"},{"type":"PACKAGE","url":"https://github.com/rahulreddykarne/CVE-2026-65321-pyathena"},{"type":"ARTICLE","url":"https://rahulkarne.com/#/cve/CVE-2026-65321"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/pyathena-dev/PyAthena","events":[{"introduced":"0"},{"fixed":"27901d12245ea722b3b4e211c60e2ade4e7c8efd"}],"database_specific":{"extracted_events":[{"introduced":"0"},{"last_affected":"3.35.3"}],"source":["AFFECTED_FIELD","REFERENCES"]}}],"versions":["v3.35.3","v3.35.2","v3.35.1","v3.35.0","v3.34.0","v3.33.0","v3.32.0","v3.31.1","v3.31.0","v3.30.1","v3.30.0","v3.29.3","v3.29.2","v3.29.1","v3.29.0","v3.28.0","v3.27.2","v3.27.1","v3.27.0","v3.26.0","v3.25.0","v3.24.1","v3.24.0","v3.23.0","v3.22.0","v3.21.1","v3.21.0","v3.20.0","v3.19.0","v3.18.0","v3.17.1","v3.17.0","v3.16.0","v3.15.0","v3.14.1","v3.14.0","v3.13.0","v3.12.2","v3.12.1","v3.12.0","v3.11.0","v3.10.0","v3.9.0","v3.8.3","v3.8.2","v3.8.1","v3.8.0","v3.7.0","v3.6.0","v3.5.1","v3.4.0","v3.5.0","v3.3.0","v3.2.1","v3.1.0","v3.2.0","v3.0.10","v3.0.9","v3.0.8","v3.0.7","v3.0.6","v3.0.5","v3.0.4","v3.0.3","v3.0.2","v3.0.1","v3.0.0","v2.25.2","v2.25.1","v2.25.0","v2.24.0","v2.23.0","v2.22.0","v2.21.0","v2.20.0","v2.18.2","v2.19.0","v2.18.1","v2.18.0","v2.17.0","v2.16.1","v2.16.0","v2.15.0","v2.14.0","v2.13.0","v2.12.0","v2.11.0","v2.10.0","v2.9.6","v2.9.5","v2.9.4","v2.9.3","v2.9.2","v2.9.1","v2.9.0","v2.8.0","v2.7.0","v2.6.1","v2.6.0","v2.5.4","v2.5.3","v2.5.2","v2.5.1","v2.5.0","v2.4.1","v2.4.0","v2.3.2","v2.3.1","v2.3.0","v2.2.0","v2.1.2","v2.1.1","v2.1.0","v2.0.2","v1.11.2","v2.0.1","v2.0.0","v1.11.1","v1.11.0","v1.10.8","v1.10.7","v1.10.6","v1.10.5","v1.10.4","v1.10.3","v1.10.2","v1.10.1","v1.10.0","v1.9.0","v1.8.0","v1.7.2","v1.7.1","v1.7.0","v1.6.1","v1.6.0","v1.5.1","v1.5.0","v1.4.6","v1.4.5","v1.4.4","v1.4.3","v1.4.2","v1.4.1","v1.4.0","v1.3.0","v1.2.5","v1.2.4","v1.2.3","v1.2.2","v1.2.1","v1.2.0","v1.1.0","v1.0.3","v1.0.2","v1.0.1","v1.0.0"],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-65321.json"}}],"schema_version":"1.8.0","severity":[{"type":"CVSS_V4","score":"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"}]}