PyPI: langchain-core
CVE-2024-0243
Safety vulnerability ID: SFTY-20240226-13160
Safety legacy ID: pyup.io-71611
Affected versions of the `langchain` package are vulnerable to Server-Side Request Forgery (SSRF) due to inadequate handling of external URLs in `recursive_url_loader.py`. The vulnerability exists because the preventive measure of setting the `prevent_outside` parameter to True is bypassed, allowing the crawler to interact with unauthorized servers. An attacker controlling an external server can exploit this by embedding links that appear to be internal, such as `https://example.completely.different/my_file.html`, leading the crawler to fetch and process potentially malicious files.
Overview
Affected versions of the `langchain` package are vulnerable to Server-Side Request Forgery (SSRF) due to inadequate handling of external URLs in `recursive_url_loader.py`. The vulnerability exists because the preventive measure of setting the `prevent_outside` parameter to True is bypassed, allowing the crawler to interact with unauthorized servers. An attacker controlling an external server can exploit this by embedding links that appear to be internal, such as `https://example.completely.different/my_file.html`, leading the crawler to fetch and process potentially malicious files.
Advisory
Affected versions of the `langchain` package are vulnerable to Server-Side Request Forgery (SSRF) due to inadequate handling of external URLs in `recursive_url_loader.py`. The vulnerability exists because the preventive measure of setting the `prevent_outside` parameter to True is bypassed, allowing the crawler to interact with unauthorized servers. An attacker controlling an external server can exploit this by embedding links that appear to be internal, such as `https://example.completely.different/my_file.html`, leading the crawler to fetch and process potentially malicious files.
How to Fix
Mitigation and Workarounds
---
Vulnerable Functions
Functions linked to known vulnerabilities.
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