{"answers":{"affected":"3 open source packages ship an affected version, including pymysql.","exploited":"There is no known exploitation of CVE-2024-36039 in the wild and no public exploit code.","fix":"Upgrade pymysql to 1.1.1 or later.","what":"CVE-2024-36039 is a medium-severity SQL injection vulnerability in n/a, published on 21 May 2024. Any signed-in user can exploit it over the network, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2024-36039 and fix it if it is affected.\n\nWhat it is: CVE-2024-36039 is a medium-severity SQL injection vulnerability in n/a, published on 21 May 2024. Any signed-in user can exploit it over the network, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2024-36039 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- pymysql (PyPI): affected all versions; fixed in 1.1.1\n- pymysql (PyPI): affected all versions; fixed in 1.1.1\n- pymysql (PyPI): affected all versions; fixed in 1.1.1\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2024-36039/ (Markdown: https://insights.sbomify.com/CVE-2024-36039/index.md)","id":"CVE-2024-36039","markdown":"https://insights.sbomify.com/CVE-2024-36039/index.md","name":"CVE-2024-36039","record":{"aliases":["ALSA-2024:4244","ALSA-2024:4245","ALSA-2024:9193","ALSA-2024:9194","AZL-43726","AZL-44457","CLSA-2026-1768435940","DEBIAN-CVE-2024-36039","DLA-3822-1","DSA-5700-1","GHSA-v9hf-5j83-6xpp","OESA-2024-1719","PYSEC-2026-502","RHSA-2024:4244","RHSA-2024:4245","RHSA-2024:9193","RHSA-2024:9194","RLSA-2024:4244","RLSA-2024:4245","RLSA-2024:9193","RLSA-2024:9194","ROOT-APP-PYPI-CVE-2024-36039","SUSE-SU-2024:1855-1","SUSE-SU-2024:1925-1","UBUNTU-CVE-2024-36039","USN-6801-1","openSUSE-SU-2024:13993-1","openSUSE-SU-2026:11995-1"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["data_read","data_modify"],"network_reachable":"yes","non_default_config":false,"product_category":"Python MySQL library","requires_auth":"low_privilege","summary":"Attackers can execute arbitrary SQL commands via untrusted JSON input due to improper key escaping in PyMySQL.","user_interaction":"not_required","vuln_class":"sql_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"mitre","cpe":[],"cvss":{"score":6.3,"severity":"medium","source":"cisa-adp","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L","version":"3.1"},"cwes":[{"id":"CWE-89","name":"Improper Neutralization of Special Elements used in an SQL Command"}],"description":"PyMySQL through 1.1.0 allows SQL injection if used with untrusted JSON input because keys are not escaped by escape_dict.","ecosystems":["AlmaLinux:8","AlmaLinux:9","PyPI","Red Hat:enterprise_linux:8::appstream","Red Hat:enterprise_linux:9::appstream","Rocky Linux:8","Rocky Linux:9","SUSE:Linux Enterprise Module for Package Hub 15 SP5","SUSE:Linux Enterprise Module for Package Hub 15 SP6","openSUSE:Leap 15.5","openSUSE:Leap 15.6","openSUSE:Tumbleweed"],"exploits":{"exploitdb":0,"first_seen":"2026-03-26","github_poc":1,"max_poc_stars":1,"metasploit":0,"nuclei":0,"refs":[{"date":"2026-03-26T09:14:58Z","kind":"github_poc","ref":"https://github.com/zenniskayy2k4/CVE-2024-36039_PoC","stars":1,"title":"PoC for CVE-2024-36039: Demonstrating SQL Injection via PyMySQL Object-to-String serialization flaw"}],"tier":"poc_unverified"},"has_fix":true,"headline":"PyMySQL SQL Injection vulnerability","id":"CVE-2024-36039","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"PyPI","product":null,"products":[],"type":"sql_injection","year":"2024"},"n_packages":24,"n_references":4,"next":{"headline":"Missing authorization in n/a","id":"CVE-2024-36041"},"packages":[{"ecosystem":"PyPI","fixed":["1.1.1"],"introduced":["0"],"last_affected":[],"package":"pymysql","purl":null,"source":"GHSA-v9hf-5j83-6xpp"},{"ecosystem":"PyPI","fixed":["1.1.1"],"introduced":["0"],"last_affected":[],"package":"pymysql","purl":"pkg:pypi/pymysql","source":"GHSA-v9hf-5j83-6xpp"},{"ecosystem":"PyPI","fixed":["1.1.1"],"introduced":["0"],"last_affected":[],"package":"pymysql","purl":"pkg:pypi/pymysql","source":"PYSEC-2026-502"},{"ecosystem":"AlmaLinux:8","fixed":["1.0.2-2.el8_10"],"introduced":["0"],"last_affected":[],"package":"python3.11-PyMySQL","purl":"pkg:rpm/almalinux/python3.11-PyMySQL","source":"ALSA-2024:4244"},{"ecosystem":"AlmaLinux:8","fixed":["1.1.0-3.el8_10"],"introduced":["0"],"last_affected":[],"package":"python3.12-PyMySQL","purl":"pkg:rpm/almalinux/python3.12-PyMySQL","source":"ALSA-2024:4245"},{"ecosystem":"AlmaLinux:9","fixed":["1.0.2-2.el9"],"introduced":["0"],"last_affected":[],"package":"python3.11-PyMySQL","purl":"pkg:rpm/almalinux/python3.11-PyMySQL","source":"ALSA-2024:9194"},{"ecosystem":"AlmaLinux:9","fixed":["1.0.2-2.el9"],"introduced":["0"],"last_affected":[],"package":"python3.11-PyMySQL+rsa","purl":"pkg:rpm/almalinux/python3.11-PyMySQL%2Brsa","source":"ALSA-2024:9194"},{"ecosystem":"AlmaLinux:9","fixed":["1.1.0-3.el9"],"introduced":["0"],"last_affected":[],"package":"python3.12-PyMySQL","purl":"pkg:rpm/almalinux/python3.12-PyMySQL","source":"ALSA-2024:9193"},{"ecosystem":"AlmaLinux:9","fixed":["1.1.0-3.el9"],"introduced":["0"],"last_affected":[],"package":"python3.12-PyMySQL+rsa","purl":"pkg:rpm/almalinux/python3.12-PyMySQL%2Brsa","source":"ALSA-2024:9193"},{"ecosystem":"Red Hat:enterprise_linux:8::appstream","fixed":["0:1.0.2-2.el8_10"],"introduced":["0"],"last_affected":[],"package":"python3.11-PyMySQL","purl":"pkg:rpm/redhat/python3.11-PyMySQL","source":"RHSA-2024:4244"},{"ecosystem":"Red Hat:enterprise_linux:8::appstream","fixed":["0:1.1.0-3.el8_10"],"introduced":["0"],"last_affected":[],"package":"python3.12-PyMySQL","purl":"pkg:rpm/redhat/python3.12-PyMySQL","source":"RHSA-2024:4245"},{"ecosystem":"Red Hat:enterprise_linux:9::appstream","fixed":["0:1.0.2-2.el9"],"introduced":["0"],"last_affected":[],"package":"python3.11-PyMySQL","purl":"pkg:rpm/redhat/python3.11-PyMySQL","source":"RHSA-2024:9194"},{"ecosystem":"Red Hat:enterprise_linux:9::appstream","fixed":["0:1.0.2-2.el9"],"introduced":["0"],"last_affected":[],"package":"python3.11-PyMySQL+rsa","purl":"pkg:rpm/redhat/python3.11-PyMySQL%2Brsa","source":"RHSA-2024:9194"},{"ecosystem":"Red Hat:enterprise_linux:9::appstream","fixed":["0:1.1.0-3.el9"],"introduced":["0"],"last_affected":[],"package":"python3.12-PyMySQL","purl":"pkg:rpm/redhat/python3.12-PyMySQL","source":"RHSA-2024:9193"},{"ecosystem":"Red Hat:enterprise_linux:9::appstream","fixed":["0:1.1.0-3.el9"],"introduced":["0"],"last_affected":[],"package":"python3.12-PyMySQL+rsa","purl":"pkg:rpm/redhat/python3.12-PyMySQL%2Brsa","source":"RHSA-2024:9193"},{"ecosystem":"Rocky Linux:8","fixed":["0:1.0.2-2.el8_10"],"introduced":["0"],"last_affected":[],"package":"python3.11-PyMySQL","purl":"pkg:rpm/rocky-linux/python3.11-PyMySQL?distro=rocky-linux-8-x86-64\u0026epoch=0","source":"RLSA-2024:4244"},{"ecosystem":"Rocky Linux:8","fixed":["0:1.1.0-3.el8_10"],"introduced":["0"],"last_affected":[],"package":"python3.12-PyMySQL","purl":"pkg:rpm/rocky-linux/python3.12-PyMySQL?distro=rocky-linux-8-x86-64\u0026epoch=0","source":"RLSA-2024:4245"},{"ecosystem":"Rocky Linux:9","fixed":["0:1.0.2-2.el9"],"introduced":["0"],"last_affected":[],"package":"python3.11-PyMySQL","purl":"pkg:rpm/rocky-linux/python3.11-PyMySQL?distro=rocky-linux-9-x86-64\u0026epoch=0","source":"RLSA-2024:9194"},{"ecosystem":"Rocky Linux:9","fixed":["0:1.1.0-3.el9"],"introduced":["0"],"last_affected":[],"package":"python3.12-PyMySQL","purl":"pkg:rpm/rocky-linux/python3.12-PyMySQL?distro=rocky-linux-9-x86-64\u0026epoch=0","source":"RLSA-2024:9193"},{"ecosystem":"SUSE:Linux Enterprise Module for Package Hub 15 SP5","fixed":["0.7.11-150000.3.3.1"],"introduced":["0"],"last_affected":[],"package":"python-PyMySQL","purl":"pkg:rpm/suse/python-PyMySQL\u0026distro=SUSE%20Linux%20Enterprise%20Module%20for%20Package%20Hub%2015%20SP5","source":"SUSE-SU-2024:1855-1"},{"ecosystem":"SUSE:Linux Enterprise Module for Package Hub 15 SP6","fixed":["0.7.11-150000.3.3.1"],"introduced":["0"],"last_affected":[],"package":"python-PyMySQL","purl":"pkg:rpm/suse/python-PyMySQL\u0026distro=SUSE%20Linux%20Enterprise%20Module%20for%20Package%20Hub%2015%20SP6","source":"SUSE-SU-2024:1855-1"},{"ecosystem":"openSUSE:Leap 15.5","fixed":["0.7.11-150000.3.3.1"],"introduced":["0"],"last_affected":[],"package":"python-PyMySQL","purl":"pkg:rpm/opensuse/python-PyMySQL\u0026distro=openSUSE%20Leap%2015.5","source":"SUSE-SU-2024:1855-1"},{"ecosystem":"openSUSE:Leap 15.6","fixed":["1.1.0-150600.3.3.1"],"introduced":["0"],"last_affected":[],"package":"python-PyMySQL","purl":"pkg:rpm/opensuse/python-PyMySQL\u0026distro=openSUSE%20Leap%2015.6","source":"SUSE-SU-2024:1925-1"},{"ecosystem":"openSUSE:Tumbleweed","fixed":["1.2.0-1.2"],"introduced":["0"],"last_affected":[],"package":"python-PyMySQL","purl":"pkg:rpm/opensuse/python-PyMySQL\u0026distro=openSUSE%20Tumbleweed","source":"openSUSE-SU-2026:11995-1"}],"prev":{"headline":"Stored XSS","id":"CVE-2024-36038"},"products":["n/a"],"published":"2024-05-21","related":[],"sources":[{"class":"attribution","licence":"MIT","name":"AlmaLinux","prefix":"ALSA"},{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"PyPA Advisory Database","prefix":"PYSEC"},{"class":"attribution","licence":"CC BY 4.0","name":"Red Hat","prefix":"RHSA"},{"class":"attribution","licence":"BSD","name":"Rocky Linux","prefix":"RLSA"},{"class":"attribution","licence":"CC BY 4.0","name":"SUSE","prefix":"SUSE"},{"class":"attribution","licence":"CC BY 4.0","name":"SUSE","prefix":"openSUSE"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"},{"class":"open","licence":"CC0","name":"PoC-in-GitHub"}],"ssvc":{"automatable":"no","exploitation":"none","technical_impact":"partial"},"state":"PUBLISHED","updated":"2024-11-21","vendors":["n/a"]},"summary":"Attackers can execute arbitrary SQL commands via untrusted JSON input due to improper key escaping in PyMySQL.","url":"https://insights.sbomify.com/CVE-2024-36039/"}