{"record":{"id":"62d3b1740f9216e1","repo":"BerriAI/litellm","slug":"invalid-field-name-must-be-an-http-s-url-with","errorCode":null,"errorMessage":"Invalid {field_name}: must be an http(s) URL with a host. Local filesystem paths and non-http schemes are not allowed.","messagePattern":"Invalid (.+?): must be an http\\(s\\) URL with a host\\. Local filesystem paths and non-http schemes are not allowed\\.","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py","lineNumber":1154,"sourceCode":"        **stored_values,\n        **{field: _resolve_ui_theme_field(stored_values, field) for field in _UI_THEME_FIELD_ENV_VARS},\n    }\n    return result\n\n\ndef _validate_public_image_url(value: str | None, field_name: str) -> None:\n    \"\"\"\n    Reject anything that isn't a plain http(s) URL with a host. This value is\n    later served via the unauthenticated /get_image endpoint, so local paths\n    like \"/etc/passwd\" or \"file://...\" must not be accepted.\n    \"\"\"\n    if value is None:\n        return\n    if not isinstance(value, str) or not value.strip():\n        return\n    parsed: Final = urlparse(value.strip())\n    if parsed.scheme not in (\"http\", \"https\") or not parsed.netloc:\n        raise HTTPException(\n            status_code=400,\n            detail={\n                \"error\": (\n                    f\"Invalid {field_name}: must be an http(s) URL with a host. \"\n                    \"Local filesystem paths and non-http schemes are not allowed.\"\n                )\n            },\n        )\n\n\n@router.patch(\n    \"/update/ui_theme_settings\",\n    tags=[\"UI Theme Settings\"],\n    dependencies=[Depends(user_api_key_auth)],\n)\nasync def update_ui_theme_settings(\n    theme_config: UIThemeConfig,\n    user_api_key_dict: UserAPIKeyAuth = Depends(user_api_key_auth),","sourceCodeStart":1136,"sourceCodeEnd":1172,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py#L1136-L1172","documentation":"SSRF/path guard in _validate_public_image_url: the submitted UI branding URL failed urlparse checks — it is not a plain http/https URL with a host (e.g. '/etc/passwd', 'file://...', or a schemeless value). Because the URL is later served verbatim by the unauthenticated /get_image endpoint, local filesystem paths and non-http schemes are rejected.","triggerScenarios":"Thrown at litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py:1154 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide a valid http(s) URL with a host for the field; local paths and other schemes are rejected."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}