CVE-2021-27918Golang Go
High 7.5 No auth needed
Follow: this CVE · Golang · Golang Go We alert you by email or Slack (account required).
- Priority
- 60
- CVSS 3.1
- 7.5
- EPSS
- 2.5% probability of exploitation in 30 days · percentile 85
- Auth required
- No
- Published
- Mar 11, 2021
- Updated
- Jun 17, 2026
- Category
- Application · Cross-platform
- Weakness (CWE)
- CWE-835
- Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
What happens
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.
What to do
- Apply the vendor's security update for Go.
- It can be exploited without authentication: if you cannot patch now, restrict Internet access to the affected service.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | How to upgrade |
|---|---|---|---|---|
| Go | stdlib |
< 1.15.9 |
1.15.9 |
go get stdlib@v1.15.9 |
| Go | stdlib |
≥ 1.16.0-0 < 1.16.1 |
1.16.1 |
go get stdlib@v1.16.1 |
Per OSV / GitHub Advisories (GO-2021-0234). Check the version in your lockfile before upgrading.
Affected products (CPE)
| Vendor | Product | Versions |
|---|---|---|
| golang | go | < 1.15.9 |
| golang | go | ≥ 1.16.0 < 1.16.1 |
Official sources
References
Links published by the sources. Open them with care.
- groups.google.com Mailing List Third Party Advisory
- security.gentoo.org Third Party Advisory