Skip to content
DoS Disclosed report Beginner CVE-2024-2965

Denial of service in langchain-community

The SitemapLoader's parse_sitemap method in langchain-community versions below 0.2.5 lacks protection against infinite recursion when a sitemap URL refers to itself. An attacker could cause a denial of service by triggering an infinite loop that crashes the Python process.

langchain-ai/langchain

Originally disclosed on huntr

Denial of service in SitemapLoader Document Loader in the langchain-community package, affecting versions below 0.2.5. 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.

From the GitHub Advisory Database (GHSA-3hjh-jh2h-vrg6, CC BY 4.0).

The original report as published on the GitHub Advisory Database. Images and videos are our own copies; raw HTML is shown as text. View it on GitHub Advisory Database.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Impact

An attacker could crash the Python process by exceeding the maximum recursion depth, occupying server socket/port resources and impacting service availability.

What the attacker needed

A sitemap URL that refers to itself

The fix

The issue was fixed in version 0.2.5 by adding a mechanism to prevent infinite recursion.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A sitemap is a file that lists a website's pages. The SitemapLoader reads sitemaps to extract URLs, but if a sitemap points to itself, the loader keeps calling itself endlessly (infinite recursion) until the program crashes. This means an attacker could make the service unavailable.

What is DoS?

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.

More from langchain-ai/langchain

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Denial of service

The lesson behind this report.

A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.