# CVE-2026-12798: BerriAI litellm SSRF in MCP OpenAPI Spec Loader

Source: https://junglewise.ai/threats/cve-2026-12798-berriai-litellm-ssrf-in-mcp-openapi-spec-loader  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-06-21. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2026-12798 · Severity: medium · CVSS 6.3 · Published 2026-06-21

BerriAI litellm is an LLM proxy platform that orchestrates language model APIs. The MCP (Model Context Protocol) OpenAPI Spec Loader component fetches remote API specifications to dynamically load tool definitions. Due to missing URL validation, any authenticated user can trick the proxy into making HTTP requests to arbitrary internal URLs—including cloud metadata services—to steal AWS/GCP credentials, discover internal services, or perform port scanning. This bypasses network isolation and can lead to full infrastructure compromise.

Technologies: [Berriai LiteLLM](https://junglewise.ai/threats/technologies/litellm), [litellm (PyPI)](https://junglewise.ai/threats/technologies/pypi-litellm). Vendors: [Berriai](https://junglewise.ai/threats/vendors/berriai), [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is CVE-2026-12798 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-12798 being exploited in the wild.

**How severe is CVE-2026-12798?** Medium severity, with a CVSS score of 6.3, published 21 June 2026.

**Which products and versions are affected?** Berriai LiteLLM <= 1.82.2, up to 1.82.2; litellm (PyPI) ECOSYSTEM:introduced=0,last_affected=1.82.2.

**Is there a fix for CVE-2026-12798?** No fixed version is recorded yet. Check the vendor's advisory in the references below. If you run it, Junglewise drafts a mitigation that fits your setup and applies it once you approve, with senior security engineers behind it.

**How is CVE-2026-12798 attacked?** It is attacked over the network.

**Am I affected by CVE-2026-12798?** Check whether you run Berriai LiteLLM or litellm (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## Technical details

The vulnerability exists in the load_openapi_spec_async() function in litellm/proxy/_experimental/mcp_server/openapi_to_mcp_generator.py, which was recently enhanced to support remote HTTP/HTTPS URLs. The function accepts a user-controlled spec_path parameter and directly passes it to httpx.get() without URL validation, DNS rebinding protection, private IP filtering, or metadata endpoint blocking. The function is called from the /mcp-rest/test/tools/list REST endpoint, which is accessible to any authenticated user (not admin-only). An attacker with a valid API key can POST a crafted spec_path (e.g., http://169.254.169.254/latest/meta-data/) to exfiltrate cloud credentials, reach internal services (10.0.0.0/8, 192.168.0.0/16), or probe internal network topology. The PoC confirms successful extraction of internal service responses and port detection. No official patch has been released as of the advisory date.

## Affected products

- BerriAI litellm <= 1.82.2

## Identifiers

- CVE-2026-12798
- GHSA-c693-x898-5g4h
- PYSEC-2026-4069

## Timeline

- 2026-06-21: disclosed: Vulnerability disclosed to GitHub Advisory Database and NVD
- 2026-03-21: other: PoC and detailed technical report published by researcher YLChen-007
- 2026-09-14: other: GitHub advisory reviewed and updated

## References

- [https://gist.github.com/YLChen-007/c1104c529975699ba347feedfbe02c5a](https://gist.github.com/YLChen-007/c1104c529975699ba347feedfbe02c5a)
- [https://vuldb.com/cve/CVE-2026-12798](https://vuldb.com/cve/CVE-2026-12798)
- [https://vuldb.com/submit/811290](https://vuldb.com/submit/811290)
- [https://vuldb.com/vuln/372560](https://vuldb.com/vuln/372560)
- [https://vuldb.com/vuln/372560/cti](https://vuldb.com/vuln/372560/cti)

## Related threats

- [LiteLLM arbitrary local file read via vertex_ai_credentials](https://junglewise.ai/threats/litellm-internal-user-viewer-arbitrary-local-file-read-via-vertex-ai-649a7475)
- [LiteLLM reflected XSS in SSO debug callback endpoint](https://junglewise.ai/threats/litellm-vulnerable-to-reflected-xss-in-sso-debug-callback-38154651)
- [LiteLLM proxy authentication bypass via reused crypto context](https://junglewise.ai/threats/cve-2026-114612-litellm-is-a-proxy-server-ai-gateway-to-call-llm-apis-in-openai)
- [BerriAI LiteLLM improper authorization in secret resolution](https://junglewise.ai/threats/cve-2026-108575-a-vulnerability-has-been-found-in-berriai-litellm-up-to-1-94-0)
- [BerriAI LiteLLM authorization bypass in spend tracking](https://junglewise.ai/threats/cve-2026-108574-a-flaw-has-been-found-in-berriai-litellm-up-to-1-95-0-affected)
