CVE-2025-2828 SSRF Vulnerability in RequestsToolkit in langchain-ai/langchain

High 8.4 Published Updated

Attackers can exploit SSRF in RequestsToolkit to access local services and cloud metadata, requiring an upgrade to the langchain-community package.

Exploited in the wild
Not known
Login needed
An administrator
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2025-2828?

CVE-2025-2828 is a high-severity server-side request forgery vulnerability in langchain-ai/langchain, published on 23 Jun 2025. An attacker needs administrator access to exploit it, and only if a user opens a file or follows a link.

Official description

A Server-Side Request Forgery (SSRF) vulnerability exists in the RequestsToolkit component of the langchain-community package (specifically, langchain_community.agent_toolkits.openapi.toolkit.RequestsToolkit) in langchain-ai/langchain version 0.0.27. This vulnerability occurs because the toolkit does not enforce restrictions on requests to remote internet addresses, allowing it to also access local addresses. As a result, an attacker could exploit this flaw to perform port scans, access local services, retrieve instance metadata from cloud environments (e.g., Azure, AWS), and interact with servers on the local network. This issue has been fixed in version 0.0.28.

Weakness: CWE-918

Which versions are affected by CVE-2025-2828?

3 open source packages ship an affected version, including langchain-community. It affects 1 product.

PackageAffectedFixed in
langchain-community PyPIAll versions0.0.28
langchain-community PyPIAll versions0.0.28
langchain-community PyPIAll versions0.0.28

Products include Langchain Langchain.

How do I fix CVE-2025-2828?

Upgrade langchain-community to 0.0.28 or later.

Upgrade, and send outbound requests through an allow-list that blocks internal addresses. More about Server-side request forgery.

Is CVE-2025-2828 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-2828 exists.

Sources

Also known as GHSA-h5gc-rm8j-5gpr, PYSEC-2025-70.

Is CVE-2025-2828 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free