🛡️ CVE-2024-58340 — langchain
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.
How this vulnerability can be exploited
This issue can be reached over the network, attack complexity is low, an attacker needs no privileges on the target. No user interaction is required. The scope is unchanged, so the impact stays within the vulnerable component. Rated impact: confidentiality none, integrity none, availability high.
Weakness class
CVE-2024-58340 is classified as CWE-1333: Inefficient Regular Expression Complexity. A regular expression backtracks catastrophically on crafted input, consuming CPU out of proportion to input size.
Affected software
CVE-2024-58340 is recorded against 2 packages.
- langchain (fixed in 0.3.1)
- langchain-exa (fixed in 1.0.0a1)
Timeline and source
Published on 12 January 2026 and last revised on 14 July 2026. A public exploit is known to exist, which raises the urgency of patching considerably. Record sourced from NVD.
References
Details
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Affected Packages
| Software | From version | Fixed in |
|---|---|---|
| langchain | — | 0.3.1 |
| langchain-exa | — | 1.0.0a1 |
References
Similar Threats
- Medium CVE-2024-2965
- Medium CVE-2024-1455
- Low CVE-2024-28088
- Medium CVE-2024-2057
- Low CVE-2024-0243
More CVE 2024 advisories
Browse all of CVE 2024 in the advisory index.
Exploit Protection
Are you running langchain?
CVE-2024-58340 carries CVSS 7.5 High rating and a public exploit already exists. BotEraser checks your installation against this and other known CVE records, and blocks IPs associated with exploit activity.
Check My Site For CVE-2024-58340 →No credit card required · Results in minutes
ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.