CVE-2021-27918
JSON

7.5high

Infinite loop when decoding inputs in encoding/xml

Severity
7.5high CVSS:3.1 by NVD
Exploit likelihood
2.47% (higher than 84% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
mitre
Also known as
GO-2021-0234BIT-GOLANG-2021-27918

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.

Affected

Product or packageVersionsReported by
Unspecified productn/aCVE List
stdlib (Go)before 1.15.9, from 1.16.0-0 before 1.16.1Go Vulnerability Database
golang gobefore 1.15.9, from 1.16.0 before 1.16.1NVD
golang (Bitnami)before 1.15.9, from 1.16.0 before 1.16.1Bitnami Vulnerability Database

All scores

NVD7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
NVD5.0medium CVSS:2.0AV:N/AC:L/Au:N/C:N/I:N/A:P
Bitnami Vulnerability Databasehigh rating

Classification

What each source says

CVE List

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.

Go Vulnerability Database

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.

NVD (es)

encoding/xml en Go versiones anteriores a 1.15.9 y versiones 1.16.x anteriores a 1.16.1, presenta un bucle infinito si un TokenReader personalizado (para xml.NewTokenDecoder) devuelve EOF en medio de un elemento. Esto puede ocurrir en el método Decode, DecodeElement o Skip

References

Sources

SourceRecordLicence
CVE ListCVE-2021-27918 changed 2024-08-03CVE Terms of Use
Go Vulnerability DatabaseGO-2021-0234 changed 2024-05-20CC-BY-4.0
NVDCVE-2021-27918 changed 2026-06-17Public domain
Bitnami Vulnerability DatabaseBIT-GOLANG-2021-27918 changed 2026-09-08Apache-2.0