# CVE-2024-2965: Denial-of-Service in LangChain SitemapLoader in langchain-ai/langchain

- Severity: Medium 4.2 (CVSS:3.0, scored by @huntr_ai) `CVSS:3.0/AV:P/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H`
- 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.30%, higher than 24% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2024-06-06T18:52:54.353Z
- Modified: 2026-07-13T16:43:37.506Z
- Also known as: GHSA-3hjh-jh2h-vrg6, PYSEC-2024-118, PYSEC-2026-2561
- Weaknesses: CWE-400, CWE-674
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial
- Assigned by: @huntr_ai

## Description

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.

(As written by CVE List.)

## Affected

- langchain-ai langchain-ai/langchain: from unspecified before 0.2.5
- langchain langchain: before *; before 0.2.5
- langchain-community (PyPI): before 0.2.5
- langchain (PyPI): before 0.2.5; before 73c42306745b0831aa6fe7fe4eeb70d2c2d87a82

## Every score

- @huntr_ai: CVSS:3.0 4.2 Medium `CVSS:3.0/AV:P/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H`
- GitHub: CVSS:3.0 4.2 Medium `CVSS:3.0/AV:P/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H`
- NVD: CVSS:3.1 4.7 Medium `CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H`
- PyPA Advisory Database: CVSS:3.1 4.7 Medium `CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H`
- PyPA Advisory Database: CVSS:3.0 4.2 Medium `CVSS:3.0/AV:P/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H`

## References

- <https://huntr.com/bounties/90b0776d-9fa6-4841-aac4-09fde5918cae> (exploit, evidence, third-party-advisory, web)
- <https://github.com/langchain-ai/langchain/commit/73c42306745b0831aa6fe7fe4eeb70d2c2d87a82> (fix, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2024-2965> (advisory)
- <https://github.com/langchain-ai/langchain/pull/22903> (web)
- <https://github.com/langchain-ai/langchain/commit/9a877c7adbd06f90a2518152f65b562bd90487cc> (web)
- <https://github.com/langchain-ai/langchain> (package)
- <https://github.com/pypa/advisory-database/tree/main/vulns/langchain/PYSEC-2024-118.yaml> (web)
- <https://github.com/advisories/GHSA-3hjh-jh2h-vrg6> (advisory)
- <https://pypi.org/project/langchain-community> (package)

## Sources

- CVE List: [CVE-2024-2965](https://www.cve.org/CVERecord?id=CVE-2024-2965), CVE Terms of Use, modified 2025-10-15
- GitHub Advisory Database: [GHSA-3hjh-jh2h-vrg6](https://github.com/advisories/GHSA-3hjh-jh2h-vrg6), CC-BY-4.0, modified 2026-07-13
- NVD: [CVE-2024-2965](https://nvd.nist.gov/vuln/detail/CVE-2024-2965), Public domain, modified 2026-06-17
- PyPA Advisory Database: [PYSEC-2024-118](https://osv.dev/vulnerability/PYSEC-2024-118), CC-BY-4.0, modified 2026-07-13
- PyPA Advisory Database: [PYSEC-2026-2561](https://osv.dev/vulnerability/PYSEC-2026-2561), CC-BY-4.0, modified 2026-07-13

---

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