Every CVE Search/ Get API key

CVE-2021-27918

encoding/xml in Go before 1.15.9 and 1.16.x before 1.16.1 has an infinite loop if a custom...

7.5 HighFix available

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.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
Low
Privileges needed
None
User interaction
None

What an attacker can affect

Confidentiality
None
Integrity
None
Availability
High

Exploit likelihood

2.47%Up 2.1 points since Apr 14, 2021
90%50%10%1%

What each source reports

NVD Score used 7.5

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.

Record
CVE-2021-27918
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
CVSS 2.0
5.0 MediumAV:N/AC:L/Au:N/C:N/I:N/A:P
Weakness
CWE-835
Updated
2026-11-02
CVE List No score

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.

Record
CVE-2021-27918
Updated
2026-11-02
EUVDEUVD-2021-14641 No score

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.

Record
EUVD-2021-14641
Updated
2026-11-03
GitHub AdvisoriesGHSA-8mmp-c685-53vw 7.5

encoding/xml in Go before 1.15.9 and 1.16.x before 1.16.1 has an infinite loop if a custom...

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.

Record
GHSA-8mmp-c685-53vw
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-835
Updated
2026-11-02
OSVALPINE-CVE-2021-27918 7.5

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.

Record
ALPINE-CVE-2021-27918
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-03
OSVAZL-79104 7.5

CVE-2021-27918 affecting package golang 1.26.10-1

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.

Record
AZL-79104
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
Show 18 moreShow less
OSVAZL-98703 7.5

CVE-2021-27918 affecting package golang 1.27.1-1

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.

Record
AZL-98703
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
OSVBELL-CVE-2021-27918 7.5

CVE-2021-27918 does not affect BellSoft software

Record
BELL-CVE-2021-27918
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
OSV 7.5

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.

Record
CVE-2021-27918
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
OSVDEBIAN-CVE-2021-27918 7.5

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.

Record
DEBIAN-CVE-2021-27918
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
OSVOESA-2021-1184 7.5

golang security update

Security Fix(es):

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.(CVE-2021-27918)

Record
OESA-2021-1184
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
OSVRHSA-2021:2704 7.5

Red Hat Security Advisory: Release of OpenShift Serverless Client kn 1.16.0

Record
RHSA-2021:2704
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
OSVRHSA-2021:3076 7.5

Red Hat Security Advisory: go-toolset:rhel8 security, bug fix, and enhancement update

Record
RHSA-2021:3076
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
OSVRHSA-2021:3555 7.5

Red Hat Security Advisory: Release of OpenShift Serverless Client kn 1.17.0

Record
RHSA-2021:3555
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
OSVRLSA-2021:3076 7.5

Moderate: go-toolset:rhel8 security, bug fix, and enhancement update

Go Toolset provides the Go programming language tools and libraries. Go is alternatively known as golang.

