Skip to main content
EPSS 0.5%top 61%

CVE-2024-58340: CWE-1333 Inefficient Regular Expression Complexity in LangChain AI LangChain

0
High
VulnerabilityCVE-2024-58340cvecve-2024-58340cwe-1333
Published: 01/12/2026 (01/12/2026, 23:05:00 UTC)
Source: CVE Database V5
Vendor/Project: LangChain AI
Product: 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

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vuln. Confidentiality
None
Vuln. Integrity
None
Vuln. Availability
High
Subsq. Confidentiality
None
Subsq. Integrity
None
Subsq. Availability
None
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

Affected software

langchain
pkg:pypi/langchain
Affected versions
<=0.3.1=0

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 07/15/2026, 09:48:32 UTC

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.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

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 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses