LiveActive security incident?Get immediate response
CVE Record

CVE-2024-58340: LangChain <= 0.3.1 MRKLOutputParser ReDoS

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.

HighCVSS 8.7Not KEV-listedUpdated
Glexia's TakeAutomated analysishigh

Security readout for executives and security teams

Plain-English summary

A crafted LLM response can make LangChain's MRKLOutputParser consume excessive CPU while parsing tool actions. Apps using vulnerable LangChain and feeding attacker-influenced model output into this parser can suffer delays or denial of service. The source bundle does not show confirmed real-world exploitation.

Executive priority

Prioritize review for customer-facing AI agents, chatbots, or automation services using LangChain MRKL parsing. This is a denial-of-service risk, not a data theft claim in the provided evidence, but high availability impact makes timely remediation appropriate.

Technical view

LangChain through 0.3.1 has CWE-1333 ReDoS in MRKLOutputParser.parse() at libs/langchain/langchain/agents/mrkl/output_parser.py. The vulnerable regex is backtracking-prone when extracting tool actions from model output, allowing attacker-influenced parsed text to trigger high CPU consumption and parsing delays.

Likely exposure

Exposure is likely limited to applications running LangChain up to and including 0.3.1 that use MRKLOutputParser.parse() on untrusted or prompt-injectable LLM output. General LangChain use without this parser path is not proven exposed by the bundle.

Exploitation context

The bundle references public technical reporting and exploit material, but KEV is false and no cited source states active exploitation. Practical abuse requires a path to influence text parsed by MRKLOutputParser, such as prompt injection in an agent workflow.

Researcher notes

The key uncertainty is patch specificity: the bundle states LangChain through 0.3.1 is affected but does not name a fixed version. Avoid assuming all LangChain deployments are vulnerable; validate the parser path and whether prompt injection or untrusted output can reach it.

Mitigation direction

  • Identify LangChain versions and MRKLOutputParser usage in deployed services.
  • Check LangChain and advisory guidance for the fixed or non-affected release.
  • Upgrade vulnerable LangChain deployments when a vendor-supported fixed version is confirmed.
  • Apply parser timeouts, request limits, and worker isolation around LLM output parsing.
  • Reduce direct parsing of attacker-influenced model output where feasible.

Validation and detection

  • Search dependency manifests and lockfiles for LangChain versions up to 0.3.1.
  • Review agent code for MRKLOutputParser.parse() or MRKL agent output parsing.
  • Trace whether external users can influence model output reaching the parser.
  • Confirm runtime controls cap CPU time, request duration, and queue impact.
  • Retest after upgrade or mitigation using non-destructive malformed-output cases.
Prepared
Confidence
medium
Sources
6

Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.

Potential ATT&CK relevance

Conservative CVE-to-ATT&CK context

These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.

ATT&CK lookup starting points

Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.

cwe · low confidence lookup

CWE-1333: Exact CWE lookup

Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.

Open ATT&CK lookup
cve · low confidence lookup

CVE-2024-58340 mapping review

Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.

Open ATT&CK lookup
Vulnerability profileCVE Program record
Severity
High
CVSS
8.7 (4.0)
Known Exploited
No
Published

Vector: 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

Official CVE source material

CNA and ADP enrichment extracted from CVE v5

These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.

1CVSS vectors
3Timeline events
1ADP providers
5Source links

SSVC decision data

CISA-ADPCISA Coordinator
Timestamp
Version
2.0.3
Exploitation: pocAutomatable: yesTechnical Impact: partial

CVSS vector scores

1 official score

We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.

ScoreVersionSeverityVectorExploitImpactSource
8.7CVSS 4.0HighCVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:NVulnCheck

Vulnerability scoring details

Base CVSS 4.0 score

8.7High
CVSS 4.0 vector shape for CVE-2024-58340Attack VectorAttack ComplexityAttack RequirementsPrivileges RequiredUser InteractionVS ConfidentialityVS IntegrityVS AvailabilitySS ConfidentialitySS IntegritySS Availability

Vector: 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

Attack Vector
NetworkAdjacentLocalPhysical
Attack Complexity
LowHigh
Attack Requirements
NonePresent
Privileges Required
NoneLowHigh
User Interaction
NonePassiveActive
VS Confidentiality
HighLowNone
VS Integrity
HighLowNone
VS Availability
HighLowNone
SS Confidentiality
HighLowNone
SS Integrity
HighLowNone
SS Availability
HighLowNone

Vulnerability timeline

Timeline events are normalized from CVE metadata, CNA source timelines, ADP timelines, and KEV metadata when present.

  1. CVE reservedCVE Program

    The CVE ID was reserved by the assigning CNA.

  2. CVE publishedCVE Program

    The CVE record was published.

  3. CVE updatedCVE Program

    The CVE record metadata indicates this as the latest update time.

ADP provider summaries

CISA-ADPCISA ADP Vulnrichment
other:ssvc

Source materials

Affected products

Products and packages named in the record

VendorProductVersion / packageStatus
LangChain AILangChain0unknown
Weakness

CWE details

CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.

CWE-1333 · source CWE mapping

Inefficient Regular Expression Complexity

Inefficient Regular Expression Complexity represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.