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
| Link | Resource |
|---|---|
| https://github.com/langchain-ai/langchain | Product |
| https://huntr.com/bounties/e7ece02c-d4bb-4166-8e08-6baf4f8845bb | Exploit Issue Tracking Third Party Advisory |
| https://www.langchain.com/ | Product |
| https://www.vulncheck.com/advisories/langchain-mrkloutputparser-redos | Third Party Advisory |
Configurations
History
21 Jan 2026, 17:57
| Type | Values Removed | Values Added |
|---|---|---|
| First Time |
Langchain langchain
Langchain |
|
| CPE | cpe:2.3:a:langchain:langchain:*:*:*:*:*:*:*:* | |
| References | () https://github.com/langchain-ai/langchain - Product | |
| References | () https://huntr.com/bounties/e7ece02c-d4bb-4166-8e08-6baf4f8845bb - Exploit, Issue Tracking, Third Party Advisory | |
| References | () https://www.langchain.com/ - Product | |
| References | () https://www.vulncheck.com/advisories/langchain-mrkloutputparser-redos - Third Party Advisory | |
| CVSS |
v2 : v3 : |
v2 : unknown
v3 : 7.5 |
12 Jan 2026, 23:15
| Type | Values Removed | Values Added |
|---|---|---|
| New CVE |
Information
Published : 2026-01-12 23:15
Updated : 2026-01-21 17:57
NVD link : CVE-2024-58340
Mitre link : CVE-2024-58340
CVE.ORG link : CVE-2024-58340
JSON object : View
Products Affected
langchain
- langchain
CWE
CWE-1333
Inefficient Regular Expression Complexity
