{"answers":{"affected":"3 open source packages ship an affected version, including sqlparse.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-4340 exists.","fix":"Upgrade sqlparse to 0.5.0 or later.","what":"CVE-2024-4340 is a high-severity denial of service vulnerability in sqlparse, published on 30 Apr 2024. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2024-4340 and fix it if it is affected.\n\nWhat it is: CVE-2024-4340 is a high-severity denial of service vulnerability in sqlparse, published on 30 Apr 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-4340 exists.\n\nAffected packages and fixed versions:\n- sqlparse (PyPI): affected all versions; fixed in 0.5.0\n- sqlparse (PyPI): affected all versions; fixed in 0.5.0\n- sqlparse (PyPI): affected all versions; fixed in 0.5.0\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-4340/ (Markdown: https://insights.sbomify.com/CVE-2024-4340/index.md)","id":"CVE-2024-4340","markdown":"https://insights.sbomify.com/CVE-2024-4340/index.md","name":"CVE-2024-4340","record":{"aliases":["DEBIAN-CVE-2024-4340","ECHO-d041-0b74-8b13","GHSA-2m57-hf25-phgg","MGASA-2024-0185","OESA-2024-1533","OESA-2024-1603","OESA-2024-1646","PYSEC-2026-1940","RHSA-2024:9984","RHSA-2024:9986","ROOT-APP-PYPI-CVE-2024-4340","SUSE-SU-2024:1767-1","SUSE-SU-2024:1861-1","UBUNTU-CVE-2024-4340","USN-6771-1"],"analysis":{"component_type":"library","fix_type":"patch","impacts":["denial_of_service"],"network_reachable":"yes","non_default_config":false,"product_category":"Python SQL parser","requires_auth":"none","summary":"Attackers can cause a Denial of Service in applications using sqlparse by submitting heavily nested SQL lists, triggering a RecursionError.","user_interaction":"not_required","vuln_class":"denial_of_service"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"JFROG","cpe":[],"cvss":{"score":7.5,"severity":"high","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","version":"3.1"},"cwes":[{"id":"CWE-674","name":"Uncontrolled Recursion"}],"description":"Passing a heavily nested list to sqlparse.parse() leads to a Denial of Service due to RecursionError.","ecosystems":["PyPI","Red Hat:openstack:17.1::el8","Red Hat:openstack:17.1::el9","SUSE:Enterprise Storage 7.1","SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS","SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS","SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS","SUSE:Linux Enterprise Module for Basesystem 15 SP5","SUSE:Linux Enterprise Module for Basesystem 15 SP6","SUSE:Linux Enterprise Module for Public Cloud 15 SP4","SUSE:Linux Enterprise Module for Public Cloud 15 SP5","SUSE:Linux Enterprise Server 15 SP3-LTSS","SUSE:Linux Enterprise Server 15 SP4-LTSS","SUSE:Linux Enterprise Server for SAP Applications 15 SP3","SUSE:Linux Enterprise Server for SAP Applications 15 SP4","SUSE:Manager Proxy 4.3","SUSE:Manager Server 4.3","openSUSE:Leap 15.5"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"weaponised"},"has_fix":true,"headline":"Passing a heavily nested list to sqlparse.parse() leads to a Denial of Service due to RecursionError.","id":"CVE-2024-4340","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"PyPI","product":null,"products":[],"type":"denial_of_service","year":"2024"},"n_packages":23,"n_references":3,"next":{"headline":"IDOR in ExtremePacs's Extreme XDS","id":"CVE-2024-4341"},"packages":[{"ecosystem":"PyPI","fixed":["0.5.0"],"introduced":["0"],"last_affected":[],"package":"sqlparse","purl":null,"source":"GHSA-2m57-hf25-phgg"},{"ecosystem":"PyPI","fixed":["0.5.0"],"introduced":["0"],"last_affected":[],"package":"sqlparse","purl":"pkg:pypi/sqlparse","source":"GHSA-2m57-hf25-phgg"},{"ecosystem":"PyPI","fixed":["0.5.0"],"introduced":["0"],"last_affected":[],"package":"sqlparse","purl":"pkg:pypi/sqlparse","source":"PYSEC-2026-1940"},{"ecosystem":"Red Hat:openstack:17.1::el8","fixed":["0:0.4.1-2.el8ost"],"introduced":["0"],"last_affected":[],"package":"python-sqlparse","purl":"pkg:rpm/redhat/python-sqlparse","source":"RHSA-2024:9986"},{"ecosystem":"Red Hat:openstack:17.1::el8","fixed":["0:0.4.1-2.el8ost"],"introduced":["0"],"last_affected":[],"package":"python3-sqlparse","purl":"pkg:rpm/redhat/python3-sqlparse","source":"RHSA-2024:9986"},{"ecosystem":"Red Hat:openstack:17.1::el9","fixed":["0:0.4.1-2.el9ost"],"introduced":["0"],"last_affected":[],"package":"python-sqlparse","purl":"pkg:rpm/redhat/python-sqlparse","source":"RHSA-2024:9984"},{"ecosystem":"Red Hat:openstack:17.1::el9","fixed":["0:0.4.1-2.el9ost"],"introduced":["0"],"last_affected":[],"package":"python3-sqlparse","purl":"pkg:rpm/redhat/python3-sqlparse","source":"RHSA-2024:9984"},{"ecosystem":"SUSE:Enterprise Storage 7.1","fixed":["0.4.2-150300.12.1"],"introduced":["0"],"last_affected":[],"package":"python3-sqlparse","purl":"pkg:rpm/suse/python3-sqlparse\u0026distro=SUSE%20Enterprise%20Storage%207.1","source":"SUSE-SU-2024:1861-1"},{"ecosystem":"SUSE:Linux Enterprise High Performance Computing 15 SP3-LTSS","fixed":["0.4.2-150300.12.1"],"introduced":["0"],"last_affected":[],"package":"python3-sqlparse","purl":"pkg:rpm/suse/python3-sqlparse\u0026distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP3-LTSS","source":"SUSE-SU-2024:1861-1"},{"ecosystem":"SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS","fixed":["0.4.2-150300.12.1"],"introduced":["0"],"last_affected":[],"package":"python3-sqlparse","purl":"pkg:rpm/suse/python3-sqlparse\u0026distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP4-ESPOS","source":"SUSE-SU-2024:1861-1"},{"ecosystem":"SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS","fixed":["0.4.2-150300.12.1"],"introduced":["0"],"last_affected":[],"package":"python3-sqlparse","purl":"pkg:rpm/suse/python3-sqlparse\u0026distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP4-LTSS","source":"SUSE-SU-2024:1861-1"},{"ecosystem":"SUSE:Linux Enterprise Module for Basesystem 15 SP5","fixed":["0.4.2-150300.12.1"],"introduced":["0"],"last_affected":[],"package":"python3-sqlparse","purl":"pkg:rpm/suse/python3-sqlparse\u0026distro=SUSE%20Linux%20Enterprise%20Module%20for%20Basesystem%2015%20SP5","source":"SUSE-SU-2024:1861-1"},{"ecosystem":"SUSE:Linux Enterprise Module for Basesystem 15 SP6","fixed":["0.4.2-150300.12.1"],"introduced":["0"],"last_affected":[],"package":"python3-sqlparse","purl":"pkg:rpm/suse/python3-sqlparse\u0026distro=SUSE%20Linux%20Enterprise%20Module%20for%20Basesystem%2015%20SP6","source":"SUSE-SU-2024:1861-1"},{"ecosystem":"SUSE:Linux Enterprise Module for Public Cloud 15 SP4","fixed":["0.4.4-150400.6.7.1"],"introduced":["0"],"last_affected":[],"package":"python-sqlparse","purl":"pkg:rpm/suse/python-sqlparse\u0026distro=SUSE%20Linux%20Enterprise%20Module%20for%20Public%20Cloud%2015%20SP4","source":"SUSE-SU-2024:1767-1"},{"ecosystem":"SUSE:Linux Enterprise Module for Public Cloud 15 SP5","fixed":["0.4.4-150400.6.7.1"],"introduced":["0"],"last_affected":[],"package":"python-sqlparse","purl":"pkg:rpm/suse/python-sqlparse\u0026distro=SUSE%20Linux%20Enterprise%20Module%20for%20Public%20Cloud%2015%20SP5","source":"SUSE-SU-2024:1767-1"},{"ecosystem":"SUSE:Linux Enterprise Server 15 SP3-LTSS","fixed":["0.4.2-150300.12.1"],"introduced":["0"],"last_affected":[],"package":"python3-sqlparse","purl":"pkg:rpm/suse/python3-sqlparse\u0026distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP3-LTSS","source":"SUSE-SU-2024:1861-1"},{"ecosystem":"SUSE:Linux Enterprise Server 15 SP4-LTSS","fixed":["0.4.2-150300.12.1"],"introduced":["0"],"last_affected":[],"package":"python3-sqlparse","purl":"pkg:rpm/suse/python3-sqlparse\u0026distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP4-LTSS","source":"SUSE-SU-2024:1861-1"},{"ecosystem":"SUSE:Linux Enterprise Server for SAP Applications 15 SP3","fixed":["0.4.2-150300.12.1"],"introduced":["0"],"last_affected":[],"package":"python3-sqlparse","purl":"pkg:rpm/suse/python3-sqlparse\u0026distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2015%20SP3","source":"SUSE-SU-2024:1861-1"},{"ecosystem":"SUSE:Linux Enterprise Server for SAP Applications 15 SP4","fixed":["0.4.2-150300.12.1"],"introduced":["0"],"last_affected":[],"package":"python3-sqlparse","purl":"pkg:rpm/suse/python3-sqlparse\u0026distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2015%20SP4","source":"SUSE-SU-2024:1861-1"},{"ecosystem":"SUSE:Manager Proxy 4.3","fixed":["0.4.2-150300.12.1"],"introduced":["0"],"last_affected":[],"package":"python3-sqlparse","purl":"pkg:rpm/suse/python3-sqlparse\u0026distro=SUSE%20Manager%20Proxy%204.3","source":"SUSE-SU-2024:1861-1"},{"ecosystem":"SUSE:Manager Server 4.3","fixed":["0.4.2-150300.12.1"],"introduced":["0"],"last_affected":[],"package":"python3-sqlparse","purl":"pkg:rpm/suse/python3-sqlparse\u0026distro=SUSE%20Manager%20Server%204.3","source":"SUSE-SU-2024:1861-1"},{"ecosystem":"openSUSE:Leap 15.5","fixed":["0.4.4-150400.6.7.1"],"introduced":["0"],"last_affected":[],"package":"python-sqlparse","purl":"pkg:rpm/opensuse/python-sqlparse\u0026distro=openSUSE%20Leap%2015.5","source":"SUSE-SU-2024:1767-1"},{"ecosystem":"openSUSE:Leap 15.5","fixed":["0.4.2-150300.12.1"],"introduced":["0"],"last_affected":[],"package":"python3-sqlparse","purl":"pkg:rpm/opensuse/python3-sqlparse\u0026distro=openSUSE%20Leap%2015.5","source":"SUSE-SU-2024:1861-1"}],"prev":{"headline":"Cross-site scripting in Prime Slider – Addons for Elementor","id":"CVE-2024-4339"},"products":[],"published":"2024-04-30","related":[],"sources":[{"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":"CC BY 4.0","name":"SUSE","prefix":"SUSE"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"yes","exploitation":"poc","technical_impact":"partial"},"state":"PUBLISHED","updated":"2025-11-03","vendors":[]},"summary":"Attackers can cause a Denial of Service in applications using sqlparse by submitting heavily nested SQL lists, triggering a RecursionError.","url":"https://insights.sbomify.com/CVE-2024-4340/"}