Cyber Posture

CVE-2024-58340

HighPublic PoC

Published: 12 January 2026

Published
12 January 2026
Modified
21 January 2026
KEV Added
Patch
CVSS Score 7.5 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
EPSS Score 0.0008 24.1th percentile
Risk Priority 15 60% EPSS · 20% KEV · 20% CVSS

Summary

CVE-2024-58340 is a high-severity Inefficient Regular Expression Complexity (CWE-1333) vulnerability in Langchain Langchain. Its CVSS base score is 7.5 (High).

Operationally, exploitation aligns with the MITRE ATT&CK technique Application or System Exploitation (T1499.004); ranked at the 24.1th percentile by exploit likelihood (below the median); it is not currently listed in the CISA KEV catalog; a public proof-of-concept is referenced.

This vulnerability is AI-related — categorised as NLP and Transformers; in the LLM/Generative AI Risks risk domain.

Threat & Defense at a Glance

What attackers do: exploitation maps to Application or System Exploitation (T1499.004).
Threat & Defense Details

MITRE ATT&CK Enterprise TechniquesAI

T1499.004 Application or System Exploitation Impact
Adversaries may exploit software vulnerabilities that can cause an application or system to crash and deny availability to users.
Why these techniques?

ReDoS flaw directly enables application exhaustion via crafted input to the vulnerable parser, matching T1499.004 (Application or System Exploitation).

Confidence: HIGH · MITRE ATT&CK Enterprise v18.1

NVD 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…

more

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.

Deeper analysisAI

CVE-2024-58340 is a regular expression denial-of-service (ReDoS) vulnerability in LangChain versions up to and including 0.3.1. The flaw affects the MRKLOutputParser.parse() method in the file libs/langchain/langchain/agents/mrkl/output_parser.py, where a backtracking-prone regular expression is used to extract tool actions from model output. This can result in excessive CPU consumption when processing malicious input.

The vulnerability can be exploited by an attacker who can supply or influence the text parsed by MRKLOutputParser.parse(), for instance through prompt injection in downstream applications that pass LLM output directly to the parser. Successful exploitation triggers significant parsing delays and a denial-of-service condition due to high resource usage. It carries a CVSS v3.1 score of 7.5 (AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H) and is associated with CWE-1333.

Advisories and references, including the LangChain GitHub repository (https://github.com/langchain-ai/langchain), Huntr (https://huntr.com/bounties/e7ece02c-d4bb-4166-8e08-6baf4f8845bb), LangChain website (https://www.langchain.com/), and VulnCheck (https://www.vulncheck.com/advisories/langchain-mrkloutputparser-redos), provide further details on the issue.

This vulnerability is relevant to AI/ML applications built with LangChain, particularly those involving agent tooling and LLM output parsing.

Details

CWE(s)

Affected Products

langchain
langchain
≤ 0.3.1

AI Security AnalysisAI

AI Category
NLP and Transformers
Risk Domain
LLM/Generative AI Risks
OWASP Top 10 for LLMs 2025
None mapped
Classification Reason
Matched keywords: langchain, langchain, langchain, prompt injection, llm

CVEs Like This One

CVE-2026-34070Same product: Langchain Langchain
CVE-2024-12720Shared CWE-1333
CVE-2025-70030Shared CWE-1333
CVE-2026-28356Shared CWE-1333
CVE-2026-22178Shared CWE-1333
CVE-2026-1388Shared CWE-1333
CVE-2026-0621Shared CWE-1333
CVE-2026-23897Shared CWE-1333
CVE-2026-4867Shared CWE-1333
CVE-2026-35213Shared CWE-1333

References