The ToASCII and ToUnicode functions incorrectly accept Punycode-encoded labels that decode to an ASCII-only label. For example, ToUnicode("xn--example-.com") incorrectly returns the name "example.com" rather than an error. This behavior can lead to privilege escalation in programs using the idna package. For example, a program which performs privilege checks on the ASCII hostname may reject "example.com" but permit "xn--example-.com". If that program subsequently converts the ASCII hostname to Unicode, it will inadvertently permits access to the Unicode name "example.com".
The ToASCII and ToUnicode functions incorrectly process invalid Punycode labels — for example, calling ToUnicode("xn--example-.com") returns "example.com" instead of an error. An application may reject a direct request for "example.com" during permission verification, but allow a request for "xn--example-.com" because these two forms are treated as different names. If the application then converts the accepted Punycode form to Unicode, it receives "example.com" and unknowingly grants access to a resource that was supposed to be protected.
An authenticated attacker with low privileges can bypass access control mechanisms based on hostnames and gain unauthorized access to resources or functions reserved for other users or administrators.
Apply patches available from the vendor according to the references (https://go.dev/cl/767220, https://go.dev/issue/78760, https://groups.google.com/g/golang-announce/c/iI-mYSI0lu8). It is also recommended to review application code for locations where results of ToASCII and ToUnicode functions are used in access control logic.
Applications written in Go using the idna package to process or validate domain names; detailed information about versions available in vendor references (pkg.go.dev/vuln/GO-2026-5026).
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:NGolang Net
APPGolang< 0.55.0
Related vulnerabilities
The html package (aka x/net/html) through 2018-09-25 in Go mishandles <math><template><mn><b></template>, lead...
The html package (aka x/net/html) through 2018-09-25 in Go mishandles <svg><template><desc><t><svg></template>...
The html package (aka x/net/html) through 2018-09-25 in Go mishandles <table><math><select><mi><select></table...
The html package (aka x/net/html) through 2018-09-17 in Go mishandles <template><tBody><isindex/action=0>, lea...
The html package (aka x/net/html) through 2018-09-17 in Go mishandles <math><template><mo><template>, leading ...