{"record":{"id":"f46ac24414066488","repo":"BerriAI/litellm","slug":"rejected-polling-url-ssrf-err","errorCode":null,"errorMessage":"Rejected polling URL: {ssrf_err}","messagePattern":"Rejected polling URL: (.+?)","errorType":"exception","errorClass":"AzureOpenAIError","httpStatus":502,"severity":"error","filePath":"litellm/llms/azure/azure.py","lineNumber":903,"sourceCode":"                \"model\", None\n            )  # REMOVE 'model' from dall-e-2 arg https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#request-a-generated-image-dall-e-2-preview\n            response = await async_handler.post(\n                url=api_base,\n                data=json.dumps(data),\n                headers=headers,\n            )\n            if \"operation-location\" in response.headers:\n                operation_location_url: Final = response.headers[\"operation-location\"]\n            else:\n                raise AzureOpenAIError(status_code=500, message=response.text)\n            # Reject polling URLs that don't share an origin with ``api_base``.\n            # Without this an upstream-controlled or attacker-controlled\n            # value would receive the operator's Azure API key in the\n            # request headers below. VERIA-51.\n            try:\n                assert_same_origin(operation_location_url, api_base)\n            except SSRFError as ssrf_err:\n                raise AzureOpenAIError(\n                    status_code=502,\n                    message=f\"Rejected polling URL: {ssrf_err}\",\n                )\n            response = await async_handler.get(\n                url=operation_location_url,\n                headers=headers,\n            )\n\n            await response.aread()\n\n            timeout_secs: Final[int] = AZURE_OPERATION_POLLING_TIMEOUT\n            start_time: Final = time.time()\n            if \"status\" not in response.json():\n                # Don't reflect the raw response body — when the polling\n                # URL points at an internal JSON API (cloud metadata\n                # service etc.) reflecting it here turns Blind SSRF into\n                # Full-Read SSRF. VERIA-51.\n                raise AzureOpenAIError(","sourceCodeStart":885,"sourceCodeEnd":921,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/azure/azure.py#L885-L921","documentation":"Error \"Rejected polling URL: {ssrf_err}\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/llms/azure/azure.py:903 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The operation polling URL failed SSRF validation; ensure api_base is your trusted Azure endpoint and not a redirect to an untrusted host."],"exampleFix":null,"handlingStrategy":null,"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-23T08:17:48.524Z"}