Gitea: Unauthenticated ReDoS via CODEOWNERS pattern matching allows denial of service (CVE-2026-58421)
Gitea versions prior to 1.26.4 contain a vulnerability in the CODEOWNERS feature where user-supplied regex patterns are compiled without sanitization or timeout, enabling a Regular Expression Denial of Service (ReDoS) attack. An attacker with a repository can craft malicious CODEOWNERS patterns and file names in pull requests that cause exponential regex backtracking, hanging the server during pull request processing. This results in database connections being held open, potentially exhausting the connection pool and making the Gitea instance unresponsive.
AI Analysis
Technical Summary
The vulnerability in Gitea's CODEOWNERS feature arises from the use of the regexp2 library to match file paths against ownership rules without sanitization or match timeouts. User-controlled regex patterns are compiled and matched against file paths during pull request creation inside a database transaction. Malicious patterns such as '(a+)+' cause catastrophic backtracking when matched against crafted file names, leading to prolonged processing times (e.g., ~30 seconds for 11 rules). This behavior can exhaust database connections when multiple pull requests are created in parallel, resulting in denial of service. The issue affects versions prior to 1.26.4 and requires only a registered user with a repository to exploit.
Potential Impact
The vulnerability allows an attacker to cause denial of service by exhausting database connection pools through long-running regex evaluations during pull request creation. This can make the entire Gitea instance unresponsive to all users. There is no impact on confidentiality or integrity, only availability is affected.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is available, restrict the ability of users to create or modify CODEOWNERS files with complex regex patterns or implement rate limiting on pull request creation to mitigate potential abuse. Monitor for updates from Gitea regarding an official fix.
Gitea: Unauthenticated ReDoS via CODEOWNERS pattern matching allows denial of service (CVE-2026-58421)
Description
Gitea versions prior to 1.26.4 contain a vulnerability in the CODEOWNERS feature where user-supplied regex patterns are compiled without sanitization or timeout, enabling a Regular Expression Denial of Service (ReDoS) attack. An attacker with a repository can craft malicious CODEOWNERS patterns and file names in pull requests that cause exponential regex backtracking, hanging the server during pull request processing. This results in database connections being held open, potentially exhausting the connection pool and making the Gitea instance unresponsive.
CVSS v3.1
Score 7.5high
Affected software
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability in Gitea's CODEOWNERS feature arises from the use of the regexp2 library to match file paths against ownership rules without sanitization or match timeouts. User-controlled regex patterns are compiled and matched against file paths during pull request creation inside a database transaction. Malicious patterns such as '(a+)+' cause catastrophic backtracking when matched against crafted file names, leading to prolonged processing times (e.g., ~30 seconds for 11 rules). This behavior can exhaust database connections when multiple pull requests are created in parallel, resulting in denial of service. The issue affects versions prior to 1.26.4 and requires only a registered user with a repository to exploit.
Potential Impact
The vulnerability allows an attacker to cause denial of service by exhausting database connection pools through long-running regex evaluations during pull request creation. This can make the entire Gitea instance unresponsive to all users. There is no impact on confidentiality or integrity, only availability is affected.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is available, restrict the ability of users to create or modify CODEOWNERS files with complex regex patterns or implement rate limiting on pull request creation to mitigate potential abuse. Monitor for updates from Gitea regarding an official fix.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- Gitea
- Date Reserved
- 2026-06-30T18:57:20.614Z
- Cvss Version
- 3.1
- State
- PUBLISHED
- Remediation Level
- null
- Gcve Source
- db.gcve.eu
Threat ID: 6a483c9d27e9c79719d7f5e0
Added to database: 07/03/2026, 22:50:05 UTC
Last enriched: 07/22/2026, 01:47:18 UTC
Last updated: 07/31/2026, 19:22:59 UTC
Views: 91
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.