BerriAI/litellm · error · HTTPException

Invalid Langfuse endpoint path

Error message

Invalid Langfuse endpoint path

What it means

Path-traversal guard on the Langfuse proxy endpoint path: after decode-to-convergence (repeated URL unquoting), the path contains control characters or a '.'/'..' segment, indicating an attempt (or accident) to escape the Langfuse mount with encoded traversal sequences. The decoded path must be a plain, non-relative endpoint path.

Source

Thrown at litellm/proxy/vertex_ai_endpoints/langfuse_endpoints.py:85

    if base_url.scheme not in ("http", "https") or not base_url.host:
        raise HTTPException(
            status_code=status.HTTP_400_BAD_REQUEST,
            detail={"error": "Invalid Langfuse host"},
        )

    if base_url.userinfo:
        raise HTTPException(
            status_code=status.HTTP_400_BAD_REQUEST,
            detail={"error": "Langfuse host must not include credentials"},
        )

    return str(base_url)


def _validate_langfuse_proxy_path(endpoint: str) -> str:
    decoded_endpoint: Final = _decode_to_convergence(endpoint)
    if any(ord(char) < 32 for char in decoded_endpoint):
        raise HTTPException(
            status_code=status.HTTP_400_BAD_REQUEST,
            detail={"error": "Invalid Langfuse endpoint path"},
        )
    if "\\" in decoded_endpoint or decoded_endpoint.startswith("//"):
        raise HTTPException(
            status_code=status.HTTP_400_BAD_REQUEST,
            detail={"error": "Invalid Langfuse endpoint path"},
        )

    endpoint_path: Final = "/" + decoded_endpoint.lstrip("/")
    if any(segment in (".", "..") for segment in endpoint_path.split("/")):
        raise HTTPException(
            status_code=status.HTTP_400_BAD_REQUEST,
            detail={"error": "Invalid Langfuse endpoint path"},
        )
    return endpoint_path

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Use a valid Langfuse endpoint path; check the path for disallowed segments.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at litellm/proxy/vertex_ai_endpoints/langfuse_endpoints.py:85 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/6ffed13954d00083. Report an issue: GitHub.