Denial-of-Service in LangChain SitemapLoader in langchain-ai/langchain
Key facts
- Attack vector
- Local
- Privileges required
- Low
- User interaction
- None
- Attack complexity
- High
- Impact type
- Denial of service
- Confidentiality · integrity · availability
- None · None · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · NVD. Fix status from CNA and GitHub. Impact type from CWE-674.
Summary
A Denial-of-Service (DoS) vulnerability exists in the `SitemapLoader` class of the `langchain-ai/langchain` repository, affecting all versions. The `parse_sitemap` method, responsible for parsing sitemaps and extracting URLs, lacks a mechanism to prevent infinite recursion when a sitemap URL refers to the current sitemap itself. This oversight allows for the possibility of an infinite loop, leading to a crash by exceeding the maximum recursion depth in Python. This vulnerability can be exploited to occupy server socket/port resources and crash the Python process, impacting the availability of services relying on this functionality.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- No
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| langchain-ai | langchain-ai/langchain | before 0.2.5 | 0.2.5 | Patch available | CNA |
| — | langchain-community (PyPI) | before 0.2.5 | 0.2.5 | Patch available | GHSA-3hjh-jh2h-vrg6 |
| — | langchain (PyPI) | before 0.2.5 | 0.2.5 | Patch available | GHSA-3hjh-jh2h-vrg6 |
- langchain-ai/langchain Vendorlangchain-ai Affected before 0.2.5 Fixed in 0.2.5 Patch available CNA
- langchain-community (PyPI) Vendor— Affected before 0.2.5 Fixed in 0.2.5 Patch available GHSA-3hjh-jh2h-vrg6
- langchain (PyPI) Vendor— Affected before 0.2.5 Fixed in 0.2.5 Patch available GHSA-3hjh-jh2h-vrg6
CPE configurations NVD · 1
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:langchain:langchain:*:*:*:*:*:*:*:* | before 0.2.5 | Vulnerable | langchain-ai |
- cpe:2.3:a:langchain:langchain:*:*:*:*:*:*:*:* Versions before 0.2.5 Vulnerable ·langchain-ai
Remediation
- Fix · CNA langchain-ai/langchain (langchain-ai) Fixed in 0.2.5
- Fix · GHSA-3hjh-jh2h-vrg6 langchain-community (PyPI) Fixed in 0.2.5 Advisory →
- Fix · GHSA-3hjh-jh2h-vrg6 langchain (PyPI) Fixed in 0.2.5 Advisory →
Vendor assessments
Red Hat
Red Hat rating: Moderate. Red Hat's page for this CVE →
Not affected: 3 products
- OpenShift Lightspeed
- Red Hat Ansible Automation Platform 2
- Red Hat Enterprise Linux AI (RHEL AI)
Timeline
- 2026-10-02 Threatist record created from CVE-2024-2965
- 2026-10-03 Alias added: GHSA-3hjh-jh2h-vrg6
References
Other 5
- https://github.com/langchain-ai/langchain/commit/73c42306745b0831aa6fe7fe4eeb70d2c2d87a82
- https://github.com/langchain-ai/langchain/pull/22903
- https://github.com/langchain-ai/langchain/commit/9a877c7adbd06f90a2518152f65b562bd90487cc
- https://github.com/langchain-ai/langchain
- https://github.com/pypa/advisory-database/tree/main/vulns/langchain/PYSEC-2024-118.yaml
More langchain-ai Langchain vulnerabilities
- TI-2023-20724 An issue in langchain langchain-ai v.0.0.232 and before allows a remote attacker to… CVSS 3.1CRITICAL 9.8
- TI-2023-20706 An issue in LanChain-ai Langchain v.0.0.245 allows a remote attacker to execute arbitrary… CVSS 3.1CRITICAL 9.8
- TI-2023-20166 An issue in Harrison Chase langchain v.0.0.194 and before allows a remote attacker to… CVSS 3.1CRITICAL 9.8
- TI-2023-20136 An issue in LangChain v.0.0.231 allows a remote attacker to execute arbitrary code via the prompt parameter. CVSS 3.1CRITICAL 9.8
- TI-2023-18185 An issue in langchain v.0.0.171 allows a remote attacker to execute arbitrary code via a… CVSS 3.1CRITICAL 9.8
- TI-2023-18176 An issue in LangChain before 0.0.236 allows an attacker to execute arbitrary code because… CVSS 3.1CRITICAL 9.8
Sources
- CVE-2024-2965 · CVE Program
- CVE-2024-2965 · NVD
- FIRST EPSS
- GHSA-3hjh-jh2h-vrg6 · GitHub Advisory Database · CC BY 4.0
- CVE-2024-2965 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences