Every CVE Search/ Get API key

CVE-2024-36039

PyMySQL SQL Injection vulnerability

6.3 MediumPublic exploitFix available

PyMySQL through 1.1.0 allows SQL injection if used with untrusted JSON input because keys are not escaped by escape_dict.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
Low
Privileges needed
Low
User interaction
None

What an attacker can affect

Confidentiality
Low
Integrity
Low
Availability
Low

Exploit likelihood

0.69%Up 0.6 points since Jun 11, 2024
90%50%10%1%

What each source reports

CVE List Score used 6.3

PyMySQL through 1.1.0 allows SQL injection if used with untrusted JSON input because keys are not escaped by escape_dict.

Record
CVE-2024-36039
CVSS 3.1
6.3 MediumCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L
Weakness
CWE-89
Updated
2026-11-02
EUVDEUVD-2024-1798 6.3

PyMySQL through 1.1.0 allows SQL injection if used with untrusted JSON input because keys are not escaped by escape_dict.

Record
EUVD-2024-1798
CVSS 3.1
6.3 MediumCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L
Updated
2026-11-03
GitHub AdvisoriesGHSA-v9hf-5j83-6xpp 9.8

PyMySQL SQL Injection vulnerability

PyMySQL through 1.1.0 allows SQL injection if used with untrusted JSON input because keys are not escaped by escape_dict.

Record
GHSA-v9hf-5j83-6xpp
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Weakness
CWE-89
Updated
2026-11-02
NVD 6.3

PyMySQL through 1.1.0 allows SQL injection if used with untrusted JSON input because keys are not escaped by escape_dict.

Record
CVE-2024-36039
CVSS 3.1
6.3 MediumCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L
Weakness
CWE-89
Updated
2026-11-02
OSV 6.3

PyMySQL through 1.1.0 allows SQL injection if used with untrusted JSON input because keys are not escaped by escape_dict.

Record
CVE-2024-36039
CVSS 3.1
6.3 MediumCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L
Updated
2026-11-02
OSVDEBIAN-CVE-2024-36039 6.3

PyMySQL through 1.1.0 allows SQL injection if used with untrusted JSON input because keys are not escaped by escape_dict.

Record
DEBIAN-CVE-2024-36039
CVSS 3.1
6.3 MediumCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L
Updated
2026-11-02
Show 24 moreShow less
OSVGHSA-v9hf-5j83-6xpp 9.8

PyMySQL SQL Injection vulnerability

PyMySQL through 1.1.0 allows SQL injection if used with untrusted JSON input because keys are not escaped by escape_dict.

Record
GHSA-v9hf-5j83-6xpp
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Weakness
CWE-89
Updated
2026-11-02
OSVOESA-2024-1719 8.1

python-PyMySQL security update

This package contains a pure-Python MySQL client library, based on PEP 249. Most public APIs are compatible with mysqlclient and MySQLdb.

Security Fix(es):

PyMySQL through 1.1.0 allows SQL injection if used with untrusted JSON input because keys are not escaped by escape_dict.(CVE-2024-36039)

Record
OESA-2024-1719
CVSS 3.1
8.1 HighCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
Updated
2026-11-02
OSVPYSEC-2026-502 9.8

PyMySQL SQL Injection vulnerability

PyMySQL through 1.1.0 allows SQL injection if used with untrusted JSON input because keys are not escaped by escape_dict.

Record
PYSEC-2026-502
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Updated
2026-11-02
OSVRHSA-2024:4244 6.3

Red Hat Security Advisory: python3.11-PyMySQL security update

Record
RHSA-2024:4244
CVSS 3.1
6.3 MediumCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L
Updated
2026-11-02
OSVRHSA-2024:4245 6.3

Red Hat Security Advisory: python3 security update

Record
RHSA-2024:4245
CVSS 3.1
6.3 MediumCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L
Updated
2026-11-02
OSVRHSA-2024:9193 6.3

Red Hat Security Advisory: python3.12-PyMySQL security update

Record
RHSA-2024:9193
CVSS 3.1
6.3 MediumCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L
Updated
2026-11-02
OSVRHSA-2024:9194 6.3

Red Hat Security Advisory: python3.11-PyMySQL security update

Record
RHSA-2024:9194
CVSS 3.1
6.3 MediumCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L
Updated
2026-11-02
OSVRLSA-2024:4244 6.3

Moderate: python3.11-PyMySQL security update

This package contains a pure-Python MySQL client library. The goal of PyMySQL is to be a drop-in replacement for MySQLdb and work on CPython, PyPy, IronPython and Jython.

Security Fix(es):

  • python-pymysql: SQL injection if used with untrusted JSON input (CVE-2024-36039)

