CVE-2024-58340: CWE-1333 Inefficient Regular Expression Complexity in LangChain AI LangChain
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 Analysis
Technical Summary
CVE-2024-58340 is a high severity vulnerability (CVSS 8.7) affecting LangChain AI's LangChain product up to version 0.3.1. The issue is a ReDoS vulnerability in the MRKLOutputParser.parse() method, where a backtracking-prone regular expression is applied to extract tool actions from model output. If an attacker can supply or influence the input text parsed by this method, such as through prompt injection in downstream applications that pass LLM output directly into this parser, they can trigger excessive CPU usage. This results in significant delays during parsing and can cause denial-of-service conditions.
Potential Impact
Exploitation of this vulnerability allows an unauthenticated attacker who can influence the input to the MRKLOutputParser.parse() method to cause excessive CPU consumption. This leads to significant parsing delays and denial-of-service conditions, potentially disrupting the availability of applications relying on LangChain's parsing functionality.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. 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.
CVE-2024-58340: CWE-1333 Inefficient Regular Expression Complexity in LangChain AI LangChain
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.
CVSS v4.0
Score 8.7high
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
CVE-2024-58340 is a high severity vulnerability (CVSS 8.7) affecting LangChain AI's LangChain product up to version 0.3.1. The issue is a ReDoS vulnerability in the MRKLOutputParser.parse() method, where a backtracking-prone regular expression is applied to extract tool actions from model output. If an attacker can supply or influence the input text parsed by this method, such as through prompt injection in downstream applications that pass LLM output directly into this parser, they can trigger excessive CPU usage. This results in significant delays during parsing and can cause denial-of-service conditions.
Potential Impact
Exploitation of this vulnerability allows an unauthenticated attacker who can influence the input to the MRKLOutputParser.parse() method to cause excessive CPU consumption. This leads to significant parsing delays and denial-of-service conditions, potentially disrupting the availability of applications relying on LangChain's parsing functionality.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. 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.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- VulnCheck
- Date Reserved
- 2026-01-09T20:28:41.285Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 69658281da2266e838450d22
Added to database: 01/12/2026, 23:23:45 UTC
Last enriched: 07/15/2026, 09:48:32 UTC
Last updated: 09/10/2026, 19:36:49 UTC
Views: 486
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.