ZeroHour
The Hacker Newspublished ()ingested [email protected] (The Hacker News)
Part of a story covered by 4 sources: “LiteLLM Gateway Flaws Chain From MCP Auth Bypass (CVE-2026-59822, CISA KEV) to Root RCE and Cloud Credential Theft” — merged summary and timeline →

Nearly 1 in 10 Exposed LiteLLM Gateways Accepted the Example "sk-1234" Admin Key

AI summary · glm-5.3-flash

Wiz found 294 of 3,074 internet-facing LiteLLM gateways accepted the documented default admin key sk-1234, exposing provider API keys and cloud IAM credentials.

Wiz Research's February Shodan scan found 3,074 LiteLLM gateways, 294 of which accepted the setup guide's sk-1234 admin key; 191 had no master key set and would accept any credential. The master key doubles as the authentication switch, and before 1.82.0-stable a gateway started without one granted every request full admin rights, exposing stored provider API keys, prompts, and MCP-connected tools. A documented pass-through endpoint lacks checks against private and cloud metadata addresses, letting an admin-key holder retrieve cloud IAM credentials, though no real-world abuse is reported. Related LiteLLM flaws include CVE-2026-59821 (disputed guardrail code execution), CVE-2026-59822 (CVSS 8.8, added to CISA KEV on September 2 and observed against Wiz honeypots), and CVE-2026-42271, used to install a cryptominer.

  • 294 of 3,074 Shodan-visible LiteLLM gateways accepted the documented sk-1234 admin key; 191 set no master key.
  • Pass-through endpoints lack SSRF checks, letting admin requests reach cloud metadata and return IAM credentials.
  • CVE-2026-59821 severity disputed: Wiz demonstrates root-level code execution; LiteLLM advisory rates CVSS 2.1 Low.
  • CVE-2026-59822 (CVSS 8.8) added to CISA KEV September 2; exploited against Wiz honeypots since July 7.
  • CVE-2026-42271 used in the wild to install a cryptominer; chainable with Starlette flaw CVE-2026-48710.

Vulnerabilities mentionedAll →

CVEVulnerabilityCVSSEPSSFlagsAffectedExposurePublished
CVE-2026-40217
LiteLLM through 2026-04-08 allows remote attackers to execute arbitrary code via bytecode rewriting at the /guardrails/test_custom_code URI.

LiteLLM through 2026-04-08 allows remote attackers to execute arbitrary code via bytecode rewriting at the /guardrails/test_custom_code URI.

NVD description · AI analysis pending
8.815% PoC
  • litellm litellm
CVE-2026-42271
Command Injection in BerriAI LiteLLM AI Gateway Exploited in the Wild

CVE-2026-42271 is a command injection (CWE-77/CWE-78) in BerriAI LiteLLM's proxy server, a widely used AI gateway for calling LLM APIs. Two MCP preview endpoints (POST /mcp-rest/test/connection and POST /mcp-rest/test/tools/list) accept a full stdio server configuration, including command, args, and env fields, and spawn the supplied command as a subprocess on the proxy host; the endpoints are gated only by any valid proxy API key with no role check, so even low-privilege internal-user keys can trigger it. An attacker with any authenticated key gains arbitrary command execution with the privileges of the proxy process, and reporting indicates attackers are chaining the flaw into broader takeover of AI gateway servers, including reverse shells and crypto miners, in some cases via weak or default keys such as the example 'sk-1234' admin key. Any organization running LiteLLM versions 1.74.2 through before 1.83.7, including LiteLLM distributed with Red Hat OpenShift AI, is affected. The flaw was added to CISA's Known Exploited Vulnerabilities catalog on 2026-06-08 and is under active attack, with a very high EPSS of 83.6% for exploitation within 30 days.

Do: Upgrade LiteLLM to version 1.83.7 or later immediately (federal agencies must act per CISA KEV/BOD 22-01), and apply Red Hat's advisory updates if running OpenShift AI. Until patched, restrict or rotate proxy API keys — especially low-privilege internal-user and any default/example keys such as 'sk-1234' — and limit network access to the /mcp-rest/test/* endpoints. Review proxy hosts for indicators of compromise such as unexpected spawned subprocesses, reverse shells, or crypto miners, and rotate credentials that may have been captured via compromised environments.

