{"answers":{"affected":"1 open source package ship an affected version, including langchain-exa. It affects 1 product.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-58340 exists.","fix":"Upgrade langchain-exa to 1.0.0a1 or later.","what":"CVE-2024-58340 is a high-severity denial of service vulnerability in LangChain, published on 12 Jan 2026. 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-58340 and fix it if it is affected.\n\nWhat it is: CVE-2024-58340 is a high-severity denial of service vulnerability in LangChain, published on 12 Jan 2026. 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-58340 exists.\n\nAffected packages and fixed versions:\n- langchain-exa (PyPI): affected all versions; fixed in 1.0.0a1\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-58340/ (Markdown: https://insights.sbomify.com/CVE-2024-58340/index.md)","id":"CVE-2024-58340","markdown":"https://insights.sbomify.com/CVE-2024-58340/index.md","name":"CVE-2024-58340","record":{"aliases":["GHSA-pq2w-3m7x-qx76","PYSEC-2026-75"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["denial_of_service"],"network_reachable":"yes","non_default_config":false,"product_category":"Python LLM framework","requires_auth":"none","summary":"Attackers can cause denial of service in LangChain applications by triggering excessive CPU consumption via crafted input to the MRKLOutputParser.","user_interaction":"not_required","vuln_class":"denial_of_service"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"VulnCheck","cpe":[{"product":"langchain","vendor":"langchain"}],"cvss":{"score":8.7,"severity":"high","source":"cna","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N","version":"4.0"},"cwes":[{"id":"CWE-1333","name":"Inefficient Regular Expression Complexity"}],"description":"LangChain versions up to and including 0.3.1 contain a regular expression denial-of-service (ReDoS) vulnerability in the MRKLOutputParser.parse() method (libs/langchain/langchain/agents/mrkl/output_parser.py). The parser applies a backtracking-prone regular expression when extracting tool actions from model output. An attacker who can supply or influence the parsed text (for example via prompt injection in downstream applications that pass LLM output directly into MRKLOutputParser.parse()) can trigger excessive CPU consumption by providing a crafted payload, causing significant parsing delays and a denial-of-service condition.","ecosystems":["PyPI"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"weaponised"},"has_fix":true,"headline":"LangChain \u003c= 0.3.1 MRKLOutputParser ReDoS","id":"CVE-2024-58340","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"PyPI","product":null,"products":[],"type":"denial_of_service","year":"2024"},"n_packages":1,"n_references":4,"next":{"headline":"OpenCart Core 4.0.2.3 SQL Injection via search Parameter","id":"CVE-2024-58341"},"packages":[{"ecosystem":"PyPI","fixed":["1.0.0a1"],"introduced":["0"],"last_affected":[],"package":"langchain-exa","purl":"pkg:pypi/langchain-exa","source":"PYSEC-2026-75"}],"prev":{"headline":"LlamaIndex \u003c= 0.12.2 VannaQueryEngine SQL Execution Allows Resource Exhaustion","id":"CVE-2024-58339"},"products":["LangChain"],"published":"2026-01-12","related":[{"cvss_score":9.8,"headline":"Langchain vulnerable to arbitrary code execution via the evaluate function in the numexpr library","id":"CVE-2023-39631","kev_date_added":null,"published":"2023-09-01"},{"cvss_score":9.8,"headline":"langchain vulnerable to arbitrary code execution","id":"CVE-2023-36281","kev_date_added":null,"published":"2023-08-22"},{"cvss_score":9.8,"headline":"LangChain vulnerable to arbitrary code execution","id":"CVE-2023-38860","kev_date_added":null,"published":"2023-08-15"},{"cvss_score":9.8,"headline":"LangChain vulnerable to arbitrary code execution","id":"CVE-2023-38896","kev_date_added":null,"published":"2023-08-15"},{"cvss_score":9.8,"headline":"LangChain vulnerable to arbitrary code execution","id":"CVE-2023-39659","kev_date_added":null,"published":"2023-08-15"},{"cvss_score":9.8,"headline":"langchain Code Injection vulnerability","id":"CVE-2023-36095","kev_date_added":null,"published":"2023-08-05"},{"cvss_score":9.8,"headline":"langchain vulnerable to arbitrary code execution","id":"CVE-2023-36188","kev_date_added":null,"published":"2023-07-06"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"PyPA Advisory Database","prefix":"PYSEC"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"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":"2026-07-14","vendors":["LangChain AI"]},"summary":"Attackers can cause denial of service in LangChain applications by triggering excessive CPU consumption via crafted input to the MRKLOutputParser.","url":"https://insights.sbomify.com/CVE-2024-58340/"}