CVE-2024-58340

CVE-2024-58340 is a high-severity vulnerability in Langchain with a CVSS 3.x base score of 7.5. It is not currently listed as actively exploited by CISA, and its EPSS exploit-prediction score is low. The underlying weakness is classified as CWE-1333.

Key facts

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.

Frequently asked questions

What is CVE-2024-58340?
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.
How severe is CVE-2024-58340?
CVE-2024-58340 has a CVSS 3.x base score of 7.5, rated high severity. It is exploitable over network with low attack complexity, requires no privileges and no user interaction. Impact on confidentiality is none, integrity none, and availability high.
Is CVE-2024-58340 being actively exploited?
It is not currently listed in CISA's KEV catalog. Its EPSS exploit-prediction score is 0% (33rd percentile), an estimate of the probability of exploitation in the next 30 days.
What products are affected by CVE-2024-58340?
CVE-2024-58340 affects Langchain. See the affected-products list for the exact vulnerable versions.
How do I fix CVE-2024-58340?
Review the linked vendor and NVD advisories for patched versions and mitigations, then upgrade or apply the recommended workaround. Given its high severity, prioritise patching exposed systems.
Does CVE-2024-58340 have an EU (EUVD) identifier?
Yes. CVE-2024-58340 is tracked in the ENISA EU Vulnerability Database (EUVD) as EUVD-2026-2399.
When was CVE-2024-58340 published?
CVE-2024-58340 was published on 2026-01-12 and last updated on 2026-06-17.

References

Affected products (1)

More vulnerabilities in Langchain

All CVEs affecting Langchain →

Other CWE-1333 vulnerabilities

Browse all CWE-1333 vulnerabilities →