For more details about the security issue(s), including the impact, a CVSS score, acknowledgments, and other related information, refer the CVE page(s) listed in the References section.

Record
RLSA-2024:4244
CVSS 3.1
6.3 MediumCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L
Updated
2026-11-02
OSVRLSA-2024:4245 6.3

Moderate: python3 security update

Python is an interpreted, interactive, object-oriented programming language, which includes modules, classes, exceptions, very high level dynamic data types and dynamic typing. Python supports interfaces to many system calls and libraries, as well as to various windowing systems.

Security Fix(es):

  • python-pymysql: SQL injection if used with untrusted JSON input (CVE-2024-36039)

For more details about the security issue(s), including the impact, a CVSS score, acknowledgments, and other related information, refer to the CVE page(s) listed in the References section.

Record
RLSA-2024:4245
CVSS 3.1
6.3 MediumCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L
Updated
2026-11-02
OSVRLSA-2024:9193 6.3

Moderate: python3.12-PyMySQL security update

This package contains a pure-Python MySQL client library. The goal of PyMySQL is to be a drop-in replacement for MySQLdb and work on CPython, PyPy, IronPython and Jython.

Security Fix(es):

  • python-pymysql: SQL injection if used with untrusted JSON input (CVE-2024-36039)

For more details about the security issue(s), including the impact, a CVSS score, acknowledgments, and other related information, refer to the CVE page(s) listed in the References section.

Additional Changes:

For detailed information on changes in this release, see the Rocky Linux 9.5 Release Notes linked from the References section.

Record
RLSA-2024:9193
CVSS 3.1
6.3 MediumCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L
Updated
2026-11-02
OSVUBUNTU-CVE-2024-36039 6.3

PyMySQL through 1.1.0 allows SQL injection if used with untrusted JSON input because keys are not escaped by escape_dict.

Record
UBUNTU-CVE-2024-36039
CVSS 3.1
6.3 MediumCVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L
Updated
2026-11-02
OSVALSA-2024:4244 No score

Moderate: python3.11-PyMySQL security update

This package contains a pure-Python MySQL client library. The goal of PyMySQL is to be a drop-in replacement for MySQLdb and work on CPython, PyPy, IronPython and Jython.

Security Fix(es):

  • python-pymysql: SQL injection if used with untrusted JSON input (CVE-2024-36039)

For more details about the security issue(s), including the impact, a CVSS score, acknowledgments, and other related information, refer the CVE page(s) listed in the References section.

Record
ALSA-2024:4244
Updated
2026-11-02
OSVALSA-2024:4245 No score

Moderate: python3 security update

Python is an interpreted, interactive, object-oriented programming language, which includes modules, classes, exceptions, very high level dynamic data types and dynamic typing. Python supports interfaces to many system calls and libraries, as well as to various windowing systems.

Security Fix(es):

  • python-pymysql: SQL injection if used with untrusted JSON input (CVE-2024-36039)

For more details about the security issue(s), including the impact, a CVSS score, acknowledgments, and other related information, refer to the CVE page(s) listed in the References section.

Record
ALSA-2024:4245
Updated
2026-11-02
OSVALSA-2024:9193 No score

Moderate: python3.12-PyMySQL security update

This package contains a pure-Python MySQL client library. The goal of PyMySQL is to be a drop-in replacement for MySQLdb and work on CPython, PyPy, IronPython and Jython.

Security Fix(es):

  • python-pymysql: SQL injection if used with untrusted JSON input (CVE-2024-36039)

For more details about the security issue(s), including the impact, a CVSS score, acknowledgments, and other related information, refer to the CVE page(s) listed in the References section.

Additional Changes:

For detailed information on changes in this release, see the AlmaLinux Release Notes linked from the References section.

Record
ALSA-2024:9193
Updated
2026-11-02
OSVALSA-2024:9194 No score

Moderate: python3.11-PyMySQL security update

This package contains a pure-Python MySQL client library. The goal of PyMySQL is to be a drop-in replacement for MySQLdb and work on CPython, PyPy, IronPython and Jython.

Security Fix(es):

  • python-pymysql: SQL injection if used with untrusted JSON input (CVE-2024-36039)

For more details about the security issue(s), including the impact, a CVSS score, acknowledgments, and other related information, refer to the CVE page(s) listed in the References section.

Additional Changes:

For detailed information on changes in this release, see the AlmaLinux Release Notes linked from the References section.

Record
ALSA-2024:9194
Updated
2026-11-02
OSVAZL-43726 No score

CVE-2024-36039 affecting package python-PyMySQL 0.9.3-3

PyMySQL through 1.1.0 allows SQL injection if used with untrusted JSON input because keys are not escaped by escape_dict.

