Access control bypass during Punycode hostname normalization (GO-2026-5026)

Access control bypass during Punycode hostname normalization (GO-2026-5026)

Description

In golang.org/x/net/idna, ToASCII and ToUnicode accept a Punycode label that decodes entirely to ASCII characters.

Potential impact

An application that authorizes the original hostname and then connects using the normalized name may allow access to a restricted host.

Remediation

Update golang.org/x/net to v0.57.0 or later. Reject hostname conversion errors and use the same normalized name for authorization and connection. If the application also uses the Go standard library’s net/http, rebuild it with a Go toolchain that includes the fix listed in the advisory.

Examples

Update the dependency declaration in go.mod.

Before

go
require golang.org/x/net v0.56.0

After

go
require golang.org/x/net v0.57.0

References