CVE-2024-3095 SSRF in Langchain Web Research Retriever in langchain-ai/langchain

Medium 4.8 Published Updated

Attackers can exploit SSRF in Langchain's Web Research Retriever to access local services, read metadata, and potentially execute code.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2024-3095?

CVE-2024-3095 is a medium-severity server-side request forgery vulnerability in langchain-ai/langchain, published on 6 Jun 2024. It can only be exploited from the same machine or local network, with no action from the victim.

Official description

A Server-Side Request Forgery (SSRF) vulnerability exists in the Web Research Retriever component of langchain-ai/langchain version 0.1.5. The vulnerability arises because the Web Research Retriever does not restrict requests to remote internet addresses, allowing it to reach local addresses. This flaw enables attackers to execute port scans, access local services, and in some scenarios, read instance metadata from cloud environments. The vulnerability is particularly concerning as it can be exploited to abuse the Web Explorer server as a proxy for web attacks on third parties and interact with servers in the local network, including reading their response data. This could potentially lead to arbitrary code execution, depending on the nature of the local services. The vulnerability is limited to GET requests, as POST requests are not possible, but the impact on confidentiality, integrity, and availability is significant due to the potential for stolen credentials and state-changing interactions with internal APIs.

Weakness: CWE-918

Which versions are affected by CVE-2024-3095?

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

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

Products include Langchain Langchain.

How do I fix CVE-2024-3095?

Upgrade langchain-community to 0.2.9 or later.

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

Is CVE-2024-3095 being exploited?

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

Sources

Also known as GHSA-q25c-c977-4cmh, PYSEC-2026-1516.

Is CVE-2024-3095 in your software?

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

Check your SBOMs for free