Skip to main content
CVE-2024-36039VulnerabilityPublished Updated

CVE-2024-36039: pymysql · n/a

Affects pymysqlSource CVE Database V5

0

Not known to be exploited · CVSS 6.3 Medium.

Data as of 26 Oct 2026, 06:26 UTC

CVSS 3.1 base score
6.3Medium
How severe the flaw is on the 0–10 CVSS scale.
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:L

Exploitation evidence

  1. Disclosed: evidence found.

    CVE published 21 May 2024

  2. Detectable: no evidence on record.

    No public nuclei template indexed

  3. Weaponised: no evidence on record.

    No public exploit code indexed in Metasploit or Exploit-DB

  4. Exploited in the wild: no evidence on record.

    Not in CISA KEV and no source reports exploitation

  5. Observed by OffSeq 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

ProductAffectedFixed in
PyPIpymysqlpkg:pypi/pymysqlOther threatsAffected
  • <=1.1.0
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

Community reviews

Loading reviews…