MEDIUM 6.3

CVE-2026-12797: BerriAI litellm Banned Keywords Bypass Vulnerability

A flaw in BerriAI's litellm library (versions up to 1.82.5) allows authenticated users to bypass keyword-based content filtering through manipulation of the prompt parameter in the Completions Interface. An attacker with valid credentials can craft requests that circumvent banned keyword restrictions, potentially exposing the system to restricted content or policy violations. Public exploit code exists for this issue.

Source data · NVD / CISA · public domain

CVSS
3.1 · 6.3 MEDIUM · CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L
Weaknesses (CWE)
CWE-285, CWE-863
Affected products
1 configuration(s)
Published / Modified
2026-06-21 / 2026-06-24

NVD description (verbatim)

A security flaw has been discovered in BerriAI litellm up to 1.82.5. Affected is the function async_pre_call_hook of the file enterprise/enterprise_hooks/banned_keywords.py of the component Completions Interface. The manipulation of the argument prompt results in incorrect authorization. The attack may be performed from remote. The exploit has been released to the public and may be used for attacks. The vendor was contacted early about this disclosure.

5 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

The vulnerability resides in the async_pre_call_hook function within enterprise/enterprise_hooks/banned_keywords.py. This hook is responsible for enforcing keyword-based authorization policies before processing completion requests. By submitting specially crafted prompt arguments, an authenticated attacker can bypass the authorization logic that should block requests containing banned keywords. The flaw stems from improper validation or sanitization of prompt input before authorization checks are applied, allowing prompt manipulation to evade filtering mechanisms.

Business impact

Organizations relying on litellm's banned keyword enforcement for compliance, safety, or acceptable-use policy enforcement face a direct risk of policy bypass. Authenticated users could submit requests that should be blocked, potentially leading to generation of prohibited content, exposure of sensitive model capabilities to unauthorized use cases, or violation of internal governance policies. The scope is limited to authenticated users, reducing the overall blast radius but still representing a meaningful control circumvention.

Affected systems

BerriAI litellm versions up to and including 1.82.5 are affected. Any deployment using the enterprise keyword filtering feature in the Completions Interface is at risk if running a vulnerable version. Organizations should verify their current litellm version and assess whether they rely on the banned_keywords enterprise module for policy enforcement.

Exploitability

Exploitability is moderate. The attack requires valid authentication credentials (authenticated access to the LLM API), which limits opportunistic exploitation. However, once authenticated, the attack is straightforward—no complex timing, race conditions, or system-specific configuration is required. The existence of public exploit code lowers the technical barrier for any attacker with valid access. The attack vector is network-based with no user interaction required beyond submitting a malformed request.

Remediation

Upgrade BerriAI litellm to a patched version released after 1.82.5. Verify the exact version number in the vendor's security advisory. Until patching is feasible, consider implementing compensating controls: apply additional input validation and keyword filtering at the application layer above litellm, restrict API access to trusted internal services only, and monitor request logs for suspicious prompt patterns that attempt to obfuscate banned keywords.

Patch guidance

Review BerriAI's official security advisory and release notes for the recommended patched version. Apply the update to all systems running litellm, including development, staging, and production environments where the enterprise keyword filtering module is in use. Test patched deployments to confirm that banned keyword enforcement functions correctly and that legitimate traffic is not blocked. Document the patch application timeline and verify the fix by attempting to trigger the vulnerability with test prompts.

Detection guidance

Monitor litellm API logs for prompts that contain obfuscated or manipulated versions of known banned keywords. Look for patterns where authorized content filtering was bypassed or where requests containing policy-restricted terms were processed successfully. Implement application-level logging of all prompt inputs and authorization decisions. Hunt for signs of prompt injection or encoding techniques (Unicode variations, whitespace tricks, case mutations) that might indicate exploitation attempts. Compare request patterns before and after the vulnerability disclosure date to identify potential compromise.

Why prioritize this

Although the CVSS score is 6.3 (Medium), this vulnerability warrants prompt remediation because it directly undermines a critical security control—content filtering. The combination of public exploit code, ease of exploitation for authenticated users, and the fact that this breaks a trust boundary (policy enforcement mechanisms) elevates practical risk. Any organization relying on banned keywords for compliance or safety policies should prioritize patching to restore the integrity of that control layer.

Risk score, explained

The CVSS 3.1 score of 6.3 (Medium, vector CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L) reflects network-accessible attack vector, low complexity, requirement for low-privilege authentication, no user interaction, and limited impact on confidentiality, integrity, and availability. The score appropriately captures that exploitation requires credentials and does not grant full system compromise. However, the practical severity is amplified by the control-bypassing nature of the flaw and the existence of public exploits.

Frequently asked questions

Do we need admin credentials to exploit this, or any authenticated user?

The CVSS vector indicates PR:L (low privilege), meaning any authenticated user with valid API credentials can exploit this vulnerability. No administrative access is required.

If we're not using the enterprise keyword filtering module, are we still affected?

No. The vulnerability is specific to the enterprise_hooks/banned_keywords.py component. If your deployment does not enable or use the banned keywords enterprise feature, you are not affected. Review your litellm configuration to confirm.

Can this vulnerability be exploited without network access?

No. The attack vector is network-based (AV:N). The attacker must be able to reach the litellm API endpoint remotely and possess valid authentication credentials.

What should we do if we cannot patch immediately?

Implement defense-in-depth: add keyword filtering logic at your application layer above litellm, restrict API access to trusted internal clients only, enable detailed audit logging of all completions requests, and consider temporarily disabling the enterprise module if it's not essential to your operations.

This analysis is based on disclosed vulnerability information current as of the publication date. CVSS scores and vendor statements reflect data available at the time of writing and may be updated by vendors or security authorities. Actual patch version numbers, release dates, and detailed remediation steps should be verified against BerriAI's official security advisory and release notes. Organizations should conduct their own risk assessment based on their specific deployment, configuration, and data sensitivity. This document does not constitute legal or compliance advice and should be reviewed by your security and legal teams in the context of your policies and obligations. Source: NVD (public-domain), retrieved 2026-07-28. Analysis generated by SEC.co (claude-haiku-4-5).