CVE-2023-46229: LangChain Server Side Request Forgery vulnerability
LangChain before 0.0.317 has an SSRF flaw in its web crawling document loaders. A crawl that starts at an external server can follow links to an internal server, so an attacker who controls a crawled page can make the application fetch internal URLs. Upgrade the langchain package to 0.0.317.
Published Oct 19, 2023 · Updated Sep 30, 2024 · Analysis Nov 2, 2026
What an attacker can do
The advisory ties the flaw to document_loaders/recursive_url_loader.py: crawling can proceed from an external server to an internal one. The loader follows links found on pages. An attacker who controls or influences a page that your application crawls can place links to internal addresses, such as localhost services, private network hosts or a cloud metadata endpoint. The application then fetches them from inside your network and may load the response into documents or a vector store.
The CVSS 3.1 vector (AV:N, PR:N, UI:R) shows a network attacker with no privileges who needs some user action, such as someone pointing the app at a URL. It rates confidentiality, integrity and availability impact as high. In practice the risk depends on what the application does with crawled text: if the content reaches users or an LLM prompt, internal data can leak.
The linked fix, pull request 11925, edits the sitemap loader, sitemap.py. It makes that loader fetch only URLs under the same scheme and domain as the sitemap by default, adding a restrict_to_same_domain option. The page does not mention recursive_url_loader.py, so verify behavior of the loader you use.
Who is affected
The pip package langchain in every version before 0.0.317. Applications that use the recursive URL loader, or the sitemap loader, to crawl sites they do not control are the exposed ones. Check:
pip show langchainSearch your code for RecursiveUrlLoader and SitemapLoader.
langchain
- Ecosystem
- PyPI
- Affected
- >= 0, < 0.0.317
- Fixed in
- 0.0.317
- Check
pip show langchain
How to fix it
Upgrade langchain to 0.0.317 or later:
pip install --upgrade "langchain>=0.0.317"The sources give no other workaround. After upgrading, keep crawl targets to sites you trust, and block the application's access to internal ranges and 169.254.169.254 at the network layer. Those two steps are general hardening and not advice from the advisory.
How to tell if you were hit
Look at egress and proxy logs from hosts that run LangChain crawlers for requests to private ranges, localhost or 169.254.169.254 that follow a crawl of an external page. Internal services may log requests from the application host with unfamiliar paths. Review the documents your loaders produced for text that looks like internal pages or metadata responses.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
LangChain before 0.0.317 allows SSRF via document_loaders/recursive_url_loader.py because crawling can proceed from an external server to an internal server.
Questions
- Which loader is affected?
The advisory names document_loaders/recursive_url_loader.py. The linked pull request changes the sitemap loader as well, so check both if you crawl.
- Does it need user interaction?
The CVSS vector sets user interaction to required, for example a user or workflow supplying the attacker's URL. No privileges are required.
- Which version fixes CVE-2023-46229?
langchain 0.0.317 is the patched version in the advisory data. Upgrade with pip and re-check your crawler code.
- Is it exploited in the wild?
The sources do not say so. The entry has no CISA catalog data, though its EPSS score is high at about 0.48.
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 entriesCVE-2026-55443
LangChain: Path traversal and sandbox escape in LangChain file-search middleware and loaders
medium5.1Jun 16, 2026CVE-2026-45134
LangSmith SDK: Public prompt pull deserializes untrusted manifests without trust boundary warning
high7.1May 13, 2026CVE-2026-44843
LangChain vulnerable to unsafe deserialization of attacker-controlled objects through overly broad `load()` allowlists
high8.2May 8, 2026CVE-2026-40087
LangChain has incomplete f-string validation in prompt templates
medium5.3Apr 8, 2026CVE-2026-34070
LangChain Core has Path Traversal vulnerabilites in legacy `load_prompt` functions
high7.5Mar 27, 2026CVE-2026-27795
LangChain Community: redirect chaining can lead to SSRF bypass via RecursiveUrlLoader
medium4.1Feb 25, 2026
