Bug 2428827 (CVE-2024-58340) - CVE-2024-58340 langchain: LangChain MRKLOutputParser ReDoS
Summary: CVE-2024-58340 langchain: LangChain MRKLOutputParser ReDoS
Keywords:
Status: NEW
Alias: CVE-2024-58340
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Product Security
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2026-01-13 00:10 UTC by OSIDB Bzimport
Modified: 2026-01-13 20:22 UTC (History)
42 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description OSIDB Bzimport 2026-01-13 00:10:38 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.