CVE-2026-12798: litellm: SSRF in MCP OpenAPI spec loader endpoint
MEDIUMCVE-2026-12798 is a Server-Side Request Forgery vulnerability in litellm's experimental MCP server component, where the `load_openapi_spec_async` function accepts an unalidated user-controlled `spec_path` argument that the server fetches verbatim, allowing any authenticated caller to redirect the proxy to arbitrary internal or external URLs. LiteLLM is widely deployed as an LLM gateway unifying access to multiple AI backends, meaning SSRF here can expose cloud metadata services (AWS IMDSv1 at 169.254.169.254), internal APIs, and adjacent microservices not reachable from the internet—turning a CVSS 6.3 into a realistic path to cloud credential theft and lateral movement. A public proof-of-concept exploit is already live on GitHub, reducing exploitation to a script-kiddie-level operation for anyone with a valid API key. Organizations running litellm ≤1.82.2 with the MCP server enabled should upgrade immediately; as a workaround, disable the experimental MCP endpoint and enforce IMDSv2-only on cloud hosts to block metadata SSRF.
What is the risk?
Rated medium by CVSS (6.3) but practical risk is elevated by three factors: public PoC exploit on GitHub lowers the skill bar to near zero; only low privileges are required, meaning any compromised or trial API key is sufficient; and SSRF in cloud-hosted LLM proxies routinely chains into cloud IAM credential theft regardless of the 'L' impact ratings. LiteLLM's track record of 32 prior CVEs and an OpenSSF score of 6.1/10 indicates systemic security debt. The experimental flag on the affected component may limit surface area in hardened deployments, but many operators enable experimental features without fully scoping the attack surface.
How does the attack unfold?
What systems are affected?
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| LiteLLM | pip | — | No patch |
Do you use LiteLLM? You're affected.
How severe is it?
What is the attack surface?
What should I do?
5 steps-
PATCH
Upgrade litellm beyond 1.82.2 once a patched release is available; monitor github.com/BerriAI/litellm releases.
-
DISABLE
If the experimental MCP server is not required, disable it via configuration or remove the mcp_server experimental feature flag.
-
NETWORK EGRESS
Block outbound requests from the litellm process to 169.254.0.0/16, 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16; enforce IMDSv2-only on AWS instances to neutralize metadata SSRF.
-
AUTHZ
Restrict MCP OpenAPI spec loading to privileged roles only; treat spec_path ingestion as an admin operation.
-
DETECT
Alert on litellm process egress to cloud metadata ranges or RFC1918 addresses; monitor for 169.254.169.254 or internal hostname resolution in proxy logs.
How is it classified?
Which compliance frameworks are affected?
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2026-12798?
CVE-2026-12798 is a Server-Side Request Forgery vulnerability in litellm's experimental MCP server component, where the `load_openapi_spec_async` function accepts an unalidated user-controlled `spec_path` argument that the server fetches verbatim, allowing any authenticated caller to redirect the proxy to arbitrary internal or external URLs. LiteLLM is widely deployed as an LLM gateway unifying access to multiple AI backends, meaning SSRF here can expose cloud metadata services (AWS IMDSv1 at 169.254.169.254), internal APIs, and adjacent microservices not reachable from the internet—turning a CVSS 6.3 into a realistic path to cloud credential theft and lateral movement. A public proof-of-concept exploit is already live on GitHub, reducing exploitation to a script-kiddie-level operation for anyone with a valid API key. Organizations running litellm ≤1.82.2 with the MCP server enabled should upgrade immediately; as a workaround, disable the experimental MCP endpoint and enforce IMDSv2-only on cloud hosts to block metadata SSRF.
Is CVE-2026-12798 actively exploited?
No confirmed active exploitation of CVE-2026-12798 has been reported, but organizations should still patch proactively.
How to fix CVE-2026-12798?
1. PATCH: Upgrade litellm beyond 1.82.2 once a patched release is available; monitor github.com/BerriAI/litellm releases. 2. DISABLE: If the experimental MCP server is not required, disable it via configuration or remove the mcp_server experimental feature flag. 3. NETWORK EGRESS: Block outbound requests from the litellm process to 169.254.0.0/16, 10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16; enforce IMDSv2-only on AWS instances to neutralize metadata SSRF. 4. AUTHZ: Restrict MCP OpenAPI spec loading to privileged roles only; treat spec_path ingestion as an admin operation. 5. DETECT: Alert on litellm process egress to cloud metadata ranges or RFC1918 addresses; monitor for 169.254.169.254 or internal hostname resolution in proxy logs.
What systems are affected by CVE-2026-12798?
This vulnerability affects the following AI/ML architecture patterns: LLM proxy and gateway deployments, AI agent frameworks using litellm as backend, MCP server integrations, Multi-tenant enterprise LLM routers, Cloud-hosted AI inference pipelines.
What is the CVSS score for CVE-2026-12798?
CVE-2026-12798 has a CVSS v3.1 base score of 6.3 (MEDIUM).
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0010.001 AI Software AML.T0049 Exploit Public-Facing Application AML.T0053 AI Agent Tool Invocation AML.T0085.001 AI Agent Tools Compliance Controls Affected
What are the technical details?
Original Advisory
A weakness has been identified in BerriAI litellm up to 1.82.2. Affected by this vulnerability is the function load_openapi_spec_async of the file litellm/proxy/_experimental/mcp_server/openapi_to_mcp_generator.py of the component MCP OpenAPI Spec Loader. This manipulation of the argument spec_path causes server-side request forgery. It is possible to initiate the attack remotely. The exploit has been made available to the public and could be used for attacks. The vendor was contacted early about this disclosure.
Exploitation Scenario
An adversary with a low-privilege litellm API key—obtained via phishing, credential stuffing, or as a compromised internal user—calls the MCP server's OpenAPI spec loader with spec_path set to http://169.254.169.254/latest/meta-data/iam/security-credentials/ on an AWS-hosted deployment. LiteLLM fetches this URL server-side and returns the cloud IAM temporary credentials in the response body. The attacker uses those credentials to enumerate S3 buckets, read secrets from AWS Secrets Manager, or assume higher-privilege roles—pivoting from a scoped LLM API key to broad cloud infrastructure control. The public GitHub gist reduces this entire chain to a copy-paste operation.
Weaknesses (CWE)
CWE-918 — Server-Side Request Forgery (SSRF): The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.
Source: MITRE CWE corpus.
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L References
- gist.github.com/YLChen-007/c1104c529975699ba347feedfbe02c5a exploit
- vuldb.com/cve/CVE-2026-12798 third-party-advisory
- vuldb.com/submit/811290 third-party-advisory
- vuldb.com/vuln/372560 vdb-entry technical-description
- vuldb.com/vuln/372560/cti signature permissions-required
Timeline
Related Vulnerabilities
CVE-2026-42208 9.8 LiteLLM: SQL injection exposes LLM API credentials
Same package: litellm CVE-2026-35030 9.1 LiteLLM: auth bypass via JWT cache key collision
Same package: litellm CVE-2024-6825 8.8 LiteLLM: RCE via post_call_rules callback injection
Same package: litellm CVE-2026-40217 8.8 LiteLLM: RCE via bytecode rewriting in guardrails API
Same package: litellm CVE-2026-42203 8.8 LiteLLM: SSTI in prompt template endpoint enables RCE
Same package: litellm