PT-2026-63302 · Gitea · Gitea
CVE-2026-58436
·
Published
2026-07-21
·
Updated
2026-07-22
CVSS v4.0
8.7
High
| Vector | AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N |
Name of the Vulnerable Software and Affected Versions
code.gitea.io/gitea versions 1.22.x through 1.26.x
Description
The Locale middleware, which processes every unauthenticated request, is susceptible to a Denial of Service (DoS) attack. The issue occurs when the middleware calls
language.ParseAcceptLanguage() on the raw Accept-Language HTTP header without implementing size or shape filters. While a previous guard limits the number of - characters, it fails to account for characters, which the internal scanner aliases to - before parsing.An unauthenticated attacker can send a request with a large
Accept-Language header (up to 1 MiB) containing numerous separators. This triggers quadratic-time behavior in the parser's internal scanner, causing significant CPU exhaustion. For example, a single request can consume approximately 2 seconds of server CPU, and a small number of concurrent attackers can saturate a multi-core server.Recommendations
For code.gitea.io/gitea versions 1.22.x through 1.26.x, implement a size or character-class filter on the
Accept-Language header before it is passed to the language.ParseAcceptLanguage() function to ensure the total count of - and characters does not exceed a reasonable limit (e.g., 32).Fix
DoS
Found an issue in the description? Have something to add? Feel free to write us 👾
Related Identifiers
Affected Products
Gitea