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

CVE-2024-3095: Server-Side Request Forgery in langchain-community.retrievers.web_research.WebResearchRetriever

mediumCVSS 3.0 4.8GHSA-q25c-c977-4cmh

The `WebResearchRetriever` in `langchain-community` fetches any URL it is given, including local and internal addresses. An attacker can use it for port scans, to reach internal services, or to read cloud instance metadata. Versions below 0.2.9 are affected. Upgrade to 0.2.9 and opt in with `allow_dangerous_requests`.

Published Jun 6, 2024 · Updated Jul 24, 2024 · Analysis Nov 2, 2026

What an attacker can do

This is a server-side request forgery. WebResearchRetriever does not restrict requests to remote internet addresses, so a URL pointing at localhost, a private network host or a cloud metadata address works. Only GET requests are possible.

The advisory lists three uses: port scanning, reading responses from local services and cloud metadata, and using the research server as a proxy against third parties. With stolen cloud credentials, or a GET that changes state on an internal API, the impact goes beyond reading data. The advisory notes code execution is possible depending on the local services.

The retriever is typically driven by search results and model-chosen URLs, so a prompt or a poisoned web page can steer which addresses it fetches. The CVSS 3.0 vector needs local access and high complexity, but it carries a changed scope.

Who is affected

pip package langchain-community older than 0.2.9, in apps that use langchain_community.retrievers.web_research.WebResearchRetriever, especially on cloud hosts or inside private networks.

pip show langchain-community

langchain-community

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

How to fix it

Upgrade to langchain-community 0.2.9.

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

The patched retriever takes an opt-in parameter, allow_dangerous_requests, which defaults to False. You must set it to True explicitly to acknowledge the risk. The PR also suggests mitigating with a proxy that blocks requests to local addresses. Egress filtering on the host, and enforcing IMDSv2 on cloud instances, add a second layer, though the advisory does not state those.

How to tell if you were hit

Review outbound request logs from the app for connections to loopback, RFC 1918 ranges, or 169.254.169.254. Check cloud metadata access logs for reads from the application host that you do not expect. Check where WebResearchRetriever is used and what feeds it URLs.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

A Server-Side Request Forgery (SSRF) vulnerability exists in the Web Research Retriever component in langchain-community (langchain-community.retrievers.web_research.WebResearchRetriever). 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.

The patched code:

  • Requires users to opt-in
  • Suggests using a proxy to prevent requests to local addresses

Credited to eyurtsev.

Questions

Why does 0.2.9 require `allow_dangerous_requests`?

The fix did not block local addresses. It makes users opt in knowingly, and suggests a proxy that blocks local destinations. Without the opt-in the retriever refuses to run.

Can this send POST requests?

No. The advisory says the flaw is limited to GET requests. It still warns about stolen credentials and state-changing GETs on internal APIs.

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