langchain Server-Side Request Forgery vulnerabilityGHSA-h9j7-5xvc-qhg5
LOWFix: langchain-ai/langchain#15559GHSA-h9j7-5xvc-qhg5 is a low-severity (CVSS 3.7) Server-Side Request Forgery (SSRF) vulnerability in langchain. A fix is available for langchain — see the affected versions and patch details below.
Exploitation Status
Proof-of-concept exploit code exists
- CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
Exploitation and automatability from CISA’s SSVC triage for GHSA-h9j7-5xvc-qhg5.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
langchainReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.
Description
With the following crawler configuration:
from bs4 import BeautifulSoup as Soup
url = "https://example.com"
loader = RecursiveUrlLoader(
url=url, max_depth=2, extractor=lambda x: Soup(x, "html.parser").text
)
docs = loader.load()
An attacker in control of the contents of https://example.com could place a malicious HTML file in there with links like "https://example.completely.different/my_file.html" and the crawler would proceed to download that file as well even though prevent_outside=True.
Resolved in https://github.com/langchain-ai/langchain/pull/15559
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐍PyPI | langchain | all versions | 0.1.0pip install --upgrade 'langchain==0.1.0' |
Affected Products
langchainlangchainDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for langchain, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update langchain to 0.1.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-h9j7-5xvc-qhg5 is resolved across your whole dependency graph.
Workarounds
Restrict outbound requests from the affected component to an allowlist of hosts, block access to link-local and internal address ranges at the network layer, and require authentication on internal services so a forged request cannot reach them unauthenticated.
Frequently Asked Questions
Is GHSA-h9j7-5xvc-qhg5 in your dependencies?
Find it across PyPI, including transitive dependencies.