Advisory

GHSA-69ch-w2m2-3vjp

Also known as: CVE-2022-32149, GO-2022-1059

Summary

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

Details

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

Severity

High Basis: The source's own band: HIGH

Dates

Published
2022-10-14 19:00 UTC
Modified
2026-09-10 03:49 UTC

Affected packages and fixes

golang.org/x/text

Go · All systems

Affected

  • introduced 0, fixed 0.3.8 (semver)

Fixed versions

0.3.8

Fix

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences