-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Description
Overview
Nil pointer dereference vulnerability in retry logic can cause application panic when Azure API is unavailable.
Issue Details
Potential Nil Pointer Dereference After Retry Exhaustion
File: azurecontentsafetycontentmoderation.go (lines 411-454)
Description:
If all 5 retries fail with 5xx errors, the retry loop exits without setting lastErr, and resp remains nil (closed on line 434). The subsequent defer resp.Body.Close() on line 454 will panic when trying to access resp.Body on a nil pointer.
Failure Scenario:
- Azure API returns 5xx errors for all retry attempts
- Loop exits with
resp = nil defer resp.Body.Close()attempts to access nil pointer- Application panics
Proposed Fix:
Check if resp is not nil before accessing resp.Body.Close(). Alternatively, restructure the retry logic to ensure resp is properly handled.
Impact:
Application panic when Azure API is unavailable and all retries are exhausted.
Reference
Metadata
Metadata
Assignees
Labels
No labels