Invoking failure to reject ASCII-only Punycode-encoded labels in golang.org/x/net/idna
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".
- Products
- golang.org/x/net, stdlib
- Affected versions
- Not specified
- Fixed versions
- 0.55.0, 1.25.13, 1.26.6, 1.27.0-rc.3
- CVEs
- CVE-2026-39821
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 30 Oct 2026, 20:35 UTC · Revision 1
Source evidence
Invoking failure to reject ASCII-only Punycode-encoded labels in golang.org/x/net/idna
core-osv · Original sourcePublished 22 May 2026, 02:46 UTC
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".
osv:GO-2026-5026
stdlib
Fixed versions: 1.25.13, 1.26.6, 1.27.0-rc.3
golang.org/x/net
Fixed versions: 0.55.0
Complete source record
{
"id": "f10cfeaa6f90d8098a0f937b4b5e5eb25682f5512ce48f8166e3f6858673c196",
"url": "https://osv.dev/vulnerability/GO-2026-5026",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "Invoking failure to reject ASCII-only Punycode-encoded labels in golang.org/x/net/idna",
"summary": "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\".",
"evidence": "osv:GO-2026-5026",
"products": [
{
"name": {
"value": "stdlib",
"evidence": "/affected/0/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "1.25.13",
"evidence": "/affected/0/ranges"
},
{
"value": "1.26.6",
"evidence": "/affected/0/ranges"
},
{
"value": "1.27.0-rc.3",
"evidence": "/affected/0/ranges"
}
],
"affected_versions": []
},
{
"name": {
"value": "golang.org/x/net",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "0.55.0",
"evidence": "/affected/1/ranges"
}
],
"affected_versions": []
}
],
"severity": "unknown",
"structured": {
"id": "GO-2026-5026",
"aliases": [
"CVE-2026-39821",
"GO-2026-5026"
],
"affected": [
{
"ranges": [
{
"type": "SEMVER",
"events": [
{
"introduced": "0"
},
{
"fixed": "1.25.13"
},
{
"introduced": "1.26.0-0"
},
{
"fixed": "1.26.6"
},
{
"introduced": "1.27.0-0"
},
{
"fixed": "1.27.0-rc.3"
}
]
}
],
"package": {
"name": "stdlib",
"purl": "pkg:golang/stdlib",
"ecosystem": "Go"
},
"database_specific": {
"source": "https://vuln.go.dev/ID/GO-2026-5026.json"
},
"ecosystem_specific": {
"imports": [
{
"path": "net/http",
"symbols": [
"Client.CloseIdleConnections",
"Client.Do",
"Client.Get",
"Client.Head",
"Client.Post",
"Client.PostForm",
"ClientConn.Close",
"ClientConn.RoundTrip",
"Get",
"Head",
"Post",
"PostForm",
"Transport.CloseIdleConnections",
"Transport.NewClientConn",
"Transport.RoundTrip",
"http1ClientConn.Close",
"http1ClientConn.RoundTrip",
"http2ClientConn.RoundTrip",
"http2RoundTripper.RoundTrip",
"idnaASCII"
]
},
{
"path": "net/http/internal/http2",
"symbols": [
"Transport.AddConn",
"Transport.RoundTrip",
"Transport.RoundTripOpt",
"authorityAddr"
]
}
]
}
},
{
"ranges": [
{
"type": "SEMVER",
"events": [
{
"introduced": "0"
},
{
"fixed": "0.55.0"
}
]
}
],
"package": {
"name": "golang.org/x/net",
"purl": "pkg:golang/golang.org/x/net",
"ecosystem": "Go"
},
"database_specific": {
"source": "https://vuln.go.dev/ID/GO-2026-5026.json"
},
"ecosystem_specific": {
"imports": [
{
"path": "golang.org/x/net/idna",
"symbols": [
"Profile.ToASCII",
"Profile.ToUnicode",
"Profile.process",
"ToASCII",
"ToUnicode"
]
}
]
}
}
],
"modified": "2026-10-16T10:42:05.164302476Z",
"provider": "osv",
"references": [
"https://go.dev/cl/767220",
"https://go.dev/issue/78760",
"https://groups.google.com/g/golang-announce/c/iI-mYSI0lu8",
"https://groups.google.com/g/golang-announce/c/94pEornpRlI"
],
"provider_metadata": {
"url": "https://pkg.go.dev/vuln/GO-2026-5026",
"review_status": "REVIEWED"
}
},
"related_cves": [
{
"value": "CVE-2026-39821",
"evidence": "/aliases"
}
],
"security_relevant": true,
"severity_evidence": null
},
"source_id": "core-osv",
"document_id": 340597,
"published_at": "2026-05-22T02:46:43+00:00"
}