8.784% KEV
  • BerriAI LiteLLM (proxy server / AI Gateway) 1.74.2 up to but not including 1.83.7 (fixed in 1.83.7)
  • Red Hat OpenShift AI
moderatelikely on the order of thousands of internet-exposed LiteLLM gateway deployments (est. 1k-10k exposed instances), plus private/internal installs of unknown…
CVE-2026-48710
HTTP Request Smuggling in Kludex Starlette (CVE-2026-48710)

Kludex Starlette prior to version 1.0.1 did not validate the HTTP Host request header before using it to reconstruct request.url, an inconsistency classified as HTTP request/response smuggling (CWE-444). Because routing operates on the raw ASGI scope path while request.url is rebuilt from the unvalidated Host header, an attacker can send a malformed Host header so that request.url.path differs from the path the router actually processed. Any middleware or endpoint that enforces security restrictions based on request.url rather than the raw scope path can then be tricked into approving requests that should have been blocked, bypassing those controls. All Starlette deployments below 1.0.1 are affected, both direct users and downstream products that bundle the library, including Red Hat offerings such as Ansible Automation Platform, OpenShift AI, OpenShift Lightspeed, Satellite, AI Inference Server, Migration Toolkit for Applications, and Enterprise Linux AI. CISA added the flaw to the Known Exploited Vulnerabilities catalog on 2026-09-02, confirming active exploitation; related reporting describes attackers deploying reverse shells and crypto miners, and EPSS ranks it in the 98th percentile with a 36.3% probability of exploitation within 30 days.

Do: Upgrade Starlette to 1.0.1 or later, which validates the Host header against RFC 9112/RFC 3986 grammar and falls back to scope['server'] for malformed values, and apply the corresponding Red Hat updates for each bundled product listed above. Until patched, review middleware and endpoints that enforce security decisions from request.url and validate or pin the Host header at your reverse proxy or load balancer. As a KEV entry, federal agencies must patch per BOD 26-04 timelines based on each asset's internet exposure, and operators of internet-facing AI infrastructure should verify their Starlette/FastAPI dependency versions.

6.536% KEV PoC ×3
  • Kludex (Encode) Starlette All versions prior to 1.0.1
  • Red Hat AI Inference Server
  • Red Hat Ansible Automation Platform
  • +5 more
