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

CVE-2024-4888: Arbitrary file deletion in litellm

highCVSS 4.0 7.0 · 3.0 6.5GHSA-3xr8-qfvj-9p9j

The LiteLLM proxy deletes server files named by the caller on its `/audio/transcriptions` endpoint. Code that calls `os.remove(file.filename)` trusts the uploaded filename, so a crafted request can remove files such as SSH keys, SQLite databases or config files. LiteLLM older than 1.35.36 is affected. Upgrade to 1.35.36.

Published Jun 6, 2024 · Updated Nov 4, 2024 · Analysis Nov 2, 2026

What an attacker can do

The /audio/transcriptions handler writes the upload to disk and removes it afterwards with os.remove(file.filename). It does not validate the filename. An attacker who sends a path as the filename makes the server delete that path instead of its own temporary copy.

The damage depends on what the proxy process can write to. The advisory names SSH keys, SQLite databases and configuration files. Deleting a config or database file can take the gateway down or reset its state. Deleting authorized_keys can lock out admins.

The CVSS 4.0 vector shows high privileges required (PR:H), with high integrity and availability impact and no confidentiality impact. In practice, anyone holding a key that can reach the endpoint is the attacker, so treat shared or leaked proxy keys as a risk. The fix PR is titled as a security fix for users removing files from the proxy via this endpoint.

Who is affected

pip package litellm older than 1.35.36, when the proxy server is running and /audio/transcriptions is reachable. Using only the Python SDK without the proxy does not expose the endpoint.

pip show litellm

litellm

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

How to fix it

Upgrade litellm to 1.35.36.

pip install --upgrade "litellm>=1.35.36"

The fix is in BerriAI/litellm pull request 3193 (merged to main on 2024-04-20). No source lists a workaround. If you cannot upgrade, limit who holds proxy keys and run the proxy as a user that cannot write outside its working directory.

How to tell if you were hit

Look in proxy access logs for POST requests to /audio/transcriptions whose multipart filename contains path separators or .., or points to an absolute path. On the host, check for missing files that the proxy user could write: SSH keys, SQLite databases, configuration files. A proxy that suddenly fails to start after such requests is a sign.

Original advisory

From the GitHub Advisory Database (CC BY 4.0).

BerriAI's litellm, in its latest version, is vulnerable to arbitrary file deletion due to improper input validation on the /audio/transcriptions endpoint. An attacker can exploit this vulnerability by sending a specially crafted request that includes a file path to the server, which then deletes the specified file without proper authorization or validation. This vulnerability is present in the code where os.remove(file.filename) is used to delete a file, allowing any user to delete critical files on the server such as SSH keys, SQLite databases, or configuration files.

Questions

Is a LiteLLM proxy with 1.35.35 affected by CVE-2024-4888?

Yes. Every version below 1.35.36 is listed as vulnerable. Version 1.35.36 is the patched release.

Does the attacker need to be logged in?

The CVSS 4.0 vector sets privileges required to high, so a valid, privileged key is expected. The advisory text also says any user could delete critical files, so do not rely on authentication alone.

Is this exploited in the wild?

No source reports exploitation, and it is not in CISA's KEV catalog. The EPSS score is 0.0062.

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