cve.bz

CVE-2021-27918 golang go: Infinite Loop

7.5 highEPSS 2.5%Fix available

High (7.5) in golang go. EPSS 2.5% estimated probability of exploitation activity in the next 30 days. Fixed in stdlib 1.15.9, 1.16.1.

On this page
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.

Severity

CVSS 3.1

7.5 high
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
EPSS
2.5% (unchanged from 2.5% a week ago; 2.5% 30 days ago) estimated probability of exploitation activity in the next 30 days; 85th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CWE
CWE-835 Loop with Unreachable Exit Condition (Infinite Loop)
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2021-27918 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2021-27918?via=ask-ai-copy and https://cve.bz/cve/CVE-2021-27918?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2021-27918 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
golang:gobefore 1.15.9
golang:gofrom 1.16.0 before 1.16.1

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GO-2021-0234Gostdlib<1.15.9
>=1.16.0-0 <1.16.1
1.15.9, 1.16.1

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian11golang-1.151.15.9-1DEBIAN-CVE-2021-27918
Ubuntu14.04:LTSgolang-1.10no fix listedUBUNTU-CVE-2021-27918
Ubuntu16.04:LTSgolang-1.6, golang-1.10no fix listedUBUNTU-CVE-2021-27918
Ubuntu18.04:LTSgolang-1.8, golang-1.9, golang-1.10no fix listedUBUNTU-CVE-2021-27918
Ubuntu20.04:LTSgolang-1.13, golang-1.14no fix listedUBUNTU-CVE-2021-27918
UbuntuPro:16.04:LTS, Pro:18.04:LTS, Pro:22.04:LTSgolang-1.13no fix listedUBUNTU-CVE-2021-27918
Red Hatenterprise_linux:8::appstreamdelve, delve-debuginfo, delve-debugsource0:1.5.0-2.module+el8.4.0+8864+58b0fcdbRHSA-2021:3076
Red Hatenterprise_linux:8::appstreamgolang, go-toolset, golang-bin and 5 more0:1.15.14-1.module+el8.4.0+11833+614b07b8RHSA-2021:3076
Red Hatserverless:1.0::el8openshift-serverless-clients0:0.22.0-3.el8RHSA-2021:2704
Red Hatserverless:1.0::el8openshift-serverless-clients0:0.23.2-1.el8RHSA-2021:3555
SUSEEnterprise Storage 6, Linux Enterprise High Performance Computing 15 SP1-ESPOS, Linux Enterprise High Performance Computing 15 SP1-LTSS and 7 morego1.151.15.10-1.25.1SUSE-SU-2021:0938-1
SUSELinux Enterprise Module for Development Tools 15 SP2go1.161.16.2-1.8.1SUSE-SU-2021:0937-1
openSUSELeap 15.2go1.151.15.10-lp152.14.1openSUSE-SU-2021:0480-1
openSUSETumbleweedgo1.151.15.15-1.2openSUSE-SU-2024:10808-1
openSUSETumbleweedgo1.161.16.8-1.1openSUSE-SU-2024:10809-1
Rocky Linux8delve0:1.5.0-2.module+el8.4.0+396+d2d16ae3RLSA-2021:3076
Rocky Linux8golang, go-toolset0:1.15.14-1.module+el8.4.0+632+4dba2916RLSA-2021:3076
Alpinev3.13go1.15.10-r0ALPINE-CVE-2021-27918
Alpinev3.14, v3.15, v3.16 and 8 morego1.16.2-r0ALPINE-CVE-2021-27918
Azure Linux3golangno fix listedAZL-79104 AZL-98703

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; SUSE security data, CC BY 4.0; Rocky Linux's errata, BSD-3-Clause; the Alpine secdb, CC BY-SA 4.0; Microsoft's Azure Linux vulnerability data, MIT. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat · SUSE · openSUSE · Alpine.

Red Hat

Red Hat rates this Moderate.

Red Hat's statement

OpenShift Container Platform (OCP), OpenShift ServiceMesh (OSSM), Red Hat OpenShift Jaeger (RHOSJ) and OpenShift Virtualization all bundle vulnerable versions of the golang standard library (stdlib). However, no component within each product utilizes the function xml.NewTokenDecoder which is a requirement to be vulnerable. Hence, all affected components are marked as "Will not fix". Additionally no OCP container has been listed, as nearly all available containers are compiled with an affected version of Go, but do not utilize the function xml.NewTokenDecoder.

Red Hat Ceph Storage (RHCS), Red Hat Gluster Storage 3 and OpenShift Container Storage 4 also bundles a vulnerable version of golang standard library 'encoding/xml', but does not utilize the function xml.NewTokenDecoder, and hence this issue has been rated as having a security impact of Low.

ProductPackageStateAdvisory
Openshift Serveless 1.16openshift-serverless-1/client-kn-rhel8:0.22.0-4Fixed 2021-07-13RHSA-2021:2705
Openshift Serveless 1.16openshift-serverless-1/eventing-apiserver-receive-adapter-rhel8:0.22.0-2Fixed 2021-07-13RHSA-2021:2705
Openshift Serveless 1.16openshift-serverless-1/eventing-controller-rhel8:0.22.0-2Fixed 2021-07-13RHSA-2021:2705
Openshift Serveless 1.16openshift-serverless-1/eventing-in-memory-channel-controller-rhel8:0.22.0-2Fixed 2021-07-13RHSA-2021:2705
Openshift Serveless 1.16openshift-serverless-1/eventing-in-memory-channel-dispatcher-rhel8:0.22.0-2Fixed 2021-07-13RHSA-2021:2705
Openshift Serveless 1.16openshift-serverless-1/eventing-mtbroker-filter-rhel8:0.22.0-2Fixed 2021-07-13RHSA-2021:2705
Openshift Serveless 1.16openshift-serverless-1/eventing-mtbroker-ingress-rhel8:0.22.0-2Fixed 2021-07-13RHSA-2021:2705
Openshift Serveless 1.16openshift-serverless-1/eventing-mtchannel-broker-rhel8:0.22.0-2Fixed 2021-07-13RHSA-2021:2705
Openshift Serveless 1.16openshift-serverless-1/eventing-mtping-rhel8:0.22.0-2Fixed 2021-07-13RHSA-2021:2705
Openshift Serveless 1.16openshift-serverless-1/eventing-storage-version-migration-rhel8:0.22.0-2Fixed 2021-07-13RHSA-2021:2705
Distributed Tracing Jaeger 1distributed-tracing/jaeger-all-in-one-rhel8Will not fix
Distributed Tracing Jaeger 1distributed-tracing/jaeger-collector-rhel8Will not fix
Distributed Tracing Jaeger 1distributed-tracing/jaeger-rhel8-operatorWill not fix
OpenShift Serverlessknative-eventingWill not fix
OpenShift Serverlessknative-servingWill not fix
OpenShift Service Mesh 2.0servicemeshWill not fix
OpenShift Service Mesh 2.0servicemesh-grafanaWill not fix
OpenShift Service Mesh 2.0servicemesh-operatorWill not fix
OpenShift Service Mesh 2.0servicemesh-prometheusWill not fix
Red Hat Ceph Storage 2golangOut of support scope
105 more in the JSON and on Red Hat's page.

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2021-27918.

References

Check your stackJSON