CVE-2024-58340 Details
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.
A regular expression denial-of-service (ReDoS) vulnerability has been identified in LangChain versions through 0.3.1. The issue resides in the MRKLOutputParser's parse() method, where a backtracking-prone regular expression is used to extract tool actions from model output. This vulnerability can be exploited by an attacker who supplies or influences the text being parsed, such as through prompt injection in applications that directly pass LLM output to the parser. The crafted payload can cause excessive CPU usage, leading to significant parsing delays and a denial-of-service condition.
Metrics
CVSS 4.0 Severity and Vector Strings:
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed Jan 13, 2026References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
| URL | Source(s) | Tag(s) |
|---|---|---|
| https://github.com/langchain-ai/langchain | [email protected] | Product |
| https://huntr.com/bounties/e7ece02c-d4bb-4166-8e08-6baf4f8845bb | [email protected] | ExploitIssue TrackingThird Party Advisory |
| https://www.langchain.com/ | [email protected] | Product |
| https://www.vulncheck.com/advisories/langchain-mrkloutputparser-redos | [email protected] | Third Party Advisory |
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-1333 | Inefficient Regular Expression Complexity | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| langchain langchain | <= 0.3.1 |
CPE
Remediation
| |
Change History
5 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jul 14, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Jan 21, 2026 | Initial Analysis | [email protected] |
| Jan 12, 2026 | New CVE Received | [email protected] |