golang.org/x/text Infinite loop

Description

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

Basic information

Type
reviewed
Severity
medium
Advisory on GitHub
Open advisory ↗
Repository advisory
Source code
Not specified
Published (advisory)
2021-05-18 18:34:35 UTC
Updated
2024-05-20 19:24:16 UTC
GitHub reviewed
2021-05-12 14:54:58 UTC

EPSS Score

Score Percentile
0.01% 0.51%

CVSS Scores

Base score Version Severity Vector
6.7 3.1
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 Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:L)
Once they can reach the bug, pulling it off is straightforward—no weird race conditions or rare setup.
Privileges required (PR:N)
No account or special rights needed—anonymous or random user is enough.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.
Scope (S:U)
Damage stays in the same “trust bubble” as the broken component—no big spill into unrelated systems.
Confidentiality (C:N)
Doesn’t really leak secrets in a meaningful way.
Integrity (I:N)
Data isn’t meaningfully altered or forged.
Availability (A:H)
Could take the service down hard or make it unusable for people who depend on it.
Exploit maturity (E:P)
There’s at least a proof-of-concept or demo code out there.
Fix status (RL:O)
Vendor shipped an official fix you’re meant to install.
Report confidence (RC:C)
Treat it as confirmed—the vulnerability and impact line up with evidence.

Identifiers

CWEs

CWE id Name
CWE-400 Uncontrolled Resource Consumption
CWE-835 Loop with Unreachable Exit Condition ('Infinite Loop')

Affected packages (1)

Vulnerable version ranges and first patched releases as published by GitHub.

Ecosystem Package Vulnerable range First patched Vulnerable functions
go golang.org/x/text < 0.3.3 0.3.3

References

cvelogic Threat Intelligence