Skip to main content

CVE-2021-38561 — Vulnerability in golang.org/x/text — CVE Details

HIGH

golang.org/x/text/language Out-of-bounds Read vulnerability

Published December 26, 2022Updated September 10, 2026Source: OSV

What Should I Do?

Address in Next Maintenance Window

Low exploitation probability (1.48%). Schedule for your next planned update.

Does your project use an affected golang.org/x/text version?

Paste your go.sum to check it for CVE-2021-38561 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.

Check my go.sum

Summary

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.

Advisory Timeline

  • First published December 26, 2022 (1431 days ago).
  • Last revised September 10, 2026 — 1354 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

Go
Update golang.org/x/text to 0.3.7 or later
go get golang.org/x/text@v0.3.7

After upgrading, scan your dependencies again to confirm the vulnerability is resolved.

Affected Packages (1)

Affects 1 ecosystem: Go (1).

PackageFixed In
golang.org/x/text Go · Affected: All versions0.3.7

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

  • CWE-125
    Out-of-bounds ReadMITRE

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 7.5 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Frequently Asked Questions

What is CVE-2021-38561?
golang.org/x/text/language Out-of-bounds Read vulnerability. This vulnerability has been assigned a severity rating of HIGH (CVSS score: 7.5/10).
How do I check if my project is affected by CVE-2021-38561?
CVE-2021-38561 affects golang.org/x/text. It has a 1.5% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2021-38561 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
7.5

Significant impact if exploited, or exploitable with modest effort.

EPSS Score (30-day exploit probability)
1.48%
EPSS percentile: 74.2

This is an above-median EPSS score — 74.2% of tracked vulnerabilities score at or below it, putting its exploitation likelihood in the upper half of the tracked corpus.

Also Known As

GHSA-ppp9-7jff-5vj2
GO-2021-0113

Related CVEs

  • CVE-2022-27664
    HIGH

    golang.org/x/net/http2 Denial of Service vulnerability

  • CVE-2022-32149
    HIGH

    golang.org/x/text/language Denial of service via crafted Accept-Language header

  • CVE-2020-14040
    MEDIUM

    golang.org/x/text Infinite loop

  • CVE-2020-14040

    Infinite loop when decoding some inputs in golang.org/x/text

  • CVE-2022-32149

    Denial of service via crafted Accept-Language header in golang.org/x/text/language

  • GO-2026-5932

    The golang.org/x/crypto/openpgp package is unmaintained, unsafe by design, and has known security issues

  • CVE-2026-56852

    Infinite loop on invalid input in golang.org/x/text

  • CVE-2026-56851

    Panic parsing crafted input in x/text/secure/precis in golang.org/x/text

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my go.sum