CVE-2021-27918 Denial of service in n/a
An attacker can cause a denial of service via an infinite loop in the Go XML decoder when using a custom TokenReader that returns EOF prematurely.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2021-27918?
CVE-2021-27918 is a high-severity denial of service vulnerability in Golang Go, published on 10 Mar 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
encoding/xml in Go before 1.15.9 and 1.16.x before 1.16.1 has an infinite loop if a custom TokenReader (for xml.NewTokenDecoder) returns EOF in the middle of an element. This can occur in the Decode, DecodeElement, or Skip method.
Weakness: CWE-835
Which versions are affected by CVE-2021-27918?
2 open source packages ship an affected version, including golang and stdlib. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
golang Bitnami | All versions | 1.15.9, 1.16.1 |
stdlib Go | All versions | 1.15.9, 1.16.1 |
Linux distribution packages (11)
go1.15 SUSE:Enterprise Storage 6 | All versions | 1.15.10-1.25.1 |
go1.15 SUSE:Linux Enterprise High Performance Computing 15 SP1-ESPOS | All versions | 1.15.10-1.25.1 |
go1.15 SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSS | All versions | 1.15.10-1.25.1 |
go1.15 SUSE:Linux Enterprise Module for Development Tools 15 SP2 | All versions | 1.15.10-1.25.1 |
go1.15 SUSE:Linux Enterprise Server 15 SP1-BCL | All versions | 1.15.10-1.25.1 |
go1.15 SUSE:Linux Enterprise Server 15 SP1-LTSS | All versions | 1.15.10-1.25.1 |
go1.15 SUSE:Linux Enterprise Server for SAP Applications 15 SP1 | All versions | 1.15.10-1.25.1 |
go1.15 SUSE:Manager Proxy 4.0 | All versions | 1.15.10-1.25.1 |
go1.15 SUSE:Manager Retail Branch Server 4.0 | All versions | 1.15.10-1.25.1 |
go1.15 SUSE:Manager Server 4.0 | All versions | 1.15.10-1.25.1 |
go1.15 openSUSE:Leap 15.2 | All versions | 1.15.10-lp152.14.1 |
Products include Golang Go.
How do I fix CVE-2021-27918?
Upgrade golang to a fixed version for your release line: 1.15.9 or 1.16.1.
Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.
Is CVE-2021-27918 being exploited?
There is no known exploitation of CVE-2021-27918 in the wild and no public exploit code.
Other vulnerabilities in Golang Go
- CVE-2020-0601 Microsoft Windows CryptoAPI Spoofing
- CVE-2026-27143 Missing bound checks can lead to memory corruption in safe Go in cmd/compile
- CVE-2024-24790 Unexpected behavior from Is methods for IPv4-mapped IPv6 addresses in net/netip
- CVE-2023-39320 Arbitrary code execution via go.mod toolchain directive in cmd/go
- CVE-2023-24540 Improper handling of JavaScript whitespace in html/template
Sources
Also known as AZL-79104, AZL-98703, BIT-golang-2021-27918, DEBIAN-CVE-2021-27918, GHSA-8mmp-c685-53vw, GO-2021-0234 and 4 more.