8 views
-/https://github.com/berriai/litellm/issues/32862
GitHub Β· issue

#32862 Guardrail SSRF β€” http_request() bypasses validate_url() allowing SSRF to cloud metadata and internal services

  • State: open
  • Author: @Correctover
  • Labels: llm translation

## 🚨 Security Vulnerability: Guardrail SSRF

LiteLLM provides `validate_url()` / `safe_get()` / `async_safe_get()` in `litellm_core_utils/url_utils.py` for SSRF-protected HTTP requests. However, the **custom code guardrail `http_request()` primitive** introduced for the Guardrail feature bypasses all SSRF protection entirely.

**CVSS: 8.6 (AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N)** **Affected:** All versions with guardrails enabled (confirmed in 1.86.2) **Ecosystem:** pip **Package:** litellm

## Vulnerability Details

### The Guardrail http_request() (VULNERABLE PATH)

File: `litellm/proxy/guardrails/guardrail_hooks/custom_code/primitives.py`

```python async def http_request( url: str, method: str = "GET", headers: Optional[Dict[str, str]] = None, body: Optional[Any] = None, timeout: Optional[float] = None, ) -> Dict[str, Any]: # Validate URL β€” ONLY checks URL syntax (scheme + netloc) if not is_valid_url(url): return _http_error_response(f"Invalid URL: {url}")

# Uses the global async HTTP client DIRECTLY β€” no SSRF validation client = get_async_httpx_client( llm_provider=httpxSpecialProvider.GuardrailCallback, params={"tim…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (1 events)
#0 of 0 Β· 31d17h58m47s ago β€” entered Β· #import:https:::github.com:berriai:litellm post #2896
Issue 32862 is substantially harder because it requires secure request-path changes, careful SSRF threat analysis, regression testing, and validation across synchronous/asynchronous guardrail behavior. Issue 33211 is primarily a targeted model-metadata correction with focused SDK/configuration tests.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search