mass>1M library deployments (Starlette is the core ASGI dependency beneath FastAPI and much of the Python AI-serving stack, with hundreds of millions of monthly…
CVE-2026-59821
LiteLLM is a proxy server (AI Gateway) to call LLM APIs in OpenAI (or native) format.

LiteLLM is a proxy server (AI Gateway) to call LLM APIs in OpenAI (or native) format. Prior to 1.82.0-stable, LiteLLM's Custom Code Guardrails production create and update paths did not apply the same sandboxing and validation used by the test endpoint, allowing a privileged user with access to create or update guardrails to submit custom Python code that executed in the LiteLLM proxy environment and could expose secrets available to the process. This issue is fixed in version 1.82.0-stable.

NVD description · AI analysis pending
2.1<1%
  • litellm litellm
CVE-2026-59822
Unauthenticated MCP Endpoint Authentication Bypass in BerriAI LiteLLM

BerriAI LiteLLM, a widely used self-hosted AI gateway and proxy server for calling LLM APIs, fails to properly authenticate requests to its MCP Streamable HTTP endpoint in versions prior to 1.84.0. An unauthenticated attacker can send a fabricated Authorization header that triggers an OAuth2 passthrough fallback, which replaces failed LiteLLM key validation with an empty UserAPIKeyAuth() object and lets the request reach MCP tooling without any valid LiteLLM key. Successful exploitation grants unauthenticated access to the gateway's MCP tooling with high confidentiality impact per the CVSS 4.0 score of 8.8, and public reporting describes attackers chaining LiteLLM weaknesses from authentication bypass to root code execution and cloud credential theft. Any organization running LiteLLM before 1.84.0 is affected, particularly gateways exposed to the internet. The flaw is confirmed exploited in the wild: CISA added it to the Known Exploited Vulnerabilities catalog on 2026-09-02, while EPSS currently estimates a 0.9% probability of exploitation in the next 30 days.

Do: Upgrade LiteLLM to version 1.84.0 or later immediately, in line with the CISA KEV required action and BOD 26-04 guidance for internet-exposed assets. Audit whether the MCP endpoint is reachable from the internet and check for signs of exploitation, including unexpected MCP tool calls, use of fabricated Authorization headers, and use of default or example admin keys such as 'sk-1234'. Until patched, restrict access to the MCP endpoint and review cloud credentials accessible from the gateway host for signs of theft or root-level activity.

8.8<1% KEV
  • BerriAI LiteLLM all versions prior to 1.84.0 (fixed in 1.84.0)
moderateon the order of thousands of internet-exposed LiteLLM gateway instances (estimate; no authoritative total)
Full article1,476 words · extracted from thehackernews.com · click to collapse

Nearly one in ten of the internet-facing LiteLLM servers that Wiz Research scanned in February accepted sk-1234, the example admin key in LiteLLM's own setup guide.

LiteLLM is an open-source AI gateway, the software a company puts between its applications and the model providers it pays for. That key is the gateway's administrator credential.

Anyone who holds it can read every model provider's API key stored on the server. In Wiz's tests, it also reached the cloud IAM credentials of the machine the gateway runs on.

Changing the key needs no upgrade, and it closes every path in Wiz's report that depends on holding it.

Where the Number Comes From

Wiz ran one scan. It found 3,074 LiteLLM gateways on Shodan in February, and 294 of them accepted the key.

In 191 of those 294, no key was set at all, so they would have accepted anything. The rest had the setup guide's value left in place.

A second scan in August found more than 85,000 instances, but Wiz says most of them appear to be honeypots or test systems, so the two counts cannot be compared. There is no current figure.

As of September 9, LiteLLM's setup guide still uses sk-1234, above a comment telling operators to replace it with a long random value before any real use.

Why One Key Matters This Much

The master key does two jobs at once, and that is what makes a default value serious. It is the admin credential and the switch that enables authentication.

Before version 1.82.0-stable, a gateway that started without a master key granted every incoming request full admin rights.

An admin on one of these servers has a lot in reach. The gateway can hold an API key for every provider it routes to, see every prompt and reply passing through, and connect to internal tools via the Model Context Protocol (MCP).

It also usually runs with the cloud permissions of the workload it is deployed in. Stolen provider keys alone let an attacker run model workloads on the victim's bill, an abuse known as LLMjacking.

How the Key Reaches the Cloud Account

LiteLLM lets an administrator create a pass-through endpoint, a route that forwards requests to any URL the admin chooses.

The target URL is not checked against private address ranges, localhost, or cloud metadata addresses. An admin can therefore point a route at the instance metadata service and read back the IAM credentials it returns.

Switching to IMDSv2 does not stop this. LiteLLM documents that any header sent with an x-pass- prefix is passed to the target with the prefix removed, and Wiz used that to send the headers IMDSv2 requires.

No source reports anyone doing this against a real deployment. It is a demonstration, and it needs admin access first.

Wiz says the feature is arguably working as intended, because LiteLLM's threat model treats administrators as trusted. It has no CVE and no fix.

The project says much the same about the way in. Its published security policy lists attacks that need a setup mistake, such as not setting a master key, as "explicitly not in scope" and not treated as vulnerabilities.

The Guardrail Flaw, and a Disputed Severity

The one code execution flaw in Wiz's report is CVE-2026-59821, and the researchers and the maintainers describe it very differently.

Wiz calls it post-authentication code execution at root level, and shows a test returning uid=0(root) inside the gateway container. LiteLLM's advisory for the same CVE rates it as Low (2.1 on the CVSS scale), describing it as a flaw that requires a high-privilege account.

Both describe the same behavior. Before 1.82.0-stable, the endpoints that create and update custom code guardrails skipped the sandbox and pattern checks the test endpoint applied, so anyone who could reach them could submit Python that ran inside the container.

The advisory adds that a deployment with no master key treated callers as proxy administrators, which is what put those endpoints within reach.

Wiz's report states that after 1.82.0, an attacker with the default key could only run code within a sandbox. LiteLLM's own record does not support that for every release.

A separate advisory published in May, CVE-2026-40217, says that the sandbox could be escaped using bytecode techniques by running code in the proxy process, which the advisory notes runs as root in the default Docker image.

It covers versions from 1.81.8 up to, but not including, 1.83.10, and reaching the endpoint needs a proxy-admin credential. The master key is that credential.

Both flaws Wiz reported were fixed months before its September 9 report, in February and April, and their CVEs were published in July.

Separately: the LiteLLM Flaws Already Being Exploited

These are older issues, and none of them is the route to cloud credentials described above. They are listed here because they affect the same product and are easy to confuse with it.

CISA added one LiteLLM flaw to its Known Exploited Vulnerabilities catalog on September 2. CVE-2026-59822 (CVSS score: 8.8), also found by Wiz, lets an unauthenticated attacker open a valid MCP session using any Bearer token, including one a single character long. Federal civilian agencies have until September 16 to address it.

Wiz saw it used against its own honeypots starting July 7, in requests that carry single-character tokens to probe model listing endpoints. Wiz described no other use of it.

That flaw does not reach the code execution or credential paths above. Wiz states that it "only allows MCP server access". What it can reach depends on which tool servers an organization has connected to.

The LiteLLM flaw attackers have used to run code is a different one. CVE-2026-42271 (CVSS score: 8.7) let any authenticated user run commands on the host through two MCP test endpoints, and Horizon3.ai reported in June that it could be chained with a Starlette host-header flaw, CVE-2026-48710, to do the same with no credentials at all.

Wiz's honeypots recorded that flaw being used to install a cryptocurrency miner.

Microsoft published a case in August in which attackers ran commands inside a LiteLLM gateway process, read the container's environment for the master key, the provider keys, and the database connection string, and then used that string to access the underlying PostgreSQL database and copy records from LiteLLM's model and virtual-key tables.

Microsoft assesses with high confidence that the attackers gained access through the exposed gateway and says the entry point matches the CVE-2026-42271 and CVE-2026-48710 chain. "Treat AI gateways as Tier-0 secrets stores," the company said.

What to Do Now

Upgrading to 1.84.0 or later covers every flaw in the table. The version ranges are as stated in the advisories.

Flaw What it allows Affected versions Fixed in
CVE-2026-59822, MCP authentication bypass An authenticated MCP session from any Bearer token, reaching the MCP tools that instance has configured Before 1.84.0 1.84.0
CVE-2026-42271, MCP test endpoint command execution Any authenticated user runs commands on the host 1.74.2 up to, but not including, 1.83.7 1.83.7
CVE-2026-59821, custom code guardrail check bypass Code execution inside the gateway container Before 1.82.0-stable 1.82.0-stable
CVE-2026-40217, guardrail sandbox escape Code execution as root in the default container image 1.81.8 up to, but not including, 1.83.10 1.83.10, though the advisory text says 1.83.11
  1. Change the master key from sk-1234 to a long random value. This needs no upgrade. Check first whether a separate salt key is set, because the rotation procedure differs and using the wrong one can leave stored credentials unreadable.
  2. Upgrade to 1.84.0 or later. That release sits above the fixed version of every flaw in the table.
  3. If you cannot upgrade yet, block /mcp/ and the two MCP test endpoints, POST /mcp-rest/test/connection and POST /mcp-rest/test/tools/list, at your reverse proxy or API gateway.
  4. Also block POST /guardrails/test_custom_code, and restrict POST /guardrails and PUT /guardrails/{guardrail_id} to administrators. These are the workarounds in LiteLLM's own advisories.
  5. Review the pass-through endpoints on the gateway, restrict the container's outbound network access, and give the workload the narrowest cloud IAM role it can work with.
  6. If you think an attacker may have had access, review the guardrails list for entries you did not create and restart the process to clear code held in memory, then rotate the provider keys, the master key and the database credentials. Upgrading removes neither a guardrail an attacker registered nor an SSH key they added.

There is no patch for the pass-through route to instance metadata, because LiteLLM does not treat it as a flaw. Outbound network limits and narrow IAM roles are the only controls available.

No source sets out how to check whether MCP or pass-through routes are enabled on a gateway you have inherited. Microsoft's hunting queries find exploitation, not configuration.

Found this article interesting? Follow us on Google News, Twitter and LinkedIn to read more exclusive content we post.

Text extracted automatically; images, tables and formatting may be missing. Original: https://thehackernews.com/2026/09/nearly-1-in-10-exposed-litellm-gateways.html