The following packages have been upgraded to a later upstream version: golang (1.15.14). (BZ#1982287)

Security Fix(es):

  • golang: encoding/xml: infinite loop when using xml.NewTokenDecoder with a custom TokenReader (CVE-2021-27918)

  • golang: net/http: panic in ReadRequest and ReadResponse when reading a very large header (CVE-2021-31525)

  • golang: archive/zip: malformed archive may cause panic or memory exhaustion (CVE-2021-33196)

  • golang: crypto/tls: certificate of wrong type is causing TLS client to panic (CVE-2021-34558)

For more details about the security issue(s), including the impact, a CVSS score, acknowledgments, and other related information, refer to the CVE page(s) listed in the References section.

Bug Fix(es):

  • FIPS mode AES CBC CryptBlocks incorrectly re-initializes IV in file crypto/internal/boring/aes.go (BZ#1978567)

  • FIPS mode AES CBC Decrypter produces incorrect result (BZ#1983976)

Record
RLSA-2021:3076
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
OSVUBUNTU-CVE-2021-27918 7.5

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.

Record
UBUNTU-CVE-2021-27918
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
OSVBIT-golang-2021-27918 No score

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.

Record
BIT-golang-2021-27918
Updated
2026-11-02
OSVGO-2021-0234 No score

Infinite loop when decoding inputs in encoding/xml

The Decode, DecodeElement, and Skip methods of an xml.Decoder provided by xml.NewTokenDecoder may enter an infinite loop when operating on a custom xml.TokenReader which returns an EOF in the middle of an open XML element.

Record
GO-2021-0234
Updated
2026-11-02
OSVMGASA-2021-0369 No score

Updated golang packages fix security vulnerabilities

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 (CVE-2021-27918).

net/http in Go before 1.15.12 and 1.16.x before 1.16.4 allows remote attackers to cause a denial of service (panic) via a large header to ReadRequest or ReadResponse. Server, Transport, and Client can each be affected in some configurations (CVE-2021-31525).

A security issue has been found in Go before version 1.16.5. The LookupCNAME, LookupSRV, LookupMX, LookupNS, and LookupAddr functions in net, and their respective methods on the Resolver type may return arbitrary values retrieved from DNS which do not follow the established RFC 1035 rules for domain names. If these names are used without further sanitization, for instance unsafely included in HTML, they may allow for injection of unexpected content. Note that LookupTXT may still return arbitrary values that could require sanitization before further use (CVE-2021-33195).

A security issue has been found in Go. Due to a pre-allocation optimization in zip.NewReader, a malformed archive which indicates it has a significant number of files can cause either a panic or memory exhaustion (CVE-2021-33196).

ReverseProxy fails to delete the Connection headers (as well as other legacy hop-by-hop headers, which however per RFC 7230 need to also be specified in Connection) if there are multiple ones and the first is empty, due to an incorrect Get(h) == "" check. This can lead to a security issue if the proxy is adding an important header, like X-Forwarded-For, and is sitting in front of another proxy which can be instructed by an attacker to drop that header as a hop-by-hop header (CVE-2021-33197).

A security issue has been found in Go before version 1.16.5. The SetString and UnmarshalText methods of math/big.Rat may cause a panic or an unrecoverable fatal error if passed inputs with very large exponents (CVE-2021-33198).

The crypto/tls package of Go through 1.16.5 does not properly assert that the type of public key in an X.509 certificate matches the expected type when doing a RSA based key exchange, allowing a malicious TLS server to cause a TLS client to panic (CVE-2021-34558).

Record
MGASA-2021-0369
Updated
2026-11-02
OSVopenSUSE-SU-2021:0480-1 No score

Security update for go1.15

This update for go1.15 fixes the following issues:

  • go1.15.10 (released 2021-03-11) (bsc#1175132)
  • go1.15.9 (released 2021-03-10) (bsc#1175132)
    • CVE-2021-27918: Fixed an infinite loop when using xml.NewTokenDecoder with a custom TokenReader (bsc#1183333).

This update was imported from the SUSE:SLE-15:Update update project.

Record
openSUSE-SU-2021:0480-1
Updated
2026-11-02
OSVopenSUSE-SU-2024:10808-1 No score

go1.15-1.15.15-1.2 on GA media

These are all security issues fixed in the go1.15-1.15.15-1.2 package on the GA media of openSUSE Tumbleweed.

Record
openSUSE-SU-2024:10808-1
Updated
2026-11-02
OSVopenSUSE-SU-2024:10809-1 No score

go1.16-1.16.8-1.1 on GA media

These are all security issues fixed in the go1.16-1.16.8-1.1 package on the GA media of openSUSE Tumbleweed.

Record
openSUSE-SU-2024:10809-1
Updated
2026-11-02
OSVSUSE-SU-2021:0937-1 No score

Security update for go1.16

This update for go1.16 fixes the following issues:

  • go1.16.2 (released 2021-03-11) (bsc#1182345)
  • go1.16.1 (released 2021-03-10) (bsc#1182345)
    • CVE-2021-27918: Fixed an infinite loop when using xml.NewTokenDecoder with a custom TokenReader (bsc#1183333).
    • CVE-2021-27919: Fixed an issue where archive/zip: can panic when calling Reader.Open (bsc#1183334).
Record
SUSE-SU-2021:0937-1
Updated
2026-11-02
OSVSUSE-SU-2021:0938-1 No score

Security update for go1.15

This update for go1.15 fixes the following issues:

  • go1.15.10 (released 2021-03-11) (bsc#1175132)
  • go1.15.9 (released 2021-03-10) (bsc#1175132)
    • CVE-2021-27918: Fixed an infinite loop when using xml.NewTokenDecoder with a custom TokenReader (bsc#1183333).
Record
SUSE-SU-2021:0938-1
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
go
Alpine:v3.13
1.16.0 up to 1.15.10-r0
1.15.10-r0
go
Alpine:v3.14
1.16.0 up to 1.16.2-r0
1.16.2-r0
go
Alpine:v3.15
1.16.0 up to 1.16.2-r0
1.16.2-r0
go
Alpine:v3.16
1.16.0 up to 1.16.2-r0
1.16.2-r0
go
Alpine:v3.17
1.16.0 up to 1.16.2-r0
1.16.2-r0
go
Alpine:v3.18
1.16.0 up to 1.16.2-r0
1.16.2-r0
go
Alpine:v3.19
1.16.0 up to 1.16.2-r0
1.16.2-r0
go
Alpine:v3.20
1.16.0 up to 1.16.2-r0
1.16.2-r0
go
Alpine:v3.21
1.16.0 up to 1.16.2-r0
1.16.2-r0
go
Alpine:v3.22
1.16.0 up to 1.16.2-r0
1.16.2-r0
Show 50 moreShow less
Affected packages
PackageAffectedFixed
go
Alpine:v3.23
1.16.0 up to 1.16.2-r0
1.16.2-r0
go
Alpine:v3.24
1.16.0 up to 1.16.2-r0
1.16.2-r0
golang
Azure Linux:3
through 1.26.10-1 None known
golang
Azure Linux:3
1.27.0 to 1.27.1-1 None known
golang
Bitnami
before 1.15.9, 1.16.0 up to 1.16.1
1.15.91.16.1
golang-1.15
Debian:11
before 1.15.9-1
1.15.9-1
stdlib
Go
before 1.15.9, 1.16.0-0 up to 1.16.1
1.15.91.16.1
golang
Mageia:8
before 1.15.14-1.mga8
1.15.14-1.mga8
golang
openEuler:20.03-LTS-SP1
before 1.15.7-3.oe1
1.15.7-3.oe1
openshift-serverless-clients
Red Hat:serverless:1.0::el8
before 0:0.22.0-3.el8
0:0.22.0-3.el8
delve
Red Hat:enterprise_linux:8::appstream
before 0:1.5.0-2.module+el8.4.0+8864+58b0fcdb
0:1.5.0-2.module+el8.4.0+8864+58b0fcdb
delve-debuginfo
Red Hat:enterprise_linux:8::appstream
before 0:1.5.0-2.module+el8.4.0+8864+58b0fcdb
0:1.5.0-2.module+el8.4.0+8864+58b0fcdb
delve-debugsource
Red Hat:enterprise_linux:8::appstream
before 0:1.5.0-2.module+el8.4.0+8864+58b0fcdb
0:1.5.0-2.module+el8.4.0+8864+58b0fcdb
go-toolset
Red Hat:enterprise_linux:8::appstream
before 0:1.15.14-1.module+el8.4.0+11833+614b07b8
0:1.15.14-1.module+el8.4.0+11833+614b07b8
golang
Red Hat:enterprise_linux:8::appstream
before 0:1.15.14-1.module+el8.4.0+11833+614b07b8
0:1.15.14-1.module+el8.4.0+11833+614b07b8
golang-bin
Red Hat:enterprise_linux:8::appstream
before 0:1.15.14-1.module+el8.4.0+11833+614b07b8
0:1.15.14-1.module+el8.4.0+11833+614b07b8
golang-docs
Red Hat:enterprise_linux:8::appstream
before 0:1.15.14-1.module+el8.4.0+11833+614b07b8
0:1.15.14-1.module+el8.4.0+11833+614b07b8
golang-misc
Red Hat:enterprise_linux:8::appstream
before 0:1.15.14-1.module+el8.4.0+11833+614b07b8
0:1.15.14-1.module+el8.4.0+11833+614b07b8
golang-race
Red Hat:enterprise_linux:8::appstream
before 0:1.15.14-1.module+el8.4.0+11833+614b07b8
0:1.15.14-1.module+el8.4.0+11833+614b07b8
golang-src
Red Hat:enterprise_linux:8::appstream
before 0:1.15.14-1.module+el8.4.0+11833+614b07b8
0:1.15.14-1.module+el8.4.0+11833+614b07b8
golang-tests
Red Hat:enterprise_linux:8::appstream
before 0:1.15.14-1.module+el8.4.0+11833+614b07b8
0:1.15.14-1.module+el8.4.0+11833+614b07b8
openshift-serverless-clients
Red Hat:serverless:1.0::el8
before 0:0.23.2-1.el8
0:0.23.2-1.el8
delve
Rocky Linux:8
before 0:1.5.0-2.module+el8.4.0+396+d2d16ae3
0:1.5.0-2.module+el8.4.0+396+d2d16ae3
golang
Rocky Linux:8
before 0:1.15.14-1.module+el8.4.0+632+4dba2916
0:1.15.14-1.module+el8.4.0+632+4dba2916
go-toolset
Rocky Linux:8
before 0:1.15.14-1.module+el8.4.0+632+4dba2916
0:1.15.14-1.module+el8.4.0+632+4dba2916
go1.16
SUSE:Linux Enterprise Module for Development Tools 15 SP2
before 1.16.2-1.8.1
1.16.2-1.8.1
go1.15
SUSE:Linux Enterprise Module for Development Tools 15 SP2
before 1.15.10-1.25.1
1.15.10-1.25.1
go1.15
SUSE:Linux Enterprise High Performance Computing 15 SP1-ESPOS
before 1.15.10-1.25.1
1.15.10-1.25.1
go1.15
SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSS
before 1.15.10-1.25.1
1.15.10-1.25.1
go1.15
SUSE:Linux Enterprise Server 15 SP1-BCL
before 1.15.10-1.25.1
1.15.10-1.25.1
go1.15
SUSE:Linux Enterprise Server 15 SP1-LTSS
before 1.15.10-1.25.1
1.15.10-1.25.1
go1.15
SUSE:Linux Enterprise Server for SAP Applications 15 SP1
before 1.15.10-1.25.1
1.15.10-1.25.1
go1.15
SUSE:Manager Proxy 4.0
before 1.15.10-1.25.1
1.15.10-1.25.1
go1.15
SUSE:Manager Retail Branch Server 4.0
before 1.15.10-1.25.1
1.15.10-1.25.1
go1.15
SUSE:Manager Server 4.0
before 1.15.10-1.25.1
1.15.10-1.25.1
go1.15
SUSE:Enterprise Storage 6
before 1.15.10-1.25.1
1.15.10-1.25.1
golang-1.10
Ubuntu:14.04:LTS
All versions, plus listed versions
1.10.4-2ubuntu1~14.04.1
None known
golang-1.10
Ubuntu:16.04:LTS
All versions, plus listed versions
1.10.4-2ubuntu1~16.04.11.10.4-2ubuntu1~16.04.2
None known
golang-1.6
Ubuntu:16.04:LTS
All versions, plus listed versions
1.6-0ubuntu11.6-0ubuntu21.6-0ubuntu31.6-0ubuntu41.6-0ubuntu5
Show 5 moreShow less
1.6.1-0ubuntu11.6.2-0ubuntu5~16.041.6.2-0ubuntu5~16.04.21.6.2-0ubuntu5~16.04.31.6.2-0ubuntu5~16.04.4
None known
golang-1.13
Ubuntu:Pro:16.04:LTS
All versions, plus listed versions
1.13.8-1ubuntu1~16.04.21.13.8-1ubuntu1~16.04.31.13.8-1ubuntu1~16.04.3+esm21.13.8-1ubuntu1~16.04.3+esm3
None known
golang-1.10
Ubuntu:18.04:LTS
All versions, plus listed versions
1.10~rc1-11.10~rc1-1ubuntu11.10~rc1-2ubuntu11.10~rc2-1ubuntu11.10-1ubuntu11.10.1-1ubuntu21.10.4-2ubuntu1~18.04.11.10.4-2ubuntu1~18.04.2
None known
golang-1.13
Ubuntu:Pro:18.04:LTS
All versions, plus listed versions
1.13.8-1ubuntu1~18.04.21.13.8-1ubuntu1~18.04.31.13.8-1ubuntu1~18.04.41.13.8-1ubuntu1~18.04.4+esm1
None known
golang-1.8
Ubuntu:18.04:LTS
All versions, plus listed versions
1.8.3-2ubuntu11.8.3-2ubuntu1.18.04.1
None known
golang-1.9
Ubuntu:18.04:LTS
All versions, plus listed versions
1.9.1-2ubuntu11.9.2-1ubuntu11.9.2-3ubuntu11.9.3-1ubuntu11.9.4-1ubuntu1
None known
golang-1.13
Ubuntu:20.04:LTS
All versions, plus listed versions
1.13.1-1ubuntu11.13.3-1ubuntu11.13.4-1ubuntu11.13.5-1ubuntu11.13.6-1ubuntu1
Show 5 moreShow less
1.13.6-2ubuntu11.13.7-1ubuntu11.13.8-1ubuntu11.13.8-1ubuntu1.11.13.8-1ubuntu1.2
None known
golang-1.14
Ubuntu:20.04:LTS
All versions, plus listed versions
1.14~beta1-11.14~beta1-21.14~rc1-11.14-11.14.1-1
Show 4 moreShow less
1.14.2-11.14.2-1ubuntu11.14.3-2ubuntu2~20.04.11.14.3-2ubuntu2~20.04.2
None known
golang-1.13
Ubuntu:Pro:22.04:LTS
All versions, plus listed versions
1.13.8-1ubuntu21.13.8-1ubuntu2.22.04.11.13.8-1ubuntu2.22.04.1+esm11.13.8-1ubuntu2.22.04.2
None known
go1.15
openSUSE:Leap 15.2
before 1.15.10-lp152.14.1
1.15.10-lp152.14.1
go1.15
openSUSE:Tumbleweed
before 1.15.15-1.2
1.15.15-1.2
go1.16
openSUSE:Tumbleweed
before 1.16.8-1.1
1.16.8-1.1

History

History
RecordedChangedSources
affected, aliases, referencesOSV
aliasesEUVD
first indexedCVE List, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2021-27918 is a high vulnerability (CVSS 7.5) in Golang Go, published March 10, 2021. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 2.47%, the 84th percentile. Fixed in go 1.15.10-r0.

References

Show 84 moreShow less
MoveEnter Open