CVE-2024-58340 LangChain <= 0.3.1 MRKLOutputParser ReDoS
- Published
- Updated
- Exploit status
- No public exploit known
- CISA SSVC
- Proof of concept public · automatable: yes · technical impact: partial
- Technology
- Red Hat
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.
Upgrade path
6 packages: 3 fixed, 3 with no fix yet.
| Package | Affected | Fixed in | Status |
|---|---|---|---|
| redhat/rhelai3/bootc-cuda-rhel9(Red Hat enterprise_linux_ai 3) | All versions | No fix listed | No fix yet |
| redhat/rhelai3/disk-image-cuda-rhel9(Red Hat enterprise_linux_ai 3) | All versions | No fix listed | No fix yet |
| redhat/rhoai/odh-trustyai-ragas-lls-provider-dsp-rhel9(Red Hat openshift_ai) | All versions | No fix listed | No fix yet |
| @langchain langchain | <= 0.3.1 | after 0.3.1 | Fixed |
| langchain-ai langchain | <= 0.3.1 | after 0.3.1 | Fixed |
| pypi langchain-exa(PyPI) | < 1.0.0a1; = 0.0.1; = 0.1.0; = 0.2.0 +3 more | 1.0.0a1 | Fixed |
Affected products
| Product | Affected versions | Fixed in |
|---|---|---|
| pypi langchain-exa(PyPI) | < 1.0.0a1 | 1.0.0a1 |
| pypi langchain-exa(PyPI) | = 0.0.1 | No fix listed |
| pypi langchain-exa(PyPI) | = 0.1.0 | No fix listed |
| pypi langchain-exa(PyPI) | = 0.2.0 | No fix listed |
| pypi langchain-exa(PyPI) | = 0.2.1 | No fix listed |
| pypi langchain-exa(PyPI) | = 0.3.0 | No fix listed |
| pypi langchain-exa(PyPI) | = 0.3.1 | No fix listed |
| langchain-ai langchain | <= 0.3.1 | No fix listed |
| redhat/rhelai3/bootc-cuda-rhel9(Red Hat:enterprise_linux_ai:3) | All versions | No fix listed |
| redhat/rhelai3/disk-image-cuda-rhel9(Red Hat:enterprise_linux_ai:3) | All versions | No fix listed |
| redhat/rhoai/odh-trustyai-ragas-lls-provider-dsp-rhel9(Red Hat:openshift_ai) | All versions | No fix listed |
| @langchain langchain | <= 0.3.1 | No fix listed |
References
- www.langchain.com product
- www.vulncheck.com third-party-advisory vendor-advisory
- huntr.com exploit issue-tracking technical-description third-party-advisory
- github.com product
- Red Hat CVE page mitigation vendor-advisory
- Red Hat Bugzilla 2428827 issue-tracking
- www.cve.org
- nvd.nist.gov