Miggo Logo

CVE-2024-5751: litellm vulnerable to remote code execution based on using eval unsafely

9.8

CVSS Score
3.0

Basic Information

EPSS Score
0.74271%
Published
6/27/2024
Updated
6/28/2024
KEV Status
No
Technology
TechnologyPython

Technical Details

CVSS Vector
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
litellmpip< 1.40.161.40.16

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stemmed from the removed eval() call in get_secret() shown in the diff. This function processed attacker-controlled encrypted_secret values from the /config/update endpoint via add_deployment. The eval() on encrypted_secret.encode() enabled RCE by allowing execution of arbitrary Python code in the payload. The patch replaced this dangerous eval() with a safety check, confirming this was the vulnerable code path.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

**rri*I/lit*llm v*rsion v*.**.* *ont*ins * vuln*r**ility w**r* *n *tt**k*r **n ***i*v* r*mot* *o** *x**ution. T** vuln*r**ility *xists in t** `***_**ploym*nt` *un*tion, w*i** ***o**s *n* ***rypts *nvironm*nt v*ri**l*s *rom **s*** *n* *ssi*ns t**m to

Reasoning

T** vuln*r**ility st*mm** *rom t** r*mov** *v*l() **ll in **t_s**r*t() s*own in t** *i**. T*is *un*tion pro**ss** *tt**k*r-*ontroll** *n*rypt**_s**r*t v*lu*s *rom t** /*on*i*/up**t* *n*point vi* ***_**ploym*nt. T** *v*l() on *n*rypt**_s**r*t.*n*o**()