Skip to main content

LangChain CVE-2024-58340

HIGH
Inefficient Regular Expression Complexity (ReDoS) (CWE-1333)
2026-01-12 disclosure@vulncheck.com
8.7
CVSS 4.0 · Vendor: vulncheck
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Craft ReDoS payload text
  2. Delivery
    Inject via prompt injection into agent input
  3. Exploit
    LLM emits crafted string
  4. Execution
    MRKLOutputParser.parse() triggers catastrophic backtracking
  5. Persist
    CPU exhaustion hangs worker
  6. Impact
    Service denial for users

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A06:2021 - Vulnerable and Outdated Components
ASVS 5.0
V2 - Validation and Business Logic Regex complexity limits
MITRE ATT&CK

1 technique across 1 tactic: Impact

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires that the target application uses LangChain's MRKL agent and passes attacker-influenceable text into MRKLOutputParser.parse() - most realistically via indirect/prompt-injection channels where the attacker shapes the LLM's output rather than calling the parser directly. The affected feature is specifically the MRKL output parser in langchain <= 0.3.1; applications using structured/JSON tool-calling agents or other parsers are not affected. Limiting factors: the crafted payload must reach the parser (an attacker with no path to influence parsed text cannot trigger it), the impact is availability-only (no data disclosure or code execution), and effective payloads generally need enough length to force catastrophic backtracking, so input-length limits or parse timeouts materially reduce risk.

Impact

The CVSS 4.0 base score is 8.7 (High) with vector AV:N/AC:L/AT:N/PR:N/UI:N and VA:H but VC:N/VI:N - impact is confined to availability, with no confidentiality or integrity loss. Signals conflict on true priority: the CVSS is high and public exploit code exists, but EPSS is only 0.08% (23rd percentile) and there is no KEV listing, suggesting real-world mass exploitation is unlikely and any attack would be targeted rather than opportunistic. Importantly, the PR:N/network rating assumes an attacker can get crafted text to the parser; in practice this usually requires an indirect prompt-injection path (the attacker influences LLM output that the app forwards into the parser) rather than a direct exposed endpoint, so exploitability depends heavily on how the downstream application is built. Net: a genuine availability risk worth patching for anyone running MRKL agents on attacker-influenced input, but not an emergency for most deployments given the DoS-only impact and low EPSS.

Exploit ScenarioDerived

In an app that lets users chat with a MRKL agent, an attacker embeds a prompt-injection payload (for example in a document or web page the agent will read) that steers the LLM into emitting a specially crafted string; when the application feeds that output into MRKLOutputParser.parse(), the backtracking regex spikes CPU and hangs the request. Repeating this ties up worker threads and degrades or denies service for other users. Public exploit code is referenced in the huntr bounty, lowering the effort required.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.1% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv2 – Jul 14, 2026

Denial-of-service in LangChain versions up to and including 0.3.1 lets remote attackers exhaust CPU by feeding a crafted string into the MRKLOutputParser.parse() method, whose backtracking-prone regular expression exhibits catastrophic backtracking (ReDoS). Because MRKL agents parse LLM output to extract tool actions, an attacker who can influence that text - typically via prompt injection in downstream applications - can stall or hang the parsing thread. Publicly available exploit code exists (huntr bounty), though EPSS is low at 0.08% and it is not on the CISA KEV list.

Earlier versions of this analysis (1)
v1 Mar 12, 2026 - 21:54 CVSS 7.5

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). [CVSS 7.5 HIGH]

RemediationAI

