CVE-2022-32149: Denial of service via crafted Accept-Language header in golang.org/x/text/language
A vulnerability was found in golang.org/x/text/language package which could cause a denial of service. An attacker can craft an Accept-Language header which ParseAcceptLanguage will take significant time to parse. Version v0.3.8 of golang.org/x/text fixes a vulnerability.
References: https://groups.google.com/g/golang-dev/c/qfPIly0X7aU. https://go.dev/issue/56152.
Upstream Commit: https://github.com/golang/text/commit/434eadcdbc3b0256971992e8c70027278364c72c
Other sources
A vulnerability was found in the golang.org/x/text/language package. An attacker can craft an Accept-Language header which ParseAcceptLanguage will take significant time to parse. This issue leads to a denial of service, and can impact availability.
An attacker may cause a denial of service by crafting an Accept-Language header which ParseAcceptLanguage will take significant time to parse.
Denial of service via crafted Accept-Language header in golang.org/x/text/language
— Microsoft
Golang Go is vulnerable to a denial of service, caused by improper input validation by the golang.org/x/text/language package. By sending a specially-crafted Accept-Language header, a remote attacker could exploit this vulnerability to cause ParseAcceptLanguage to take significant time to parse, and results in a denial of service condition.
— IBM
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
— GitHub
Affected Software
Event History
Parent advisories
This vulnerability appears in the following advisories.
Frequently Asked Questions
What is CVE-2022-32149?
CVE-2022-32149 is a vulnerability that allows an attacker to cause a denial of service (DoS) by crafting an Accept-Language header.
What is the severity of CVE-2022-32149?
CVE-2022-32149 has a severity rating of 7.5 (High).
Which software packages are affected by CVE-2022-32149?
The software packages affected by CVE-2022-32149 include golang.org/x/text, podman, and kubevirt.
How can an attacker exploit CVE-2022-32149?
An attacker can exploit CVE-2022-32149 by leveraging the quadratic time complexity of the BCP 47 tag parser to force a program to consume significant time parsing Accept-Language headers.
How can I fix CVE-2022-32149?
To fix CVE-2022-32149, it is recommended to update the affected software packages to the latest versions provided by the vendors.