CVE-2025-2828: LangChain RequestsToolkit: SSRF exposes cloud metadata
GHSA-h5gc-rm8j-5gpr CRITICAL PoC AVAILABLE CISA: ATTENDAny LangChain deployment using RequestsToolkit (OpenAPI agents) is exposed to CVSS 10.0 SSRF requiring zero authentication. An attacker can pivot through your agent to steal AWS/Azure instance credentials via metadata endpoints, scan internal networks, and access private services. Upgrade langchain-community to ≥0.0.28 immediately — this is a patch-now situation before your next deployment window.
Risk Assessment
CVSS 10.0 with network-accessible vector, zero authentication, no user interaction, and scope change represents maximum theoretical severity. EPSS (0.00052) reflects low current exploitation activity, but the attack is trivial to execute — no AI/ML knowledge required, just a standard SSRF payload. LangChain is widely deployed in production AI systems, and cloud-hosted agents are at highest risk due to IMDSv1 metadata exposure. Any org running LangChain OpenAPI agents should treat this as critical priority.
Affected Systems
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| langchain | pip | — | No patch |
| langchain-community | pip | < 0.0.28 | 0.0.28 |
Severity & Risk
Attack Surface
Recommended Action
6 steps-
PATCH
Upgrade langchain-community to ≥0.0.28 immediately — patch is available and targeted.
-
NETWORK
Block egress from agent hosts to 169.254.169.254 (IMDS), 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 via firewall/security groups — network-level defense independent of patch status.
-
AWS
Enforce IMDSv2 (require session tokens) on all EC2 instances running LangChain agents to neutralize IMDS credential theft even if SSRF succeeds.
-
AUDIT
Grep codebase for RequestsToolkit and OpenAPIToolkit instantiations; verify all are on patched version.
-
DETECT
Alert on HTTP requests to RFC-1918 or link-local (169.254.x.x) addresses originating from agent processes.
-
ISOLATE
Run LangChain agents in isolated network namespaces or VPCs with explicit egress allowlists rather than default-allow.
CISA SSVC Assessment
Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.
Classification
Compliance Impact
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2025-2828?
Any LangChain deployment using RequestsToolkit (OpenAPI agents) is exposed to CVSS 10.0 SSRF requiring zero authentication. An attacker can pivot through your agent to steal AWS/Azure instance credentials via metadata endpoints, scan internal networks, and access private services. Upgrade langchain-community to ≥0.0.28 immediately — this is a patch-now situation before your next deployment window.
Is CVE-2025-2828 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2025-2828, increasing the risk of exploitation.
How to fix CVE-2025-2828?
1. PATCH: Upgrade langchain-community to ≥0.0.28 immediately — patch is available and targeted. 2. NETWORK: Block egress from agent hosts to 169.254.169.254 (IMDS), 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 via firewall/security groups — network-level defense independent of patch status. 3. AWS: Enforce IMDSv2 (require session tokens) on all EC2 instances running LangChain agents to neutralize IMDS credential theft even if SSRF succeeds. 4. AUDIT: Grep codebase for RequestsToolkit and OpenAPIToolkit instantiations; verify all are on patched version. 5. DETECT: Alert on HTTP requests to RFC-1918 or link-local (169.254.x.x) addresses originating from agent processes. 6. ISOLATE: Run LangChain agents in isolated network namespaces or VPCs with explicit egress allowlists rather than default-allow.
What systems are affected by CVE-2025-2828?
This vulnerability affects the following AI/ML architecture patterns: agent frameworks, OpenAPI integration agents, LLM-powered API automation, RAG pipelines with external data fetching, cloud-hosted AI assistants.
What is the CVSS score for CVE-2025-2828?
CVE-2025-2828 has a CVSS v3.1 base score of 10.0 (CRITICAL). The EPSS exploitation probability is 0.17%.
Technical Details
NVD 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.
Exploitation Scenario
Attacker interacts with a customer-facing LangChain OpenAPI agent — such as an AI assistant with web browsing or API integration capabilities. Attacker crafts a query that causes the agent to invoke RequestsToolkit with URL http://169.254.169.254/latest/meta-data/iam/security-credentials/ (AWS IMDSv1). Since RequestsToolkit applies no URL or address filtering, it fetches the endpoint and returns temporary IAM credentials bound to the agent host's instance role. Attacker now holds valid AWS credentials potentially granting access to S3, RDS, Secrets Manager, and other services in scope of that IAM role — full cloud lateral movement from a single LLM query. No AI/ML expertise required; this is a known SSRF pattern applied to an AI agent surface.
Weaknesses (CWE)
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H References
- github.com/advisories/GHSA-h5gc-rm8j-5gpr
- github.com/pypa/advisory-database/tree/main/vulns/langchain-community/PYSEC-2025-70.yaml
- nvd.nist.gov/vuln/detail/CVE-2025-2828
- github.com/langchain-ai/langchain/commit/e188d4ecb085d4561a0be3c583d26aa9c2c3283f Patch
- huntr.com/bounties/8f771040-7f34-420a-b96b-5b93d4a99afc Exploit 3rd Party
- github.com/B1ack4sh/Blackash-CVE-2025-2828 Exploit
- github.com/nomi-sec/PoC-in-GitHub Exploit
- github.com/tanjiti/sec_profile Exploit
Timeline
Related Vulnerabilities
CVE-2023-36258 9.8 LangChain: unauthenticated RCE via code injection
Same package: langchain CVE-2023-34540 9.8 LangChain: RCE via JiraAPIWrapper crafted input
Same package: langchain CVE-2023-29374 9.8 LangChain: RCE via prompt injection in LLMMathChain
Same package: langchain CVE-2023-34541 9.8 LangChain: RCE via unsafe load_prompt deserialization
Same package: langchain CVE-2023-36188 9.8 LangChain: RCE via PALChain unsanitized Python exec
Same package: langchain
AI Threat Alert