LiteLLM code injection flaw CVE-2026-40217 under active exploitation, CISA warns

High 8.8KEVCVE-2026-40217

LiteLLM code injection flaw CVE-2026-40217 under active exploitation, CISA warns

A code injection vulnerability in BerriAI’s LiteLLM, tracked as CVE-2026-40217, lets remote attackers execute arbitrary code by abusing bytecode rewriting at the /guardrails/test_custom_code endpoint. According to NVD, LiteLLM releases through 2026-04-08 are affected. The flaw has a CVSS score of 8.8 (High), and an attacker needs only low-privileged access to exploit it.

CISA added the vulnerability to its Known Exploited Vulnerabilities (KEV) catalog on 2026-11-18, confirming it is being exploited in the wild. Organizations running LiteLLM, including those using Red Hat products that bundle it, should treat this as urgent.

What’s affected

NVD describes the affected software as LiteLLM through 2026-04-08. The CVE record identifies the affected LiteLLM code by a commit-style hash rather than a release number. The advisory data we reviewed does not confirm which LiteLLM release contains the fix. Check the vendor advisory linked below before assuming a given version is safe.

The record also lists Red Hat products that ship LiteLLM:

  • Red Hat Ansible Automation Platform 2.6: package builds from version 1780102732 are marked unaffected.
  • Red Hat OpenShift AI 3.3: package builds from version 1782310008 are marked unaffected.
  • Lightspeed Core and Red Hat OpenShift AI (RHOAI) are also listed, with no version status given.

Red Hat customers should check the Red Hat CVE page and errata below for their specific product.

How serious is it

The CNA-assigned CVSS 3.1 score is 8.8 (High), with vector CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H. In plain terms:

  • Network attack vector, low complexity: the flaw can be exploited remotely without special conditions.
  • Low privileges required: the attacker needs some level of authenticated access to LiteLLM, not administrator rights.
  • No user interaction: no victim needs to click anything.
  • High impact on confidentiality, integrity and availability: successful exploitation means arbitrary code execution on the LiteLLM host. That puts any data or credentials the service holds at risk.

The weaknesses are classified as CWE-94 (code injection) and CWE-420 (unprotected alternate channel). The guardrails custom-code test feature provides a path to run code that is not adequately protected.

Is it being exploited?

Yes. CISA added CVE-2026-40217 to the KEV catalog on 2026-11-18, confirming active exploitation. CISA lists the ransomware campaign use as “Unknown.”

US federal civilian agencies must act by 2026-12-02. CISA’s required action is to apply mitigations according to vendor instructions, following BOD 26-04 and CISA’s Forensics Triage Requirements. Agencies must follow the BOD 26-04 guidance for cloud services, or stop using the product if mitigations are unavailable. CISA also says stakeholders are responsible for evaluating each asset’s internet exposure.

What to do

  • Update LiteLLM to a fixed release as identified in BerriAI’s security advisory. The records we reviewed do not state the fixed version number.
  • Red Hat users: apply the relevant errata (RHSA-2026:24866, RHSA-2026:30056) and check Red Hat’s CVE page for your product.
  • Restrict exposure: do not expose LiteLLM administrative interfaces to the internet. Limit network access to the /guardrails/test_custom_code endpoint until you have patched.
  • Review accounts and keys: exploitation requires only low privileges, so audit who holds LiteLLM credentials and remove unnecessary access.
  • Look for compromise: because the flaw is actively exploited, review logs for requests to the affected endpoint and investigate any unexpected activity on LiteLLM hosts. If you find signs of compromise, consider rotating credentials stored in or accessible to the service.

References