Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-96399 Overview
CVE-2026-96399 is a denial-of-service vulnerability in Gitea's issue reference rendering. A repository's external issue tracker regular expression containing alternating capture groups can produce invalid slice indexes when Gitea renders issue references. The resulting runtime panic terminates the Gitea process. A user who can edit a repository's external issue tracker settings can poison any later rendering of matching content, such as viewing a README, to crash the instance for every user. The flaw is tracked under GHSA-mw6q-qj47-9g5q and fixed in Gitea v28.0.0.
Critical Impact
A single repository administrator can crash the entire Gitea instance for all users by configuring a crafted external issue tracker regex.
Affected Products
- Gitea self-hosted Git service (versions prior to v28.0.0)
- Gitea deployments exposing external issue tracker configuration to repository administrators
- Multi-tenant Gitea instances where repository settings are delegated to end users
Discovery Timeline
- 2026-10-06 - CVE-2026-96399 published to NVD
- 2026-10-07 - Last updated in NVD database
Technical Details for CVE-2026-96399
Vulnerability Analysis
The vulnerability is classified as an out-of-bounds read [CWE-125] triggered during Markdown and content rendering. Gitea allows repository administrators to configure an external issue tracker with a user-supplied regular expression. The renderer uses that regex to locate and rewrite issue references in rendered content.
When the configured regex contains alternating capture groups, the submatch index returned by the Go regexp engine can include negative or non-matching positions. Gitea's rendering code uses those indexes to slice the underlying byte string without validating that the submatch participated in the match. The invalid slice bounds trigger a runtime panic that terminates the process. Because Gitea runs as a single long-lived process, the panic takes the entire instance offline until it is restarted.
Root Cause
The root cause is missing bounds validation on regex submatch indexes before using them as slice offsets. In Go's regexp package, capture groups that do not participate in a successful match return -1 for their start and end positions. The rendering path assumed every group index was valid, producing an out-of-bounds slice operation when alternation left one branch unmatched.
Attack Vector
Exploitation requires authenticated access with permission to edit a repository's external issue tracker settings. The attacker configures a regex that includes alternating capture groups, such as a pattern of the form (foo)|(bar). Any subsequent rendering of content containing text that matches either branch, including README files, issues, pull requests, or wiki pages, invokes the vulnerable code path. The resulting panic crashes the Gitea server for every connected user, producing a persistent denial of service that recurs each time matching content is rendered after restart. See the upstream fix in pull request 39354 for the corrected submatch handling.
Detection Methods for CVE-2026-96399
Indicators of Compromise
- Unexpected Gitea process termination accompanied by Go runtime panic traces referencing slice bounds out of range in rendering or Markdown packages
- Repository configuration audit entries showing recent changes to external issue tracker regex fields
- Repeated crash-restart cycles correlated with user navigation to specific repositories or README views
Detection Strategies
- Parse Gitea stderr and systemd journal logs for runtime error: slice bounds out of range panics originating from issue reference rendering
- Alert on repository settings changes where the external issue tracker regex contains the alternation operator | combined with multiple capture groups
- Correlate Gitea service restarts with the user account that most recently modified external issue tracker configuration
Monitoring Recommendations
- Monitor service uptime and restart frequency for Gitea instances through process supervisors or container orchestrators
- Enable audit logging on repository configuration changes and route events to a central log store for review
- Track HTTP 5xx response rates and connection resets at the reverse proxy fronting Gitea as early indicators of panic-driven outages
How to Mitigate CVE-2026-96399
Immediate Actions Required
- Upgrade all Gitea instances to v28.0.0 or later, which contains the fix from pull request 39354
- Review existing repositories for external issue tracker regexes containing alternation and capture groups and remove or rewrite them
- Restrict repository administrator privileges to trusted users on multi-tenant instances pending the upgrade
Patch Information
Gitea addressed the vulnerability in release v28.0.0. The fix validates regex submatch indexes before using them as slice offsets, preventing the out-of-bounds read. Release details are available in the Gitea 28.0.0 announcement and the GitHub Security Advisory GHSA-mw6q-qj47-9g5q.
Workarounds
- Clear the external issue tracker regex field on repositories where it is not required
- Audit and replace alternation-based patterns with non-alternating equivalents, for example using character classes or a single capture group
- Place Gitea behind a process supervisor that automatically restarts the service to shorten outage windows until patching is complete
# Verify running Gitea version and confirm upgrade to v28.0.0 or later
gitea --version
# Example safer external issue tracker regex (single capture group, no alternation)
# Original risky pattern: (ISSUE-\d+)|(BUG-\d+)
# Replacement: (ISSUE-\d+|BUG-\d+)
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

