/

CVE-2026-10582

Severity:

HIGH RISK

(7.4)

SSRF (CWE-918) in Hugo Remote Resource Fetching Pipeline

CVE-2026-10582

Deferred

Vulnerability type

Category:

Server-Side Request Forgery

CWE:

CWE-918

Impact:

Sensitive Data Disclosure and Build Artifact Exfiltration

Severity:

HIGH RISK

(7.4)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Hugo's remote resource fetching can be redirected to loopback, private-network, or cloud-metadata addresses because its allowlist checks URL text rather than the destination selected during connection. If an attacker can supply a URL through content or a CMS field, the build may retrieve internal data and embed the response in the generated site.

Affected context

The issue occurs in Hugo builds that use resources.GetRemote with the security.http.urls allowlist enabled as the primary outbound-fetch control. The risk is higher when untrusted or externally managed content can influence remote-resource URLs and when the build environment can reach internal services, private network ranges, loopback interfaces, or cloud metadata endpoints. The generated static output may then contain data obtained during the build.

Exploit preconditions

  • Attack surface: Hugo's remote resource fetching through resources.GetRemote
  • Required access: Ability to influence a URL supplied through content, front matter, or an integrated CMS
  • Trigger point: Site generation when the remote resource is fetched
  • Network condition: The build environment must be able to connect to the resolved internal or otherwise restricted destination
  • Why exploitation is possible: URL policy checks inspect the supplied hostname text and do not verify the address selected by DNS resolution or enforce the policy at connection time

Why this happens

The vulnerability is caused by applying an outbound URL allowlist to the textual form of a URL without validating the destination address used by the HTTP connection. Hostname resolution is not incorporated into the authorization decision, and the client lacks a dial-time control that would re-check the resolved address. This behavior maps to CWE-918, Server-Side Request Forgery, because attacker-influenced input can cause the server-side build process to make requests to unintended internal or restricted services.

Potential impact

  • The build process may retrieve sensitive information from internal services.
  • Generated site artifacts could contain credentials, configuration data, or service responses.
  • An attacker could use the published output to exfiltrate data from the build environment.
  • Internal services may receive unauthorized requests originating from trusted build infrastructure.
  • Cloud instance metadata or other privileged endpoints could be exposed where network access permits.

General mitigation guidance

Mitigation generally focuses on making outbound destination authorization address-aware and enforcing it at connection time. Secure-by-default patterns include using an explicit scheme and host allowlist, resolving hostnames before authorization, rejecting loopback, link-local, private, multicast, and metadata-network addresses unless explicitly required, and revalidating every connection target to address DNS changes and rebinding behavior. Reducing trust in content-managed URLs, limiting outbound network access from build workers, isolating build environments, and applying least privilege can reduce impact. Static generation should avoid embedding responses from arbitrary remote locations by default.

How teams detect issues like this

Detection can combine static analysis for remote-fetch APIs whose destinations are influenced by front matter, templates, or CMS data with code review checks for hostname-only allowlists and clients lacking dial-time destination validation. Build policies can flag unrestricted resources.GetRemote usage, prohibit access to private and metadata address ranges, and monitor outbound requests from build workers. Network telemetry, DNS logs, and artifact scanning can help identify unexpected internal responses or sensitive content included in generated sites. Automated security review tools may help identify these patterns during development.

Sources

SourceLink
github.comgithub.com/gohugoio/hugo
github.comgithub.com/gohugoio/hugo/blob/v0.165.0/config/security/securityConfig.go
github.comgithub.com/gohugoio/hugo/blob/v0.165.0/resources/resource_factories/create/create.go
vulncheck.comvulncheck.com/advisories/hugo-through-server-side-request-forgery-via-security-http-urls-lacking-destination-address-validation

Frequently asked

questions

It can be exploitable through a content or CMS control that allows an attacker

to influence a URL used during a Hugo build. The attacker also needs the build

environment to have network access to the targeted destination.

Not necessarily. If untrusted content is processed by the build pipeline and

can supply remote-resource URLs, content-level access may be sufficient.

Deployment permissions and network segmentation determine the practical scope.

Enforce an explicit destination policy that validates resolved IP addresses and

performs the same checks at connection time. Deny private, loopback, link-local,

and metadata ranges by default, while allowing only required external

destinations.

Treat content-provided URLs as untrusted, restrict build-worker egress, review

all server-side fetch functions, monitor DNS and outbound connections, and

scan generated artifacts for unintended internal data.

Find out what's already
exploitable in your codebase.