PyPI: langchain-community
CVE-2024-3095
Safety vulnerability ID: SFTY-20240606-11333
Safety legacy ID: pyup.io-71924
A Server-Side Request Forgery (SSRF) vulnerability exists in the Web Research Retriever component of affected versions of langchain-ai/langchain. The vulnerability arises because the Web Research Retriever does not restrict requests to remote internet addresses, allowing it to reach local addresses. This flaw enables attackers to execute port scans, access local services, and in some scenarios, read instance metadata from cloud environments. The vulnerability is particularly concerning as it can be exploited to abuse the Web Explorer server as a proxy for web attacks on third parties and interact with servers in the local network, including reading their response data. This could potentially lead to arbitrary code execution, depending on the nature of the local services. The vulnerability is limited to GET requests, as POST requests are not possible, but the impact on confidentiality, integrity, and availability is significant due to the potential for stolen credentials and state-changing interactions with internal APIs.
Overview
Server-Side Request Forgery in langchain-community.retrievers.web_research.WebResearchRetriever
Advisory
A Server-Side Request Forgery (SSRF) vulnerability exists in the Web Research Retriever component of affected versions of langchain-ai/langchain. The vulnerability arises because the Web Research Retriever does not restrict requests to remote internet addresses, allowing it to reach local addresses. This flaw enables attackers to execute port scans, access local services, and in some scenarios, read instance metadata from cloud environments. The vulnerability is particularly concerning as it can be exploited to abuse the Web Explorer server as a proxy for web attacks on third parties and interact with servers in the local network, including reading their response data. This could potentially lead to arbitrary code execution, depending on the nature of the local services. The vulnerability is limited to GET requests, as POST requests are not possible, but the impact on confidentiality, integrity, and availability is significant due to the potential for stolen credentials and state-changing interactions with internal APIs.
How to Fix
Mitigation and Workarounds
---
Vulnerable Functions
Functions linked to known vulnerabilities.
References
- https://getsafety.com/vulnerabilities/SFTY-20240606-11333/CVE-2024-3095
- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-3095
- https://github.com/advisories/GHSA-q25c-c977-4cmh
- https://github.com/langchain-ai/langchain/commit/604dfe2d99246b0c09f047c604f0c63eafba31e7
- https://huntr.com/bounties/e62d4895-2901-405b-9559-38276b6a5273
- https://nvd.nist.gov/vuln/detail/CVE-2024-3095
- https://huntr.com/bounties/e62d4895-2901-405b-9559-38276b6a5273
- https://github.com/langchain-ai/langchain/pull/24451
- https://github.com/langchain-ai/langchain/commit/604dfe2d99246b0c09f047c604f0c63eafba31e7
- https://github.com/langchain-ai/langchain/releases/tag/langchain-community%3D%3D0.2.9
- https://github.com/advisories/GHSA-q25c-c977-4cmh
Verified by Safety
Our Cybersecurity Intelligence Team reviewed this vulnerability. We combine public data with our own research to find issues not yet reported to public sources.
Learn more
