CVE-2024-6587: SSRF in LiteLLM api_base handling
- Vendors
- LitellmBerriAI
CVE-2024-6587 is a server-side request forgery vulnerability in berriai/litellm affecting version 1.38.10 and originally associated with the POST /chat/completions endpoint. The flaw arises because the application accepts a user-controlled api_base parameter and uses it as the destination for outbound requests. When processing a crafted request, LiteLLM can be induced to send traffic to an attacker-specified host instead of the intended upstream provider. In the vulnerable flow, the outbound request includes the configured OpenAI API key, allowing an attacker to capture that credential. Subsequent reporting indicates the initial fix in LiteLLM 1.44.8 blocked api_base only when present as a top-level request-body field, while nested api_base values inside litellm_params on other endpoints such as /health/test_connection and /model/new were not covered by that guard.
Impact, mitigation & remediation
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
Impact
What an attacker gets, and what they’ve been doing with it.
Successful exploitation can disclose sensitive credentials by causing LiteLLM to transmit an upstream API key to an attacker-controlled endpoint. Exposure of the OpenAI API key enables unauthorized use of the victim’s API account and potential misuse of associated services. More broadly, SSRF behavior can allow attackers to redirect server-originated requests to unintended internal or external destinations, which may support metadata access, secret exfiltration, or further pivoting depending on deployment and endpoint behavior.
Mitigation
If you can’t patch tonight, do this now.
Restrict exposure of LiteLLM control-plane and administrative endpoints to internal networks behind strong authentication. Apply egress filtering so the service cannot initiate outbound connections to unapproved destinations, including link-local metadata services, loopback, RFC1918 ranges, and arbitrary external hosts. Enforce a strong non-default LiteLLM master key, monitor for anomalous outbound requests from the proxy, and treat previously exposed upstream credentials as potentially compromised until rotated.
Remediation
Patch, then assume compromise.
Upgrade LiteLLM to a version that fully hardens request handling against attacker-controlled api_base values and disallows unsafe parameter resolution, with reporting indicating 1.83.x as the hardened branch and 1.83.14 confirmed to block the demonstrated environment-variable secret exfiltration path. Ensure all endpoints that accept nested provider parameters enforce the same validation as top-level request bodies. Review and rotate any upstream API keys that may have been exposed, especially if vulnerable versions were internet-accessible or if default or weak administrative protection was used.
Exploits
No public exploits tracked yet. Mallory keeps watching.
Affected products & vendors
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
References
Frequently asked questions
- Is CVE-2024-6587 exploited in the wild?
- Yes. As of Sep 25, 2026, Mallory has reports of exploitation in the wild.
- Is there a public exploit for CVE-2024-6587?
- Yes. As of Sep 25, 2026, Mallory has reports of a public exploit for CVE-2024-6587.
- Is there a patch for CVE-2024-6587?
- Upgrade LiteLLM to a version that fully hardens request handling against attacker-controlled api_base values and disallows unsafe parameter resolution, with reporting indicating 1.83.x as the hardened branch and 1.83.14 confirmed to block the demonstrated environment-variable secret exfiltration path. Ensure all endpoints that accept nested provider parameters enforce the same validation as top-level request bodies.
- What products are affected by CVE-2024-6587?
- Litellm and BerriAI Litellm.
- How severe is CVE-2024-6587?
- CVE-2024-6587 has a CVSS v3.1 score of 7.5 (High) and an EPSS score of 34.4% (98th percentile) as of Sep 25, 2026.
Recent activity
3 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.