8.7high
LangChain <= 0.3.1 MRKLOutputParser ReDoS
- Severity
- 8.7high CVSS:4.0 by VulnCheck
- Exploit likelihood
- 0.48% (higher than 43% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- VulnCheck
- Also known as
- PYSEC-2026-75
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| LangChain AI LangChain | up to 0.3.1 | CVE List |
| langchain langchain | up to 0.3.1 | NVD |
| langchain-exa (PyPI) | before 1.0.0a1 | PyPA Advisory Database |
All scores
| VulnCheck | 8.7high CVSS:4.0 | 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 |
| NVD | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| PyPA Advisory Database | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
Classification
SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial.
What each source says
CVE List
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.
NVD (es)
Las versiones de LangChain hasta la 0.3.1 inclusive contienen una vulnerabilidad de denegación de servicio por expresión regular (ReDoS) en el método MRKLOutputParser.parse() (libs/langchain/langchain/agents/mrkl/output_parser.py). El analizador aplica una expresión regular propensa a retrocesos al extraer acciones de herramientas de la salida del modelo. Un atacante que puede suministrar o influir en el texto analizado (por ejemplo, mediante inyección de prompt en aplicaciones posteriores que pasan la salida del LLM directamente a MRKLOutputParser.parse()) puede desencadenar un consumo excesivo de CPU al proporcionar una carga útil manipulada, causando retrasos significativos en el análisis y una condición de denegación de servicio.
References
| https://huntr.com/bounties/e7ece02c-d4bb-4166-8e08-6baf4f8845bb | exploit, issue-tracking, report, technical-description, third-party-advisory | |
| https://www.langchain.com/ | product, web | |
| https://github.com/langchain-ai/langchain | package, product | |
| https://www.vulncheck.com/advisories/langchain-mrkloutputparser-redos | advisory, third-party-advisory | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2024-58340 changed 2026-07-14 | CVE Terms of Use |
| NVD | CVE-2024-58340 changed 2026-07-14 | Public domain |
| PyPA Advisory Database | PYSEC-2026-75 changed 2026-05-20 | CC-BY-4.0 |