Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

Gitea: ParseAcceptLanguage quadratic-time DoS via Locale middleware on unauthenticated requests (CVE-2026-58436)

0
High
Published: 07/21/2026 (07/21/2026, 21:15:47 UTC)
Source: GCVE Database
Product: code.gitea.io/gitea

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

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vuln. Confidentiality
None
Vuln. Integrity
None
Vuln. Availability
High
Subsq. Confidentiality
None
Subsq. Integrity
None
Subsq. Availability
None
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

Affected software

Goghsa
code.gitea.io/gitea
Affected versions
<1.27.0

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

AILast updated: 07/22/2026, 00:44:45 UTC

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.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

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 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses