PYSEC-2026-1541
Vulnerability from pysec - Published: 2026-07-07 14:34 - Updated: 2026-07-07 17:24BerriAI/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.
| Name | purl | litellm | pkg:pypi/litellm |
|---|
{
"affected": [
{
"package": {
"ecosystem": "PyPI",
"name": "litellm",
"purl": "pkg:pypi/litellm"
},
"ranges": [
{
"events": [
{
"introduced": "1.40.3.dev2"
},
{
"last_affected": "1.40.12"
}
],
"type": "ECOSYSTEM"
}
],
"versions": [
"1.40.10",
"1.40.11",
"1.40.12",
"1.40.3",
"1.40.4",
"1.40.5",
"1.40.6",
"1.40.7",
"1.40.8",
"1.40.9"
]
}
],
"aliases": [
"CVE-2024-6825",
"GHSA-53gh-p8jc-7rg8"
],
"details": "BerriAI/litellm version 1.40.12 contains a vulnerability that allows remote code execution. The issue exists in the handling of the \u0027post_call_rules\u0027 configuration, where a callback function can be added. The provided value is split at the final \u0027.\u0027 mark, with the last part considered the function name and the remaining part appended with the \u0027.py\u0027 extension and imported. This allows an attacker to set a system method, such as \u0027os.system\u0027, as a callback, enabling the execution of arbitrary commands when a chat response is processed.",
"id": "PYSEC-2026-1541",
"modified": "2026-07-07T17:24:31.002123Z",
"published": "2026-07-07T14:34:54.867610Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-6825"
},
{
"type": "WEB",
"url": "https://github.com/berriai/litellm/commit/441c7275ed2715f47650a7c2e525055c804073a9"
},
{
"type": "PACKAGE",
"url": "https://github.com/BerriAI/litellm"
},
{
"type": "WEB",
"url": "https://github.com/BerriAI/litellm/blob/056913fd7049923a106130b02d7c29e7f312beec/litellm/utils.py#L2818"
},
{
"type": "WEB",
"url": "https://huntr.com/bounties/1d98bebb-6cf4-46c9-87c3-d3b1972973b5"
},
{
"type": "PACKAGE",
"url": "https://pypi.org/project/litellm"
},
{
"type": "ADVISORY",
"url": "https://github.com/advisories/GHSA-53gh-p8jc-7rg8"
}
],
"severity": [
{
"score": "CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "LiteLLM Vulnerable to Remote Code Execution (RCE)"
}
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
The approach is described in our paper Mapping CVEs to MITRE ATT&CK Techniques: A Curated Gold-Set Classifier and the Limits of LLM-Assisted Label Expansion.
Browse all ATT&CK techniques and the vulnerabilities related to each.
Related by attack behaviour
Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.