Skip to main content

CVE-2020-14040 — Vulnerability in golang.org/x/text — CVE Details

MEDIUM

golang.org/x/text Infinite loop

Published May 18, 2021Updated September 10, 2026Source: OSV

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.

Check my go.sum

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
Update golang.org/x/text to 0.3.3 or later
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).

PackageFixed In
golang.org/x/text Go · Affected: All versions0.3.3

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 7.5 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

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

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

CVSS Score
7.5

Significant impact if exploited, or exploitable with modest effort.

EPSS Score (30-day exploit probability)
1.89%
EPSS percentile: 80.1

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

GHSA-5rcv-m4m3-hfh7
GO-2020-0015

Related CVEs

  • CVE-2022-27664
    HIGH

    golang.org/x/net/http2 Denial of Service vulnerability

  • CVE-2022-32149
    HIGH

    golang.org/x/text/language Denial of service via crafted Accept-Language header

  • CVE-2021-38561
    HIGH

    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

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my go.sum