NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · LangChain

CVE-2025-2828: LangChain Community SSRF vulnerability exists in RequestsToolkit component

highCVSS 3.0 8.4GHSA-h5gc-rm8j-5gpr

CVE-2025-2828 is a server-side request forgery in the RequestsToolkit component of langchain-community. The toolkit lets an agent send HTTP requests to any address, including local and internal ones, so an attacker steering the agent can scan ports, hit local services and read cloud metadata. Fixed in langchain-community 0.0.28.

Published Jun 23, 2025 · Updated Jul 17, 2025 · Analysis Nov 1, 2026

What an attacker can do

langchain_community.agent_toolkits.openapi.toolkit.RequestsToolkit gives an LLM agent tools that make GET, POST and similar requests. The toolkit places no limit on the target, so the agent can reach private addresses as well as public ones. An attacker who can influence what the agent does, for example through a prompt, a poisoned document or a web page it reads, can make the server issue requests from inside your network.

The advisory lists what that buys: port scans, access to local services, instance metadata on cloud hosts such as Azure and AWS, and contact with other servers on the local network. Cloud metadata endpoints are the most serious, since they can hand out temporary credentials for the host's role. The CVSS 3.0 vector scores scope as changed and confidentiality, integrity and availability as high, though it also lists high privileges and user interaction.

The fix commit, titled "Add dangerous parameter to requests tool", does not filter addresses. It adds an allow_dangerous_requests flag that defaults to False, and the request tools raise a ValueError unless the caller sets it to True. This forces developers to acknowledge the risk. It does not block internal targets once enabled. The EPSS score is near the 97th percentile.

Who is affected

The pip package langchain-community before 0.0.28. The advisory text names version 0.0.27 as the one checked. Applications are exposed if they build an agent with RequestsToolkit, or OpenAPIToolkit, which includes it, and give it to a model that processes untrusted input. Check the version:

pip show langchain-community

Search your code for RequestsToolkit and OpenAPIToolkit.

langchain-community

Ecosystem
PyPI
Affected
< 0.0.28
Fixed in
0.0.28
Check
pip show langchain-community

How to fix it

Upgrade to langchain-community 0.0.28 or later:

pip install --upgrade "langchain-community>=0.0.28"

After the upgrade, constructing RequestsToolkit or the request tools fails with a ValueError unless you pass allow_dangerous_requests=True. Setting it only acknowledges the risk and does not restrict targets. Pair it with your own controls: run the agent where it cannot reach internal services or the cloud metadata address, and use network egress rules or an allow-list proxy.

How to tell if you were hit

Look in agent and proxy logs for requests from your application host to private ranges, to link-local addresses such as 169.254.169.254, or to localhost ports it does not normally call. Check cloud audit logs for use of the instance role from unusual places. Review agent traces for tool calls from RequestsToolkit whose URLs were chosen by user or document text.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

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.

Questions

Which langchain-community version fixes CVE-2025-2828?

0.0.28. The advisory says it was found in 0.0.27.

Does the fix block internal addresses?

Per the fix commit, no. It adds an allow_dangerous_requests flag that must be set to True, defaulting to False. Once set, internal targets are still reachable, so restrict egress yourself.

What can an attacker reach?

The advisory lists local services, ports on the local network, and instance metadata on cloud environments such as Azure and AWS.

Is it exploited in the wild?

No source we read reports exploitation, and it is not in the CISA KEV catalog.

References

How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology

More LangChain vulnerabilities

All LangChain entries