Patch available per vendor advisory: upgrade LangChain to a version later than 0.3.1 that hardens the MRKL parser regex (confirm the exact fixed release against the VulnCheck advisory at https://www.vulncheck.com/advisories/langchain-mrkloutputparser-redos and the upstream repository https://github.com/langchain-ai/langchain before deploying, as no specific fixed version number was provided in this input). If immediate upgrade is not possible, reduce exposure by not passing untrusted or raw LLM output directly into MRKLOutputParser.parse(): impose a strict length cap on text handed to the parser (catastrophic backtracking requires a sizeable crafted payload, so bounding input length blunts the attack at the cost of truncating very long legitimate agent outputs), enforce a wall-clock timeout or run parsing in a separate worker/thread that can be killed so a hung regex cannot block the main service, and add input sanitization or prompt-injection defenses upstream to limit an attacker's ability to shape parsed text. Consider migrating off the MRKL agent to a structured/JSON tool-calling agent that does not rely on regex parsing of free-form output.

Affected Packages

pypi langchain-exa fix: 1.0.0a1

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in pypi

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The affected component is LangChain's MRKL (Modular Reasoning, Knowledge and Language) agent output parser, libs/langchain/langchain/agents/mrkl/output_parser.py, which turns free-form LLM text into structured Action/Action Input tool invocations. The root cause is CWE-1333 (Inefficient Regular Expression Complexity): the parser uses a regex whose structure permits catastrophic backtracking, so a specially shaped input causes the regex engine's matching time to grow super-linearly. The affected CPE is cpe:2.3:a:langchain:langchain:*:*:*:*:*:*:*:*, the Python langchain package. The exposure exists specifically where application code passes untrusted or model-generated text directly into MRKLOutputParser.parse(), which is common in agentic pipelines that route tool-using LLM responses through this parser.

Know when Langchain gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (vulncheck) PRIMARY 8.7 HIGH
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
vuln.today AI 7.5 HIGH

Remotely reachable via attacker-influenced parser input with no auth or interaction, and impact is availability-only through CPU-exhausting ReDoS, so C:N/I:N/A:H.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
Red Hat 5.3 MEDIUM

Primary rating from Vendor (vulncheck).

CVSS VectorVendor: vulncheck

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
None
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

4
Analysis Updated
Jul 14, 2026 - 23:28 vuln.today
v2 - CVSS changed
CVSS changed
Jul 14, 2026 - 23:22 NVD
7.5 (HIGH) 8.7 (HIGH)
PoC Detected
Jan 21, 2026 - 17:57 vuln.today
Public exploit code
CVE Published
Jan 12, 2026 - 23:15 nvd
HIGH 7.5

DescriptionCVE.org

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.

Executive ViewAI

Why It Matters

LangChain versions up to 0.3.1 are vulnerable to denial-of-service attacks with publicly available exploit code, allowing attackers to trigger application hangs and service unavailability through prompt injection vectors. Organizations running LangChain-based services face operational disruption risk; this vulnerability requires urgent patching of all affected systems. Service availability and end-user experience are at immediate risk without remediation.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.1%
Top 77% exploitable
Prevalence
High
LangChain is a widely adopted Python framework for LLM applications
Exploit
POC
Public exploit code exists
Data Quality
5 sources
Confidence: Medium
NVD CVE.org EPSS Vendor GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC Yes
EPSS 0.1%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Out-of-Cycle
Exploitation· derived
Poc
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact
High

Priority Score

64
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +44
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

Affected Products (CPE)CVE.org

cpe:2.3:a:langchain:langchain:*:*:*:*:*:*:*:*
CVE-2026-27966 CRITICAL POC
9.8 Feb 26

Code injection in Langflow CSV Agent node before 1.8.0. The node hardcodes allow_dangerous_code=True, enabling arbitrary

CVE-2023-36095 CRITICAL POC
9.8 Aug 05

An issue in Harrison Chase langchain v.0.0.194 allows an attacker to execute arbitrary code via the python exec calls in

CVE-2025-2828 CRITICAL POC
10.0 Jun 23

A remote code execution vulnerability in langchain-ai/langchain (CVSS 10.0). Risk factors: public PoC available. Vendor

CVE-2024-8309 CRITICAL POC
9.8 Oct 29

A vulnerability in the GraphCypherQAChain class of langchain-ai/langchain version 0.2.5 allows for SQL injection through

CVE-2024-7042 CRITICAL POC
9.8 Oct 29

A vulnerability in the GraphCypherQAChain class of langchain-ai/langchainjs versions 0.2.5 and all versions with this cl

CVE-2024-46946 CRITICAL POC
9.8 Sep 19

langchain_experimental (aka LangChain Experimental) 0.1.17 through 0.3.0 for LangChain allows attackers to execute arbit

CVE-2024-2057 CRITICAL POC
9.8 Mar 01

A vulnerability was found in LangChain langchain_community 0.0.26. Rated critical severity (CVSS 9.8), this vulnerabilit

CVE-2023-39631 CRITICAL POC
9.8 Sep 01

An issue in LanChain-ai Langchain v.0.0.245 allows a remote attacker to execute arbitrary code via the evaluate function

CVE-2023-36281 CRITICAL POC
9.8 Aug 22

An issue in langchain v.0.0.171 allows a remote attacker to execute arbitrary code via a JSON file to load_prompt. Rated

CVE-2023-39659 CRITICAL POC
9.8 Aug 15

An issue in langchain langchain-ai v.0.0.232 and before allows a remote attacker to execute arbitrary code via a crafted

CVE-2023-38896 CRITICAL POC
9.8 Aug 15

An issue in Harrison Chase langchain v.0.0.194 and before allows a remote attacker to execute arbitrary code via the fro

CVE-2023-38860 CRITICAL POC
9.8 Aug 15

An issue in LangChain v.0.0.231 allows a remote attacker to execute arbitrary code via the prompt parameter. Rated criti

Vendor StatusVendor

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy