CVE-2024-58340CWE-1333

LangChain <= 0.3.1 MRKLOutputParser ReDoS

High · published January 12, 2026

CVSS v4.0
8.7
EPSS
0%
Percentile
40.5
In the wild
Unconfirmed
What it is

⚡ A regular expression vulnerability in LangChain could leave your system gasping for breath! This ReDoS issue lurks in MRKLOutputParser.parse() and can be triggered by crafty input. 🔥 Imagine a restaurant where the chef gets overwhelmed with a flood of orders all coming in at once, causing delays that leave hungry customers waiting forever. In this case, the MRKLOutputParser is the chef, and a well-crafted input is like a deluge of confusing instructions that slows everything down. An attacker could exploit this vulnerability to intentionally overload the parser, leading to excessive CPU usage and substantial delays in processing. This could bring the application to a standstill, effectively denying service to legitimate users.

Put simply

Imagine a restaurant where the chef gets overwhelmed with a flood of orders all coming in at once, causing delays that leave hungry customers waiting forever. In this case, the MRKLOutputParser is the chef, and a well-crafted input is like a deluge of confusing instructions that slows everything down. This vulnerability results from a backtracking-prone regular expression in the MRKLOutputParser.parse() method that can be exploited through crafted input, causing the parser to consume excessive CPU resources.

What to do

An attacker could exploit this vulnerability to intentionally overload the parser, leading to excessive CPU usage and substantial delays in processing. This could bring the application to a standstill, effectively denying service to legitimate users. To remediate this issue, upgrade LangChain to version 0.3.2 or later, where the regex has been optimized for performance. Additionally, validate and sanitize all inputs that could be passed to the parser to mitigate potential exploits. You've got this! With these steps, you can secure your application from this pesky ReDoS vulnerability and keep things running smoothly. 🛡️

The record
Technical detail
CVSS v4.0
8.7 · HIGH
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
EPSS
0.00481 · 40.5th percentile
Weakness
CWE-1333 · Inefficient Regular Expression Complexity
Published
2026-01-12T23:05Z
EPSS history
Timeline
  • 12 JAN 23:05Z
    LangChain <= 0.3.1 MRKLOutputParser ReDoS
    cvelistv5