Record
AZL-43726
Updated
2026-11-02
OSVAZL-44457 No score

CVE-2024-36039 affecting package python-PyMySQL for versions less than 1.1.1-3

PyMySQL through 1.1.0 allows SQL injection if used with untrusted JSON input because keys are not escaped by escape_dict.

Record
AZL-44457
Updated
2026-11-02
OSVCLSA-2026-1768435940 No score

TuxCare security update for pymysql (1 CVE)

TuxCare rebuilt pymysql to address 1 CVE. Fixed in 0.10.1.post1+tuxcare.

Record
CLSA-2026-1768435940
Updated
2026-11-02
OSVopenSUSE-SU-2024:13993-1 No score

python310-PyMySQL-1.1.1-1.1 on GA media

These are all security issues fixed in the python310-PyMySQL-1.1.1-1.1 package on the GA media of openSUSE Tumbleweed.

Record
openSUSE-SU-2024:13993-1
Updated
2026-11-02
OSVopenSUSE-SU-2026:11995-1 No score

python313-PyMySQL-1.2.0-1.2 on GA media

These are all security issues fixed in the python313-PyMySQL-1.2.0-1.2 package on the GA media of openSUSE Tumbleweed.

Record
openSUSE-SU-2026:11995-1
Updated
2026-11-02
OSVROOT-APP-PYPI-CVE-2024-36039 No score

CVE-2024-36039 in rootio-PyMySQL - Patched by Root

Root has patched CVE-2024-36039 in the rootio-PyMySQL package for Root:PyPI. Multiple fixed versions available.

Record
ROOT-APP-PYPI-CVE-2024-36039
Updated
2026-11-02
OSVSUSE-SU-2024:1855-1 No score

Security update for python-PyMySQL

