REDHAT-BUG-2521803: High severity Hugo Hugo vulnerability
Hugo's security.http.urls allowlist is the only control on outbound fetches made by resources.GetRemote, and it inspects the URL text alone. CheckAllowedHTTPURL in config/security/securityConfig.go applies the configured pattern list and then re-checks a canonicalised form of an integer, hex or octal IPv4 host, but it never resolves the hostname and never inspects the address the HTTP client actually connects to. The client constructed in resources/resourcefactories/create/create.go installs no dial-time hook, so no check occurs at connection time either. A hostname that resolves to a loopback, private or cloud-metadata address therefore satisfies the policy, and the response body is embedded in the generated site. An attacker who can supply a URL through content, for example a front-matter field or a CMS field, can make the build fetch an internal endpoint and publish the response in the static output, so the build artifact itself carries the data out.
Affected Software
Event History
Frequently Asked Questions
Who is realistically exposed to this issue?
Sites that use resources.GetRemote with security.http.urls configured to permit attacker-influenced hostnames are exposed. This is particularly relevant where URLs can be supplied through front matter or CMS fields during site builds.
What does an attacker need to exploit it?
An attacker needs the ability to provide a URL that is consumed by resources.GetRemote during a build. The supplied hostname must pass the configured URL allowlist while resolving to an internal, loopback, private, or cloud-metadata address.
Is the default configuration affected?
The available information identifies security.http.urls as the control governing outbound fetches, but does not state the default allowlist configuration. Exposure depends on whether the build permits attacker-controlled URLs through that policy.
How can I tell whether generated content may already contain exposed data?
Review build inputs, including front-matter and CMS URL fields, for values passed to resources.GetRemote, then inspect generated static output for response content from internal services. Also review allowed hostnames for names that could resolve to loopback, private, or cloud-metadata addresses.
What can be done if patching is not immediately possible?
Prevent untrusted users from supplying URLs used by resources.GetRemote and restrict the security.http.urls allowlist to trusted, controlled destinations. Avoid allowing hostnames whose DNS resolution could point to internal or cloud-metadata addresses.