The vulnerability is a Server-Side Request Forgery (SSRF) in Hugo's resources.GetRemote function. The root cause is that the underlying HTTP client would follow HTTP 3xx redirects without re-validating the redirected URL against the configured security.http.urls allow-list.
The patch is in the create.New function in resources/resource_factories/create/create.go. This function is responsible for creating the http.Client used for fetching remote resources. The fix involves adding a CheckRedirect function to the http.Client's configuration. This new function ensures that every redirected URL is checked against the allow-list.
The vulnerable function is identified as create.New because it is responsible for creating the misconfigured http.Client that lacks the redirect validation. While resources.GetRemote is the user-facing function that triggers the vulnerability, create.New is where the vulnerable component is instantiated. During exploitation, a call to resources.GetRemote would lead to the use of this vulnerable client, allowing the SSRF.