LangChainPublished 12 Jan 2026NVD status: Analyzed

CVE-2024-58340

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).

ComponentLangChain
Severityhigh (CVSS 7.5)
CVSS vectorCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Published (NVD)2026-01-12
Last modified2026-07-14
Affected versions
<= 0.3.1
from the CVE Program record written by the CNA that assigned the CVE
Fixed insee the vendor advisory
WeaknessCWE-1333
CISA KEVnot listed

Versions, checked against NVD

NVD's analysis gives the same ranges as the CVE record written by VulnCheck, the CNA that assigned the CVE.

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 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.

What to do

  • No fixed release is known yet: follow the vendor advisory below and keep LangChain off the public internet until a fix ships.
  • Do not expose the component's API or UI to the internet without authentication in front of it.

Sources