| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| langflow | pip | < 1.7.1 | 1.7.1 |
The vulnerability lies within the APIRequestComponent in Langflow, which is designed to make HTTP requests as part of a workflow. The core of the issue is in the make_api_request function, which, prior to the patch, would accept any user-provided URL without proper validation. This allowed an attacker to craft a request to internal network resources, such as private IP addresses (e.g., 127.0.0.1, 10.0.0.0/8) or cloud metadata services (169.254.169.254), leading to a Server-Side Request Forgery (SSRF) vulnerability. The exploit is triggered when a user with an API key executes a flow containing this malicious component via the /api/v1/run/{flow_id_or_name} or /api/v1/run/advanced/{flow_id_or_name} endpoints. The patch addresses this by introducing a new utility, ssrf_protection.py, which contains the validate_url_for_ssrf function. This function is now called within make_api_request to check the URL against a blocklist of private and reserved IP ranges before the request is made. The patch also prudently changes the default behavior of follow_redirects to False, mitigating a common SSRF bypass technique.
lfx.components.data.api_request.APIRequestComponent.make_api_requestsrc/lfx/src/lfx/components/data/api_request.py
langflow.api.v1.endpoints.simplified_run_flowsrc/backend/base/langflow/api/v1/endpoints.py
langflow.api.v1.endpoints.experimental_run_flowsrc/backend/base/langflow/api/v1/endpoints.py