GitHub Advisoryadvisory · Go

GHSA-69ch-w2m2-3vjp golang.org/x/text/language Denial of service via crafted Accept-Language header

HIGH Published 2022-10-14 Modified 2025-05-16 Official page ↗
Aliases
CVE-2022-32149
Ecosystem
Go
Packages
golang.org/x/text
Severity
High
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weaknesses
CWE-772
Reviewed
2022-10-28

Affected packages

• Go golang.org/x/text: < 0.3.8 → fixed in 0.3.8

Description

The BCP 47 tag parser has quadratic time complexity due to inherent aspects of its design. Since the parser is, by design, exposed to untrusted user input, this can be leveraged to force a program to consume significant time parsing Accept-Language headers. The parser cannot be easily rewritten to fix this behavior for various reasons. Instead the solution implemented in this CL is to limit the total complexity of tags passed into ParseAcceptLanguage by limiting the number of dashes in the string to 1000. This should be more than enough for the majority of real world use cases, where the number of tags being sent is likely to be in the single digits. Specific Go Packages Affected golang.org/x/text/language

Related

Alias · CVE (1)

  • CVE-2022-32149 An attacker may cause a denial of service by crafting an Accept-Language header which ParseAcceptLanguage will take significant time to… vulnerability

Weakness · CWE (1)

  • CWE-772 Missing Release of Resource after Effective Lifetime weakness

References