Security advisory
The x/text package before 0.3.3 for Go has a vulnerability in encoding/unicode that could lead to the UTF-16 decoder entering an infinite loop, causing the program to crash or run out of memory. An attacker could provide a single byte to a UTF16 decoder instantiated with UseBOM or ExpectBOM to trigger an infinite loop if the String function on the Decoder is called, or the Decoder is passed to golang.org/x/text/transform.String.
- Products
- Not specified
- Affected versions
- Not specified
- Fixed versions
- Not specified
- CVEs
- CVE-2020-14040
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 1 Nov 2026, 04:28 UTC · Revision 1
Source evidence
The x/text package before 0.3.3 for Go has a vulnerability in encoding/unicode that could lead to the UTF-16 decoder entering an infinite loop, causing the program to crash or run out of memory. An attacker could provide a single byte to a UTF16 decoder instantiated with UseBOM or ExpectBOM to trigger an infinite loop if the String function on the Decoder is called, or the Decoder is passed to golang.org/x/text/transform.String.
osv:CVE-2020-14040
Complete source record
{
"id": "fccf205c86a85a5a6861b4ae218de79683b1277d5610f092157e97bc80cbb98c",
"url": "https://osv.dev/vulnerability/CVE-2020-14040",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "CVE-2020-14040",
"summary": "The x/text package before 0.3.3 for Go has a vulnerability in encoding/unicode that could lead to the UTF-16 decoder entering an infinite loop, causing the program to crash or run out of memory. An attacker could provide a single byte to a UTF16 decoder instantiated with UseBOM or ExpectBOM to trigger an infinite loop if the String function on the Decoder is called, or the Decoder is passed to golang.org/x/text/transform.String.",
"evidence": "osv:CVE-2020-14040",
"products": [],
"severity": "high",
"structured": {
"id": "CVE-2020-14040",
"aliases": [
"CVE-2020-14040",
"GHSA-5rcv-m4m3-hfh7",
"GO-2020-0015"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://github.com/golang/text",
"type": "GIT",
"events": [
{
"introduced": "0"
},
{
"fixed": "23ae387dee1f90d29a23c0e87ee0b46038fbed0e"
}
],
"database_specific": {
"extracted_events": [
{
"cpe": "cpe:2.3:a:golang:text:*:*:*:*:*:*:*:*",
"range": [
{
"introduced": "0"
},
{
"fixed": "0.3.3"
}
],
"source": "CPE_RANGE"
}
]
}
}
],
"versions": [
"v0.3.2",
"v0.3.1",
"v0.3.0",
"v0.2.0",
"v0.1.0"
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2020-14040.json"
}
}
],
"modified": "2026-10-24T10:30:18.674680681Z",
"provider": "osv",
"references": [
"https://groups.google.com/forum/#%21topic/golang-announce/bXVeAmGOqz0",
"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/TACQFZDPA7AUR6TRZBCX2RGRFSDYLI7O/"
],
"provider_metadata": {
"unresolved_ranges": [
{
"cpes": [
"cpe:2.3:o:fedoraproject:fedora:32:*:*:*:*:*:*:*"
],
"vendor_product": "fedoraproject:fedora",
"extracted_events": [
{
"range": [
{
"introduced": "32"
},
{
"last_affected": "32"
}
],
"source": "CPE_STRING"
}
]
}
]
}
},
"related_cves": [
{
"value": "CVE-2020-14040",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 429826,
"published_at": "2020-06-17T20:15:09.993+00:00"
}