{"id":"CVE-2026-65321","state":"PUBLISHED","title":"PyAthena SQL Injection via DefaultParameterFormatter DELETE/CTAS","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.","publishedAt":"2026-08-02T14:56:28.910Z","updatedAt":"2026-08-06T18:25:29.308Z","severity":{"score":9.3,"label":"Critical","version":"4.0","vector":"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","source":"VulnCheck"},"assigner":"VulnCheck","products":["laughingman7743 PyAthena"],"affected":[{"vendor":"laughingman7743","product":"PyAthena","defaultStatus":"affected","versions":[{"version":"0","status":"affected","lessThanOrEqual":"3.35.3","versionType":"semver"},{"version":"3.35.4","status":"unaffected","versionType":"semver"}]}],"references":["https://github.com/laughingman7743/PyAthena","https://github.com/laughingman7743/PyAthena/security/advisories/GHSA-xwj5-g6cv-4r5c","https://github.com/pyathena-dev/PyAthena/commit/27901d12245ea722b3b4e211c60e2ade4e7c8efd","https://www.vulncheck.com/advisories/pyathena-sql-injection-via-defaultparameterformatter-delete-ctas","https://rahulkarne.com/#/cve/CVE-2026-65321","https://github.com/rahulreddykarne/CVE-2026-65321-pyathena"],"weaknesses":["CWE-89"],"ingestedAt":"2026-10-29T20:12:41.951Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/65xxx/CVE-2026-65321.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-65321","state":"PUBLISHED","datePublished":"2026-08-02T14:56:28.910Z","dateUpdated":"2026-08-06T18:25:29.308Z","assignerShortName":"VulnCheck","assignerOrgId":"83251b91-4cc7-4094-a5c7-464a1b83ea10","dateReserved":"2026-07-21T20:57:44.880Z"},"containers":{"cna":{"title":"PyAthena SQL Injection via DefaultParameterFormatter DELETE/CTAS","descriptions":[{"lang":"en","value":"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":[{"vendor":"laughingman7743","product":"PyAthena","defaultStatus":"affected","versions":[{"version":"0","status":"affected","lessThanOrEqual":"3.35.3","versionType":"semver"},{"version":"3.35.4","status":"unaffected","versionType":"semver"}]}],"references":[{"url":"https://github.com/laughingman7743/PyAthena","name":"Product Repository","tags":["product"]},{"url":"https://github.com/laughingman7743/PyAthena/security/advisories/GHSA-xwj5-g6cv-4r5c","name":"GitHub Security Advisory (GHSA-xwj5-g6cv-4r5c)","tags":["vendor-advisory"]},{"url":"https://github.com/pyathena-dev/PyAthena/commit/27901d12245ea722b3b4e211c60e2ade4e7c8efd","name":"Patch Commit","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"]}],"metrics":[{"format":"CVSS","scenarios":[{"lang":"en","value":"GENERAL"}],"cvssV4_0":{"attackVector":"NETWORK","attackComplexity":"LOW","attackRequirements":"NONE","privilegesRequired":"NONE","userInteraction":"NONE","vulnConfidentialityImpact":"HIGH","subConfidentialityImpact":"NONE","vulnIntegrityImpact":"HIGH","subIntegrityImpact":"NONE","vulnAvailabilityImpact":"HIGH","subAvailabilityImpact":"NONE","exploitMaturity":"NOT_DEFINED","Safety":"NOT_DEFINED","Automatable":"NOT_DEFINED","Recovery":"NOT_DEFINED","valueDensity":"NOT_DEFINED","vulnerabilityResponseEffort":"NOT_DEFINED","providerUrgency":"NOT_DEFINED","version":"4.0","baseSeverity":"CRITICAL","baseScore":9.3,"vectorString":"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"}},{"format":"CVSS","scenarios":[{"lang":"en","value":"GENERAL"}],"cvssV3_1":{"version":"3.1","attackVector":"NETWORK","attackComplexity":"LOW","privilegesRequired":"NONE","userInteraction":"NONE","scope":"UNCHANGED","confidentialityImpact":"HIGH","integrityImpact":"HIGH","availabilityImpact":"HIGH","baseSeverity":"CRITICAL","baseScore":9.8,"vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-89","lang":"en","description":"CWE-89 Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')","type":"CWE"}]}],"providerMetadata":{"shortName":"VulnCheck","orgId":"83251b91-4cc7-4094-a5c7-464a1b83ea10","dateUpdated":"2026-08-06T18:25:29.308Z"},"datePublic":"2026-08-02T00:00:00.000Z","credits":[{"lang":"en","value":"Rahul Karne","type":"finder"}],"source":{"discovery":"EXTERNAL"},"x_generator":{"engine":"vulncheck-endgame"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2026-08-03T15:19:22.424683Z","id":"CVE-2026-65321","options":[{"Exploitation":"none"},{"Automatable":"yes"},{"Technical Impact":"total"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2026-08-03T15:37:25.706Z"}}]}}}