CVE-2020-14040 — Vulnerability in golang.org/x/text — CVE Details
golang.org/x/text Infinite loop
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (1.89%). Schedule for your next planned update.
Does your project use an affected golang.org/x/text version?
Paste your go.sum to check it for CVE-2020-14040 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
Go version v0.3.3 of the x/text package fixes 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.
Specific Go Packages Affected
golang.org/x/text/encoding/unicode golang.org/x/text/transform
Advisory Timeline
- First published May 18, 2021 (2018 days ago).
- Last revised September 10, 2026 — 1940 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
go get golang.org/x/text@v0.3.3
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (1)
Affects 1 ecosystem: Go (1).
| Package | Fixed In |
|---|---|
| golang.org/x/text Go · Affected: All versions | 0.3.3 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-400Uncontrolled Resource ConsumptionMITRE
- CWE-835
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 7.5 score means for each attack dimension.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H/E:P/RL:O/RC:C
References
- https://nvd.nist.gov/vuln/detail/CVE-2020-14040ADVISORY
- https://github.com/golang/go/issues/39491WEB
- https://github.com/golang/text/commit/23ae387dee1f90d29a23c0e87ee0b46038fbed0eWEB
- https://go-review.googlesource.com/c/text/+/238238WEB
- https://go.dev/cl/238238WEB
- https://go.dev/issue/39491WEB
- https://go.googlesource.com/text/+/23ae387dee1f90d29a23c0e87ee0b46038fbed0eWEB
- https://groups.google.com/forum/#!topic/golang-announce/bXVeAmGOqz0WEB
- https://groups.google.com/g/golang-announce/c/bXVeAmGOqz0WEB
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/TACQFZDPA7AUR6TRZBCX2RGRFSDYLI7OWEB
Frequently Asked Questions
- What is CVE-2020-14040?
- golang.org/x/text Infinite loop. This vulnerability has been assigned a severity rating of MEDIUM (CVSS score: 7.5/10).
- How do I check if my project is affected by CVE-2020-14040?
- CVE-2020-14040 affects golang.org/x/text. It has a 1.9% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2020-14040 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Significant impact if exploited, or exploitable with modest effort.
This places it in the top quartile of EPSS-scored vulnerabilities — 80.1% of tracked vulnerabilities score at or below it, so it is more likely to be exploited than most of the tracked corpus.
Also Known As
Related CVEs
- CVE-2022-27664HIGH
golang.org/x/net/http2 Denial of Service vulnerability
- CVE-2022-32149HIGH
golang.org/x/text/language Denial of service via crafted Accept-Language header
- CVE-2021-38561HIGH
golang.org/x/text/language Out-of-bounds Read vulnerability
- CVE-2021-38561
Out-of-bounds read in golang.org/x/text/language
- CVE-2022-32149
Denial of service via crafted Accept-Language header in golang.org/x/text/language
- GO-2026-5932
The golang.org/x/crypto/openpgp package is unmaintained, unsafe by design, and has known security issues
- CVE-2026-56852
Infinite loop on invalid input in golang.org/x/text
- CVE-2026-56851
Panic parsing crafted input in x/text/secure/precis in golang.org/x/text