Skip to main content
CVE-2024-58340VulnerabilityPublished Updated

CVE-2024-58340: LangChain · ReDoS

Affects LangChainSource CVE Database V5

0

Not known to be exploited · CVSS 8.7 High.

Data as of 26 Oct 2026, 07:57 UTC

CVSS 4.0 base score
8.7High
How severe the flaw is on the 0–10 CVSS scale.
EPSS
0.4% chance of exploitation in 30 days – higher than 41% of CVEsExploit Prediction Scoring System: the likelihood attackers will use this flaw soon.
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

Exploitation evidence

  1. Disclosed: evidence found.

    CVE published 12 Jan 2026

  2. Detectable: no evidence on record.

    No public nuclei template indexed

  3. Weaponised: no evidence on record.

    No public exploit code indexed in Metasploit or Exploit-DB

  4. Exploited in the wild: no evidence on record.

    Not in CISA KEV and no source reports exploitation

  5. Observed by OffSeq Mirage: no evidence on record.

    No attack traffic recorded by OffSeq Mirage sensors

A missing step is not evidence of safety. Sources: cve.org (opens in a new tab), the Metasploit, Exploit-DB and nuclei-templates index as of 2026-10-26.

What to do

Affected software

ProductAffectedFixed in
LangChain AILangChainAffected
  • <=0.3.1
Fixed in–
PyPIlangchainpkg:pypi/langchainOther threatsAffected
  • <=0.3.1
  • =0
Fixed in–
GitHubLangChainpkg:github/LangChainOther threatsAffected
  • <=0.3.1
Fixed in–

Check your own hosts for these packages with threat-finder (opens in a new tab), our free open-source scanner.

AI-suggested

Until an official fix is available, avoid passing untrusted or attacker-controlled input directly into the MRKLOutputParser.parse() method to reduce the risk of triggering the ReDoS condition.

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.

References

Community reviews

Loading reviews…