What’s Vulnerable › Vulnerabilities
CVE-2021-38561: Out-of-bounds read in golang.org/x/text/language
- Severity: high (CVSS 7.5 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 1.5% probability of exploitation in the next 30 days
- Public exploit or detection template: none known
- Published: 2022-12-26 · updated 2026-06-17
- Weakness: CWE-125
Description
golang.org/x/text/language in golang.org/x/text before 0.3.7 can panic with an out-of-bounds read during BCP 47 language tag parsing. Index calculation is mishandled. If parsing untrusted user input, this can be used as a vector for a denial-of-service attack.
Affected products
- golang.org/x/text/language: before 0.3.7 — fixed in 0.3.7
- Golang.Org/X/Text: before 0.3.7 — fixed in 0.3.7
How to fix
Upgrade to a fixed version: golang.org/x/text/language 0.3.7; Golang.Org/X/Text 0.3.7. Check the vendor advisory for mitigations.
References
- https://deps.dev/advisory/OSV/GO-2021-0113
- https://go.googlesource.com/text/+/383b2e75a7a4198c42f8f87833eefb772868a56f
- https://groups.google.com/g/golang-announce
- https://pkg.go.dev/golang.org/x/text/language
- https://deps.dev/advisory/OSV/GO-2021-0113
- https://go.googlesource.com/text/+/383b2e75a7a4198c42f8f87833eefb772868a56f
- https://groups.google.com/g/golang-announce
- https://pkg.go.dev/golang.org/x/text/language
Get alerted when CVE-2021-38561 or the next vulnerability affects your stack