CVE-2025-2828: LangChain RequestsToolkit: SSRF exposes cloud metadata
GHSA-h5gc-rm8j-5gprCRITICALPoC AVAILABLECISA: 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.
What is the risk?
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.
What systems are affected?
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| LangChain | pip | — | No patch |
| LangChain Community | pip | < 0.0.28 | 0.0.28 |
How severe is it?
What is the attack surface?
What should I do?
6 stepsPATCH
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.
What does CISA's SSVC say?
Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.
How is it classified?
Which compliance frameworks are affected?
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 21.02%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0037Data from Local SystemAML.T0049Exploit Public-Facing ApplicationAML.T0053AI Agent Tool InvocationAML.T0075Cloud Service DiscoveryAML.T0086Exfiltration via AI Agent Tool InvocationCompliance Controls Affected
What are the technical details?
Original Advisory
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)
CWE-918 — Server-Side Request Forgery (SSRF): The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.
- [Implementation, Operation] If there is a known list of applications, IP, hostname, and/or domains to which the product is allowed to communicate, then use allowlists to ensure that outgoing requests are restricted to these known entities. The allowlists could be in the application code or possibly enforced by firewalls or network segmentation [REF-1511].
- [Implementation, Operation] If the product is expected to be able to connect to arbitrary IP addresses or domains, consider using a denylist that includes private network addresses, internal domain names, etc. The denylist could be in the application code or possibly enforced by firewalls or network segmentation [REF-1511].
Source: MITRE CWE corpus.
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:HReferences
- 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/e188d4ecb085d4561a0be3c583d26aa9c2c3283fPatch
- huntr.com/bounties/8f771040-7f34-420a-b96b-5b93d4a99afcExploit3rd Party
- github.com/B1ack4sh/Blackash-CVE-2025-2828Exploit
- github.com/nomi-sec/PoC-in-GitHubExploit
- github.com/tanjiti/sec_profileExploit
Timeline
Related Vulnerabilities
CVE-2023-362589.8LangChain: unauthenticated RCE via code injection
Same package: langchainCVE-2023-345409.8LangChain: RCE via JiraAPIWrapper crafted input
Same package: langchainCVE-2023-293749.8LangChain: RCE via prompt injection in LLMMathChain
Same package: langchainCVE-2023-345419.8LangChain: RCE via unsafe load_prompt deserialization
Same package: langchainCVE-2023-361889.8LangChain: RCE via PALChain unsanitized Python exec
Same package: langchain