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 package | Versions | Reported by |
|---|---|---|
| Unspecified product | n/a | CVE List |
| stdlib (Go) | before 1.15.9, from 1.16.0-0 before 1.16.1 | Go Vulnerability Database |
| golang go | before 1.15.9, from 1.16.0 before 1.16.1 | NVD |
| golang (Bitnami) | before 1.15.9, from 1.16.0 before 1.16.1 | Bitnami Vulnerability Database |
All scores
| NVD | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| NVD | 5.0medium CVSS:2.0 | AV:N/AC:L/Au:N/C:N/I:N/A:P |
| Bitnami Vulnerability Database | high 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
| https://groups.google.com/g/golang-announce/c/MfiLYjG-RAw | advisory, mailing-list, third-party-advisory, web | |
| https://security.gentoo.org/glsa/202208-02 | advisory, third-party-advisory, vendor-advisory | |
| https://go.dev/cl/300391 | fix | |
| https://go.googlesource.com/go/+/d0b79e3513a29628f3599dc8860666b6eed75372 | fix | |
| https://go.dev/issue/44913 | report | |
| https://nvd.nist.gov/vuln/detail/CVE-2021-27918 | web | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-27918 changed 2024-08-03 | CVE Terms of Use |
| Go Vulnerability Database | GO-2021-0234 changed 2024-05-20 | CC-BY-4.0 |
| NVD | CVE-2021-27918 changed 2026-06-17 | Public domain |
| Bitnami Vulnerability Database | BIT-GOLANG-2021-27918 changed 2026-09-08 | Apache-2.0 |