Join our Newsletter — 33% off our NHI Course

CVE-2026-42271 (BerriAI LiteLLM Command Injection)

CVE-2026-42271 is a command injection vulnerability in BerriAI LiteLLM. CISA added it to the Known Exploited Vulnerabilities catalogue on 8 June 2026, which means attackers have used it in real attacks. BerriAI LiteLLM contains a command injection vulnerability that could allow any authenticated user, including holders of low-privilege internal-user keys, to run arbitrary commands on the host.

What makes a command injection flaw dangerous in LiteLLM?

Command injection is dangerous because user-controlled input can reach the operating system shell or a command runner, letting an attacker execute arbitrary host commands rather than just altering application behaviour. In a gateway or orchestration product, that can turn a single vulnerable request path into host-level compromise.

That matters especially when the vulnerable component sits between users, model providers and secrets. A flaw in the control plane can expose infrastructure, not just the application layer, so the blast radius often includes local files, environment variables, runtime processes and adjacent internal systems.

For the general attack pattern, see the OWASP Top 10 and the more detailed Web Application Attacks Guide.

Why authenticated access still leaves organisations exposed

Authenticated-only vulnerabilities are often underestimated because they sound like they require legitimate access. In practice, low-privilege internal users are still attackers if they can submit crafted input, so an “internal only” trust boundary does not prevent exploitation once credentials are obtained, misused or over-shared.

This is especially relevant where internal API keys, service credentials or delegated user roles are broadly distributed. If a vulnerable feature accepts commands from authenticated callers, an attacker may only need one compromised or excessive-privilege account to move from login access to code execution on the host.

For version status and record tracking, consult the CVE Program and the NIST National Vulnerability Database.

How organisations check exposure and scope remediation

Exposure review starts with asset inventory, deployment mapping and version confirmation across every environment where LiteLLM is reachable. Teams should identify whether the product is internet-facing, internally exposed, embedded in a platform service, or reachable only through a trusted network path, because each deployment shape changes the practical attack surface.

Authoritative vendor advisory data should drive the patch decision, while KEV status should drive urgency. Where the vulnerable instance cannot be updated immediately, compensating controls should focus on restricting who can reach the feature, reducing command execution opportunities, and removing unnecessary administrative or internal-user access paths.

The same discipline used for any actively exploited vulnerability applies here, including prioritisation based on real-world exploitation rather than theoretical severity. NHIMG’s Vulnerability Management Guide is a useful reference for asset scope, KEV-based prioritisation and verification.

What to verify after remediation or suspected exploitation

Once the vulnerability is patched or contained, the response should not stop at version confirmation. Command injection can leave behind persistence, altered configuration, dropped tools, tampered logs or stolen secrets, so post-patch review should look for signs of host-level manipulation as well as any business data exposure.

Because the vulnerable path can be reachable by authenticated users, identity and secret review matters too. If exploitation is suspected, rotate any credentials, session material or service secrets that could have been exposed to the compromised host, then validate that no unauthorized processes, scheduled tasks or outbound connections remain.

For a practical lens on compromise patterns involving keys, tokens and service accounts, see The State of NHI & AI Agent Breach Report 2026.

Risk and Threat Considerations

Because the flaw allows arbitrary host commands, the main risk is full compromise of the system running LiteLLM, followed by lateral movement into connected services, secrets stores or cloud resources. The fact that exploitation can come from authenticated users makes insider misuse, stolen internal credentials and over-permissioned accounts especially important threat paths.

Failure mechanism: Attacker-controlled input reaches a shell-like execution path, allowing command chaining, file access, environment inspection and follow-on execution on the host.

Impact: The attacker can steal secrets, alter configuration, install persistence, pivot to adjacent systems, or use the compromised server as a launch point for broader compromise.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP ASVS, NIST SP 800-53 Rev 5 and CIS Controls v8 set the governance and control requirements practitioners need to meet.

Framework Control / Reference Relevance
OWASP ASVS V5 — File Handling Command injection often starts with unsafe handling of user-supplied data and files.
Recommendation — Review input-handling paths and remove any shell execution from user-controlled data flows.
NIST SP 800-53 Rev 5 SI-10 — Information Input Validation The flaw is driven by insufficient validation of attacker-controlled input.
IA-2 — Identification and Authentication (Organizational Users) The vulnerability is reachable by authenticated users, so account assurance matters.
AC-6 — Least Privilege Low-privilege internal users should not be able to trigger host command execution.
Recommendation — Validate all external input before it can influence command execution or privileged processing. Strengthen user authentication and restrict authenticated access to only the commands each role needs. Reduce user and service permissions so no routine account can reach host-level command paths.
CIS Controls v8 CIS-6 — Access Control Management The issue depends on who can reach the vulnerable command path and with what privilege.
Recommendation — Limit access to the vulnerable function and remove unnecessary internal-user permissions.

Practitioner Guidance

Why practitioners should care: Treat this as a host-compromise issue, not a narrow application bug. If LiteLLM sits near credentials, model gateways or internal tooling, command injection can quickly become a secrets-exposure and infrastructure-control event rather than a single vulnerable endpoint.

What to watch for: Look for unusual command-line activity, unexpected child processes, new outbound connections, modified startup artifacts and any internal-user activity that does not fit normal admin workflows. If exploitation is suspected, assume the host and any reachable secrets have to be reviewed together.

Practitioner takeaway: Do not wait for visible service failure, because command injection often succeeds quietly before defenders notice the downstream impact.