This update for python-PyMySQL fixes the following issues:

  • CVE-2024-36039: Fixed SQL injection if used with untrusted JSON input (bsc#1225070).
Record
SUSE-SU-2024:1855-1
Updated
2026-11-02
OSVSUSE-SU-2024:1925-1 No score

Security update for python-PyMySQL

This update for python-PyMySQL fixes the following issues:

  • CVE-2024-36039: Fixed SQL injection when used with untrusted JSON input (bsc#1225070).
Record
SUSE-SU-2024:1925-1
Updated
2026-11-02
OSVUSN-6801-1 No score

python-pymysql vulnerability

It was discovered that PyMySQL incorrectly escaped untrusted JSON input. An attacker could possibly use this issue to perform SQL injection attacks.

Record
USN-6801-1
Updated
2026-11-02

Affected packages

Affected packages
PackageAffectedFixed
pymysql
PyPI
before 1.1.1
1.1.1
python3.11-PyMySQL
AlmaLinux:8
before 1.0.2-2.el8_10
1.0.2-2.el8_10
python3.12-PyMySQL
AlmaLinux:8
before 1.1.0-3.el8_10
1.1.0-3.el8_10
python3.12-PyMySQL
AlmaLinux:9
before 1.1.0-3.el9
1.1.0-3.el9
python3.12-PyMySQL+rsa
AlmaLinux:9
before 1.1.0-3.el9
1.1.0-3.el9
python3.11-PyMySQL
AlmaLinux:9
before 1.0.2-2.el9
1.0.2-2.el9
python3.11-PyMySQL+rsa
AlmaLinux:9
before 1.0.2-2.el9
1.0.2-2.el9
python-PyMySQL
Azure Linux:2
through 0.9.3-3 None known
python-PyMySQL
Azure Linux:3
before 1.1.1-3
1.1.1-3
pymysql
TuxCare:PyPI
0.10.1 up to 0.10.1.post1+tuxcare
0.10.1.post1+tuxcare
Show 31 moreShow less
Affected packages
PackageAffectedFixed
python-pymysql
Debian:12
before 1.0.2-2+deb12u1, plus listed versions
1.0.2-2
1.0.2-2+deb12u1
python-pymysql
Debian:13
before 1.1.1-1
1.1.1-1
python-pymysql
Debian:14
before 1.1.1-1
1.1.1-1
python-pymysql
Debian:10
before 0.9.3-1+deb10u1, plus listed versions
0.9.3-1
0.9.3-1+deb10u1
python-pymysql
Debian:11
before 0.9.3-2+deb11u1, plus listed versions
0.9.3-2
0.9.3-2+deb11u1
pymysql
PyPI
before 1.1.1, plus listed versions
0.10.00.10.10.20.30.4
Show 37 moreShow less
0.50.60.6.10.6.20.6.2-rc10.6.30.6.40.6.4.dev10.6.50.6.60.6.70.7.00.7.10.7.100.7.110.7.20.7.30.7.40.7.50.7.60.7.70.7.80.7.90.8.00.8.10.9.00.9.10.9.20.9.31.0.01.0.11.0.21.0.31.0.3rc11.1.01.1.0rc11.1.0rc2
1.1.1
python-PyMySQL
openEuler:20.03-LTS-SP4
before 0.9.2-4.oe2003sp4
0.9.2-4.oe2003sp4
python-PyMySQL
openEuler:22.03-LTS-SP1
before 0.9.3-4.oe2203sp1
0.9.3-4.oe2203sp1
python-PyMySQL
openEuler:22.03-LTS-SP3
before 0.9.3-4.oe2203sp3
0.9.3-4.oe2203sp3
python-PyMySQL
openEuler:24.03-LTS
before 1.1.0-2.oe2403
1.1.0-2.oe2403
python3.11-PyMySQL
Red Hat:enterprise_linux:8::appstream
before 0:1.0.2-2.el8_10
0:1.0.2-2.el8_10
python3.12-PyMySQL
Red Hat:enterprise_linux:8::appstream
before 0:1.1.0-3.el8_10
0:1.1.0-3.el8_10
python3.12-PyMySQL+rsa
Red Hat:enterprise_linux:9::appstream
before 0:1.1.0-3.el9
0:1.1.0-3.el9
python3.12-PyMySQL
Red Hat:enterprise_linux:9::appstream
before 0:1.1.0-3.el9
0:1.1.0-3.el9
python3.11-PyMySQL+rsa
Red Hat:enterprise_linux:9::appstream
before 0:1.0.2-2.el9
0:1.0.2-2.el9
python3.11-PyMySQL
Red Hat:enterprise_linux:9::appstream
before 0:1.0.2-2.el9
0:1.0.2-2.el9
python3.11-PyMySQL
Rocky Linux:8
before 0:1.0.2-2.el8_10
0:1.0.2-2.el8_10
python3.12-PyMySQL
Rocky Linux:8
before 0:1.1.0-3.el8_10
0:1.1.0-3.el8_10
python3.12-PyMySQL
Rocky Linux:9
before 0:1.1.0-3.el9
0:1.1.0-3.el9
rootio-PyMySQL
Root:PyPI
before 1.1.0+root.io.1
1.1.0+root.io.11.1.0+root.io.2
PyMySQL
Root:PyPI
before 1.1.0+aikido.2
1.1.0+aikido.2
python-PyMySQL
SUSE:Linux Enterprise Module for Package Hub 15 SP5
before 0.7.11-150000.3.3.1
0.7.11-150000.3.3.1
python-PyMySQL
SUSE:Linux Enterprise Module for Package Hub 15 SP6
before 0.7.11-150000.3.3.1
0.7.11-150000.3.3.1
python-PyMySQL
openSUSE:Leap 15.5
before 0.7.11-150000.3.3.1
0.7.11-150000.3.3.1
python-PyMySQL
openSUSE:Leap 15.6
before 1.1.0-150600.3.3.1
1.1.0-150600.3.3.1
python-pymysql
Ubuntu:16.04:LTS
All versions, plus listed versions
0.6.2-20.7.2-10.7.2-1ubuntu1
None known
python-pymysql
Ubuntu:18.04:LTS
All versions, plus listed versions
0.7.11-10.8.0-1
None known
python-pymysql
Ubuntu:20.04:LTS
before 0.9.3-2ubuntu3.1, plus listed versions
0.9.3-10.9.3-2ubuntu10.9.3-2ubuntu3
0.9.3-2ubuntu3.1
python-pymysql
Ubuntu:22.04:LTS
before 1.0.2-1ubuntu1.22.04.1, plus listed versions
1.0.2-1ubuntu1
1.0.2-1ubuntu1.22.04.1
python-pymysql
Ubuntu:24.04:LTS
before 1.0.2-2ubuntu1.1, plus listed versions
1.0.2-1ubuntu11.0.2-2ubuntu1
1.0.2-2ubuntu1.1
python-PyMySQL
openSUSE:Tumbleweed
before 1.2.0-1.2
1.2.0-1.2

Public exploits

Links only. Every CVE stores no exploit code.

Public exploits
SourceLinkDate
PoC in GitHubzenniskayy2k4/CVE-2024-36039_PoC2026-03-26

History

History
RecordedChangedSources
aliasesEUVD
first indexedCVE List, GitHub Advisories, NVD, OSV, PoC in GitHub

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2024-36039 is a medium vulnerability (CVSS 6.3) in pymysql, published May 21, 2024. Public exploit code exists. EPSS puts the chance of exploitation in the next 30 days at 0.69%, the 53rd percentile. Fixed in pymysql 1.1.1.

References

Show 33 moreShow less
MoveEnter Open