Skip to content

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

High severity GitHub Reviewed Published Oct 14, 2022 to the GitHub Advisory Database • Updated Oct 2, 2023

Package

gomod golang.org/x/text (Go)

Affected versions

< 0.3.8

Patched versions

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

References

Published by the National Vulnerability Database Oct 14, 2022
Published to the GitHub Advisory Database Oct 14, 2022
Reviewed Oct 28, 2022
Last updated Oct 2, 2023

Severity

High
7.5
/ 10

CVSS base metrics

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

Weaknesses

CVE ID

CVE-2022-32149

GHSA ID

GHSA-69ch-w2m2-3vjp

Source code

Credits

Checking history
See something to contribute? Suggest improvements for this vulnerability.