CVE-2025-2828: CWE-918 Server-Side Request Forgery (SSRF) in langchain-ai langchain-ai/langchain
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.
AI Analysis
Technical Summary
CVE-2025-2828 is a high-severity Server-Side Request Forgery (SSRF) vulnerability identified in the RequestsToolkit component of the langchain-community package, specifically within langchain_community.agent_toolkits.openapi.toolkit.RequestsToolkit, part of the langchain-ai/langchain project version 0.0.27. SSRF vulnerabilities allow an attacker to induce the server-side application to make HTTP requests to arbitrary domains, including internal network addresses that are typically inaccessible from outside. In this case, the vulnerability arises because the RequestsToolkit does not impose restrictions on the destination of outgoing requests, permitting access to both remote internet addresses and local network addresses. This lack of validation enables attackers to perform several malicious actions: conducting port scans on internal networks, accessing local services that may not be exposed externally, retrieving sensitive instance metadata from cloud environments such as AWS or Azure (which often contain credentials or configuration data), and interacting with other servers within the local network environment. The vulnerability has been assigned a CVSS v3.0 base score of 8.4, indicating a high level of severity. The vector string (AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:H/A:H) shows that the attack can be performed remotely over the network with low attack complexity but requires high privileges and user interaction, and it affects confidentiality, integrity, and availability with a scope change. The issue was addressed and fixed in langchain-ai/langchain version 0.0.28. No known exploits have been reported in the wild as of the publication date (June 23, 2025).
Potential Impact
For European organizations using langchain-ai/langchain version 0.0.27 or earlier, this SSRF vulnerability poses significant risks. Exploitation could lead to unauthorized internal network reconnaissance, exposing sensitive internal services and infrastructure details. Access to cloud instance metadata services could result in leakage of credentials or tokens, potentially enabling further compromise of cloud resources. The ability to interact with local network servers may facilitate lateral movement within an organization's network, increasing the risk of data breaches or service disruptions. Given the high CVSS score and the potential for confidentiality, integrity, and availability impacts, organizations relying on this package in production environments—especially those integrating with cloud services—face elevated risks. The requirement for high privileges and user interaction somewhat limits the attack surface but does not eliminate the threat, particularly in environments where trusted users might be tricked into initiating malicious requests. This vulnerability could also be leveraged in targeted attacks against critical infrastructure or sensitive data repositories within European enterprises, amplifying potential operational and reputational damage.
Mitigation Recommendations
1. Immediate upgrade to langchain-ai/langchain version 0.0.28 or later, where the SSRF vulnerability has been fixed, is the primary mitigation step. 2. Implement strict network egress filtering on servers running langchain to restrict outbound HTTP requests to only trusted and necessary destinations, preventing unauthorized access to internal or cloud metadata endpoints. 3. Employ application-layer controls to validate and sanitize any user inputs or parameters that influence outbound requests within the RequestsToolkit to prevent injection of malicious URLs. 4. Monitor and log outbound requests from applications using langchain to detect unusual patterns indicative of SSRF exploitation attempts, such as requests to internal IP ranges or cloud metadata IP addresses. 5. Conduct regular security audits and penetration tests focusing on SSRF vectors in applications that incorporate langchain, ensuring no residual or similar vulnerabilities exist. 6. Educate privileged users about the risks of interacting with untrusted inputs that could trigger SSRF attacks, reducing the likelihood of successful exploitation requiring user interaction. 7. For cloud deployments, enforce metadata service access controls (e.g., AWS IMDSv2 enforcement) to mitigate the impact of SSRF attacks attempting to retrieve sensitive instance metadata.
Affected Countries
Germany, France, United Kingdom, Netherlands, Sweden, Finland, Denmark, Belgium, Italy, Spain
CVE-2025-2828: CWE-918 Server-Side Request Forgery (SSRF) in langchain-ai langchain-ai/langchain
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.
AI-Powered Analysis
Technical Analysis
CVE-2025-2828 is a high-severity Server-Side Request Forgery (SSRF) vulnerability identified in the RequestsToolkit component of the langchain-community package, specifically within langchain_community.agent_toolkits.openapi.toolkit.RequestsToolkit, part of the langchain-ai/langchain project version 0.0.27. SSRF vulnerabilities allow an attacker to induce the server-side application to make HTTP requests to arbitrary domains, including internal network addresses that are typically inaccessible from outside. In this case, the vulnerability arises because the RequestsToolkit does not impose restrictions on the destination of outgoing requests, permitting access to both remote internet addresses and local network addresses. This lack of validation enables attackers to perform several malicious actions: conducting port scans on internal networks, accessing local services that may not be exposed externally, retrieving sensitive instance metadata from cloud environments such as AWS or Azure (which often contain credentials or configuration data), and interacting with other servers within the local network environment. The vulnerability has been assigned a CVSS v3.0 base score of 8.4, indicating a high level of severity. The vector string (AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:H/A:H) shows that the attack can be performed remotely over the network with low attack complexity but requires high privileges and user interaction, and it affects confidentiality, integrity, and availability with a scope change. The issue was addressed and fixed in langchain-ai/langchain version 0.0.28. No known exploits have been reported in the wild as of the publication date (June 23, 2025).
Potential Impact
For European organizations using langchain-ai/langchain version 0.0.27 or earlier, this SSRF vulnerability poses significant risks. Exploitation could lead to unauthorized internal network reconnaissance, exposing sensitive internal services and infrastructure details. Access to cloud instance metadata services could result in leakage of credentials or tokens, potentially enabling further compromise of cloud resources. The ability to interact with local network servers may facilitate lateral movement within an organization's network, increasing the risk of data breaches or service disruptions. Given the high CVSS score and the potential for confidentiality, integrity, and availability impacts, organizations relying on this package in production environments—especially those integrating with cloud services—face elevated risks. The requirement for high privileges and user interaction somewhat limits the attack surface but does not eliminate the threat, particularly in environments where trusted users might be tricked into initiating malicious requests. This vulnerability could also be leveraged in targeted attacks against critical infrastructure or sensitive data repositories within European enterprises, amplifying potential operational and reputational damage.
Mitigation Recommendations
1. Immediate upgrade to langchain-ai/langchain version 0.0.28 or later, where the SSRF vulnerability has been fixed, is the primary mitigation step. 2. Implement strict network egress filtering on servers running langchain to restrict outbound HTTP requests to only trusted and necessary destinations, preventing unauthorized access to internal or cloud metadata endpoints. 3. Employ application-layer controls to validate and sanitize any user inputs or parameters that influence outbound requests within the RequestsToolkit to prevent injection of malicious URLs. 4. Monitor and log outbound requests from applications using langchain to detect unusual patterns indicative of SSRF exploitation attempts, such as requests to internal IP ranges or cloud metadata IP addresses. 5. Conduct regular security audits and penetration tests focusing on SSRF vectors in applications that incorporate langchain, ensuring no residual or similar vulnerabilities exist. 6. Educate privileged users about the risks of interacting with untrusted inputs that could trigger SSRF attacks, reducing the likelihood of successful exploitation requiring user interaction. 7. For cloud deployments, enforce metadata service access controls (e.g., AWS IMDSv2 enforcement) to mitigate the impact of SSRF attacks attempting to retrieve sensitive instance metadata.
For access to advanced analysis and higher rate limits, contact root@offseq.com
Technical Details
- Data Version
- 5.1
- Assigner Short Name
- @huntr_ai
- Date Reserved
- 2025-03-26T17:46:45.448Z
- Cvss Version
- 3.0
- State
- PUBLISHED
Threat ID: 6859c00fa220c77d4f671f26
Added to database: 6/23/2025, 8:58:55 PM
Last enriched: 6/23/2025, 9:00:29 PM
Last updated: 6/23/2025, 9:00:29 PM
Views: 1
Related Threats
CVE-2025-6525: Improper Authorization in 70mai 1S
MediumCVE-2025-6524: Improper Authentication in 70mai 1S
LowCVE-2025-52561: CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in JuliaComputing HTMLSanitizer.jl
MediumCVE-2025-23092: n/a
HighCVE-2025-52562: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in ConvoyPanel panel
CriticalActions
Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.
Need enhanced features?
Contact root@offseq.com for Pro access with improved analysis and higher rate limits.