{"id":"CVE-2026-65321","published":"2026-08-02T14:56:28Z","modified":"2026-08-06T18:25:29Z","title":"PyAthena SQL Injection via DefaultParameterFormatter DELETE/CTAS","vendor":"laughingman7743","product":"PyAthena","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":9.8,"severity":"CRITICAL","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00767,"percentile":0.56433,"provenance":"source"},"cwes":[{"id":"CWE-89","name":"Improper Neutralization of Special Elements used in an SQL Command"}],"references":[{"url":"https://github.com/laughingman7743/PyAthena","tags":["product"]},{"url":"https://github.com/laughingman7743/PyAthena/security/advisories/GHSA-xwj5-g6cv-4r5c","tags":["vendor-advisory"]},{"url":"https://github.com/pyathena-dev/PyAthena/commit/27901d12245ea722b3b4e211c60e2ade4e7c8efd","tags":["patch"]},{"url":"https://www.vulncheck.com/advisories/pyathena-sql-injection-via-defaultparameterformatter-delete-ctas","tags":["third-party-advisory"]},{"url":"https://rahulkarne.com/#/cve/CVE-2026-65321","tags":["technical-description"]},{"url":"https://github.com/rahulreddykarne/CVE-2026-65321-pyathena","tags":["related"]}],"priority":{"score":23.1,"factors":[{"name":"EPSS percentile","points":11.29},{"name":"Public exploit code","points":5.0},{"name":"CVSS severity","points":6.86}]},"exploitSources":{"pocGithub":{"count":1,"skipped":0,"earliest":"2026-08-03","earliestUrl":"https://github.com/rahulreddykarne/CVE-2026-65321-pyathena","repos":[{"name":"rahulreddykarne/CVE-2026-65321-pyathena","url":"https://github.com/rahulreddykarne/CVE-2026-65321-pyathena","stars":0,"created":"2026-08-03"}]},"first":{"date":"2026-08-03","source":"PoC-in-GitHub","url":"https://github.com/rahulreddykarne/CVE-2026-65321-pyathena"},"provenance":"source"},"vendorSlug":"laughingman7743","affectedVersions":[{"vendor":"laughingman7743","product":"PyAthena","versions":["<= 3.35.3"]}],"fixedVersions":[{"vendor":"laughingman7743","product":"PyAthena","versions":["3.35.4"]}],"ssvc":{"exploitation":"none","automatable":"yes","technicalImpact":"total","timestamp":"2026-08-03T15:19:22.424683Z","from":"CISA ADP","provenance":"source"},"euvd":{"id":"EUVD-2026-52004","exploited":false,"provenance":"source"}}