Ad

CVE-2024-58340

HIGH CVSS 4.0: 8.7 EPSS 0.08%
Updated Mar 05, 2026
Langchain
Parameter Value
CVSS 8.7 (HIGH)
Affected Versions before 0.3.1
Type CWE-1333 (Inefficient Regular Expression Complexity / ReDoS)
Vendor Langchain
Public PoC No

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.

Attack Parameters

Attack Vector
Network
Can be exploited remotely
Attack Complexity
Low
Easy to exploit
Attack Requirements
None
No additional conditions
Privileges Required
None
No privileges needed
User Interaction
None
No user interaction needed

Impact Assessment

Confidentiality
None
No data leak
Integrity
None
No data modification
Availability
High
Complete denial of service

CVSS Vector v4.0

Vulnerable Products 1

Configuration From (including) Up to (excluding)
Langchain Langchain_Core
cpe:2.3:a:langchain:langchain_core:*:*:*:*:*:python:*:*
<= 0.3.1