Gitea: ParseAcceptLanguage quadratic-time DoS via Locale middleware on unauthenticated requests (CVE-2026-58436)
Gitea contains a denial-of-service vulnerability in its Locale middleware that processes the Accept-Language HTTP header on every unauthenticated request. The vulnerability arises because the middleware calls golang.org/x/text/language.ParseAcceptLanguage on unfiltered Accept-Language headers, which can contain a large number of underscore characters. The parser has quadratic-time complexity on such inputs, allowing attackers to cause high CPU usage and degrade service availability. This affects all Gitea versions prior to 1.27.0 that do not impose their own size limits on the Accept-Language header.
AI Analysis
Technical Summary
The Locale middleware in Gitea calls golang.org/x/text/language.ParseAcceptLanguage on the raw Accept-Language HTTP header without filtering. Although a previous fix (CVE-2022-32149) limits the number of '-' characters to 1000 to prevent quadratic-time parsing, it does not limit '_' characters, which the parser internally treats as '-'. An attacker can send a large Accept-Language header with many '_' separators, triggering quadratic-time parsing and causing high CPU usage. This unauthenticated denial-of-service vulnerability affects Gitea versions before 1.27.0 that do not apply size limits on the Accept-Language header. The vulnerability was verified on the official gitea/gitea:1.22.6 Docker image and the main branch code. The default Go HTTP server allows headers up to 1 MiB, enabling large malicious headers.
Potential Impact
An unauthenticated attacker can send a specially crafted Accept-Language header with many underscore separators to trigger quadratic-time parsing in Gitea's Locale middleware. This causes high CPU consumption (~2 seconds per request) and can saturate server CPU cores when multiple requests are sent concurrently, resulting in a denial-of-service condition. The attack requires no privileges and can affect the availability of Gitea instances running vulnerable versions.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is available, administrators should consider implementing size or character filtering on the Accept-Language header before it reaches the ParseAcceptLanguage function to mitigate the attack. Monitoring for unusually large or malformed Accept-Language headers and rate-limiting unauthenticated requests may also help reduce impact.
Gitea: ParseAcceptLanguage quadratic-time DoS via Locale middleware on unauthenticated requests (CVE-2026-58436)
Description
Gitea contains a denial-of-service vulnerability in its Locale middleware that processes the Accept-Language HTTP header on every unauthenticated request. The vulnerability arises because the middleware calls golang.org/x/text/language.ParseAcceptLanguage on unfiltered Accept-Language headers, which can contain a large number of underscore characters. The parser has quadratic-time complexity on such inputs, allowing attackers to cause high CPU usage and degrade service availability. This affects all Gitea versions prior to 1.27.0 that do not impose their own size limits on the Accept-Language header.
CVSS v4.0
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The Locale middleware in Gitea calls golang.org/x/text/language.ParseAcceptLanguage on the raw Accept-Language HTTP header without filtering. Although a previous fix (CVE-2022-32149) limits the number of '-' characters to 1000 to prevent quadratic-time parsing, it does not limit '_' characters, which the parser internally treats as '-'. An attacker can send a large Accept-Language header with many '_' separators, triggering quadratic-time parsing and causing high CPU usage. This unauthenticated denial-of-service vulnerability affects Gitea versions before 1.27.0 that do not apply size limits on the Accept-Language header. The vulnerability was verified on the official gitea/gitea:1.22.6 Docker image and the main branch code. The default Go HTTP server allows headers up to 1 MiB, enabling large malicious headers.
Potential Impact
An unauthenticated attacker can send a specially crafted Accept-Language header with many underscore separators to trigger quadratic-time parsing in Gitea's Locale middleware. This causes high CPU consumption (~2 seconds per request) and can saturate server CPU cores when multiple requests are sent concurrently, resulting in a denial-of-service condition. The attack requires no privileges and can affect the availability of Gitea instances running vulnerable versions.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is available, administrators should consider implementing size or character filtering on the Accept-Language header before it reaches the ParseAcceptLanguage function to mitigate the attack. Monitoring for unusually large or malformed Accept-Language headers and rate-limiting unauthenticated requests may also help reduce impact.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-fw57-jgch-pgf3
- Osv Schema Version
- 1.4.0
- Aliases
- ["CVE-2026-58436"]
- Ecosystems
- ["Go"]
- Database Specific Severity
- HIGH
- Cvss Version
- 4.0
Threat ID: 6a600ab09c2644c7f8fe1a40
Added to database: 07/22/2026, 00:11:28 UTC
Last enriched: 07/22/2026, 00:44:45 UTC
Last updated: 07/31/2026, 12:28:12 UTC
Views: 4
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.