CVE-2024-58340

7.5 HIGH
Published: January 12, 2026 Modified: January 21, 2026
View on NVD

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.

AI Explanation

Get an AI-powered plain-language explanation of this vulnerability and remediation steps.

Login to generate AI explanation

CVSS v3.x Details

0.0 Low Medium High Critical 10.0
Vector String
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

References to Advisories, Solutions, and Tools

Patch Vendor Advisory Exploit Third Party Advisory
https://github.com/langchain-ai/langchain
Source: disclosure@vulncheck.com
Product
https://huntr.com/bounties/e7ece02c-d4bb-4166-8e08-6baf4f8845bb
Source: disclosure@vulncheck.com
Exploit Issue Tracking Third Party Advisory
https://www.langchain.com/
Source: disclosure@vulncheck.com
Product
https://www.vulncheck.com/advisories/langchain-mrkloutputparser-redos
Source: disclosure@vulncheck.com
Third Party Advisory

4 reference(s) from NVD

Quick Stats

CVSS v3 Score
7.5 / 10.0
EPSS (Exploit Probability)
0.1%
24th percentile
Exploitation Status
Not in CISA KEV

Weaknesses (CWE)

Affected Vendors

langchain