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

- Severity: High 8.7 (CVSS:4.0, scored by VulnCheck) `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`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.48%, higher than 43% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-01-12T23:05:00.801Z
- Modified: 2026-07-14T23:17:18.157Z
- Also known as: PYSEC-2026-75
- Weaknesses: CWE-1333
- SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial
- Assigned by: VulnCheck

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

(As written by CVE List.)

## Affected

- LangChain AI LangChain: up to 0.3.1
- langchain langchain: up to 0.3.1
- langchain-exa (PyPI): before 1.0.0a1

## Every score

- VulnCheck: CVSS:4.0 8.7 High `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: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- PyPA Advisory Database: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`

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

- CVE List: [CVE-2024-58340](https://www.cve.org/CVERecord?id=CVE-2024-58340), CVE Terms of Use, modified 2026-07-14
- NVD: [CVE-2024-58340](https://nvd.nist.gov/vuln/detail/CVE-2024-58340), Public domain, modified 2026-07-14
- PyPA Advisory Database: [PYSEC-2026-75](https://osv.dev/vulnerability/PYSEC-2026-75), CC-BY-4.0, modified 2026-05-20

---

Page: https://cve.day/CVE-2024-58340 · Whole record: https://cve.day/CVE-2024-58340.json · Rebuilt by cve.day 2026-11-25T22:58:52.960Z
