CVE-2021-27918 Denial of service in n/a

High 7.5 Published Updated

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.

PackageAffectedFixed in
golang BitnamiAll versions1.15.9, 1.16.1
stdlib GoAll versions1.15.9, 1.16.1
Linux distribution packages (11)
go1.15 SUSE:Enterprise Storage 6All versions1.15.10-1.25.1
go1.15 SUSE:Linux Enterprise High Performance Computing 15 SP1-ESPOSAll versions1.15.10-1.25.1
go1.15 SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSSAll versions1.15.10-1.25.1
go1.15 SUSE:Linux Enterprise Module for Development Tools 15 SP2All versions1.15.10-1.25.1
go1.15 SUSE:Linux Enterprise Server 15 SP1-BCLAll versions1.15.10-1.25.1
go1.15 SUSE:Linux Enterprise Server 15 SP1-LTSSAll versions1.15.10-1.25.1
go1.15 SUSE:Linux Enterprise Server for SAP Applications 15 SP1All versions1.15.10-1.25.1
go1.15 SUSE:Manager Proxy 4.0All versions1.15.10-1.25.1
go1.15 SUSE:Manager Retail Branch Server 4.0All versions1.15.10-1.25.1
go1.15 SUSE:Manager Server 4.0All versions1.15.10-1.25.1
go1.15 openSUSE:Leap 15.2All versions1.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.

All Golang Go vulnerabilities

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.

Is CVE-2021-27918 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free