CVE-2024-36039: pymysql · n/a
Affects pymysqlSource CVE Database V5
Not known to be exploited · CVSS 6.3 Medium.
Data as of 26 Oct 2026, 06:26 UTC
- EPSS
- 0.6% chance of exploitation in 30 days – higher than 52% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:LExploitation evidence
Disclosed: evidence found.
CVE published 21 May 2024
Detectable: no evidence on record.
No public nuclei template indexed
Weaponised: no evidence on record.
No public exploit code indexed in Metasploit or Exploit-DB
Exploited in the wildExploited: no evidence on record.
Not in CISA KEV and no source reports exploitation
Observed by OffSeq MirageSeen by Mirage: no evidence on record.
No attack traffic recorded by OffSeq Mirage sensors
A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 2026-10-26.
What to do
Affected software
| Product | Affected | Fixed in |
|---|---|---|
PyPIpymysqlpkg:pypi/pymysqlOther threats | Affected
| Fixed in– |
Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.
AI-suggested
1. Immediately audit all uses of PyMySQL in your codebase, focusing on places where JSON input is parsed and dictionary keys are used in SQL queries. 2. Implement strict input validation and sanitization for JSON keys before they are used in any SQL statements. 3. Avoid directly using JSON keys as SQL identifiers or query components; instead, map or whitelist keys to known safe values. 4. Use parameterized queries or prepared statements wherever possible to separate data from code. 5. Monitor PyMySQL official channels for patches addressing this vulnerability and apply updates promptly once available. 6. Consider implementing Web Application Firewalls (WAFs) with SQL injection detection rules to provide an additional layer of defense. 7. Conduct regular security code reviews and penetration testing focusing on injection flaws in database interactions. 8. Restrict database user privileges to the minimum necessary to limit the impact of potential exploitation.
Description
PyMySQL through 1.1.0 allows SQL injection if used with untrusted JSON input because keys are not escaped by escape_dict.
References
- github.com/PyMySQL/PyMySQL/releases/tag/v1.1.1 (opens in a new tab)
- lists.debian.org/debian-lts-announce/2024/05/msg00017.html (opens in a new tab)
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/35VOJS3SRJNLQIO7YTZFNM6RWHIHWTMK/ (opens in a new tab)
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/23VXBV34GFRICCVYZ6KFMSSWY5UEXCF5/ (opens in a new tab)