CVE-2024-6587 SSRF in berriai/litellm
Attackers can intercept OpenAI API keys by specifying a malicious api_base in chat completion requests, leading to unauthorized access.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2024-6587?
CVE-2024-6587 is a high-severity server-side request forgery vulnerability in berriai/litellm, published on 13 Sep 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
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.
Weakness: CWE-918
Which versions are affected by CVE-2024-6587?
3 open source packages ship an affected version, including litellm. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
litellm PyPI | All versions | 1.44.8 |
litellm PyPI | All versions | 1.44.8 |
litellm PyPI | All versions | 1.44.8 |
Products include Litellm Litellm.
How do I fix CVE-2024-6587?
Upgrade litellm to 1.44.8 or later.
Upgrade, and send outbound requests through an allow-list that blocks internal addresses. More about Server-side request forgery.
Is CVE-2024-6587 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-6587 exists.
Public exploit code: 1 Nuclei template.
Other vulnerabilities in berriai/litellm
Sources
Also known as GHSA-g26j-5385-hhw3, PYSEC-2026-1547.