NewApp Monitoring is liveSign up free
AgentbeamBeta
AI agent vulnerability · LiteLLM

CVE-2024-6587: LiteLLM Server-Side Request Forgery (SSRF) vulnerability

highCVSS 4.0 8.7 · 3.0 7.5GHSA-g26j-5385-hhw3

The LiteLLM proxy before 1.44.8 lets a caller of POST /chat/completions set api_base in the request body. The proxy then sends the upstream request, with the configured OpenAI API key, to the caller's server. The caller captures the key. Upgrade litellm to 1.44.8.

Published Sep 13, 2024 · Analysis Nov 1, 2026

What an attacker can do

The proxy forwards chat requests to model providers and attaches its own provider API key. In affected versions, the request body can carry api_base, and the proxy honors it. An attacker sets api_base to a domain they run, and the proxy's outbound request, with the provider credentials in its headers, lands on their server. The reporter's example is the OpenAI key (CWE-918, SSRF).

The CVSS vector requires no privileges and no user interaction. In practice the caller needs to reach the proxy's chat endpoint. If the proxy sits behind virtual keys, any holder of a key, including a low-trust team member or an agent, can try it. Those keys are meant to hide the real provider key from the caller, so this defeats the proxy's main purpose.

The stolen key can run up cost on your account and lets the attacker use the models directly. The same mechanism can also direct the proxy to internal hosts, which is the SSRF side. EPSS puts exploitation likelihood in the 98th percentile.

Who is affected

The pip package litellm, all versions below 1.44.8, when you run the LiteLLM proxy server. The report named 1.38.10. Library-only use that never exposes a request body to third parties is not the described path. Check the version:

pip show litellm

litellm

Ecosystem
PyPI
Affected
< 1.44.8
Fixed in
1.44.8
Check
pip show litellm

How to fix it

Upgrade to litellm 1.44.8 or later.

pip install --upgrade "litellm>=1.44.8"

The fix, commit ba1912afd1b19e38d3704bb156adf887f91ae1e0, adds is_request_body_safe() in litellm/proxy/auth/auth_checks.py, called from common_checks. Requests that include api_base or base_url in the body now fail with "BadRequest: {param} is not allowed in request body". Rotate any provider key that passed through an unpatched, reachable proxy.

How to tell if you were hit

Look in proxy request logs for bodies to /chat/completions that include api_base or base_url, mainly with external domains. Check your provider's usage dashboard for calls from unknown IP addresses or unexpected spend. After upgrading, the error text "is not allowed in request body" marks blocked attempts and shows who sent them.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

A Server-Side Request Forgery (SSRF) vulnerability exists in berriai/litellm version 1.38.10. This vulnerability allows users to specify the api_base parameter when making requests to POST /chat/completions, causing the application to send the request to the domain specified by api_base. This request includes the OpenAI API key. A malicious user can set the api_base to their own domain and intercept the OpenAI API key, leading to unauthorized access and potential misuse of the API key.

Questions

Which LiteLLM version fixes CVE-2024-6587?

1.44.8. The vulnerability report was against 1.38.10, and all versions below 1.44.8 are listed.

Do I need to rotate my API keys?

If an affected proxy was reachable by anyone you do not fully trust, yes. The advisory says the request, including the key, goes to the attacker's domain.

Is it in the CISA KEV catalog?

No. EPSS is high, but no source reports attacks in the wild.

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 LiteLLM vulnerabilities

All LiteLLM entries