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-104633 Overview
CVE-2026-104633 is a denial-of-service vulnerability in Gitea's repository migration feature. When migrating a repository from another Gitea instance, the destination server trusted the max_response_items value reported by the source server's API settings to terminate paginated downloads. A malicious source server returning max_response_items as 0 caused the migration loops to run indefinitely, consuming server memory until exhaustion. Any authenticated user with permission to migrate repositories can trigger the condition by pointing a migration at an attacker-controlled Gitea server. The flaw is tracked as CWE-400: Uncontrolled Resource Consumption and was addressed in Gitea 28.1.0.
Critical Impact
An authenticated user can exhaust server memory on any Gitea instance that permits repository migration, resulting in service outage.
Affected Products
- Gitea self-hosted Git service (versions prior to 28.1.0)
- Gitea instances exposing repository migration to authenticated users
- Gitea deployments permitting migrations from arbitrary remote sources
Discovery Timeline
- 2026-10-06 - CVE-2026-104633 published to NVD
- 2026-10-07 - Last updated in NVD database
Technical Details for CVE-2026-104633
Vulnerability Analysis
Gitea's migration subsystem downloads repository metadata (issues, pull requests, comments, labels, releases) from a source Gitea instance using paginated API calls. The loop that iterates through pages uses the source server's advertised max_response_items value as the page size and as the termination signal.
When the source server reports max_response_items as 0, the pagination loop never receives a short page indicating end-of-data. Each iteration appends new objects to in-memory collections without bound. Memory consumption grows until the Go runtime cannot allocate further, at which point the Gitea process is terminated by the operating system or becomes unresponsive to legitimate requests.
The fix in Pull Request #39501 and Pull Request #39507 replaces reliance on the remote-reported page size with a sanity-checked local value and adds proper termination conditions.
Root Cause
The root cause is misplaced trust in attacker-controlled input used as a loop boundary. Gitea treated the source instance's /api/v1/settings/api response as authoritative without validating that max_response_items was a positive integer. A value of 0 created an infinite loop with unbounded memory growth, satisfying the pattern of CWE-400 resource exhaustion.
Attack Vector
An authenticated user with migration privileges on a target Gitea instance initiates a repository migration pointing at a hostile Gitea server under their control. The malicious source server responds to the API settings query with max_response_items: 0. The target Gitea process begins the migration, enters the unbounded pagination loop, and consumes memory until the service degrades or crashes. Repeated migrations amplify the impact across the instance.
See the GitHub Security Advisory GHSA-jj5r-9rpc-8h6h for complete technical details.
Detection Methods for CVE-2026-104633
Indicators of Compromise
- Sustained memory growth of the Gitea process coinciding with an active repository migration task
- Outbound HTTP requests from the Gitea server to unfamiliar remote Gitea instances during migration jobs
- Gitea worker processes terminated by the Linux Out-Of-Memory killer (OOM) shortly after a user-initiated migration
- Repeated migration attempts in Gitea audit logs targeting the same external host
Detection Strategies
- Alert on Gitea process resident memory exceeding a baseline threshold (for example, 2x normal working set) during migration operations
- Correlate migration API calls (/repo/migrate) with memory and CPU anomalies on the host
- Review gitea.log for migration tasks that run abnormally long or produce no completion event
Monitoring Recommendations
- Collect Gitea application logs and host-level process metrics into a centralized SIEM or data lake for correlation
- Monitor egress traffic from Gitea servers for connections to untrusted Git hosting endpoints
- Track per-user migration frequency and flag accounts initiating migrations against previously unseen remote hosts
How to Mitigate CVE-2026-104633
Immediate Actions Required
- Upgrade Gitea to version 28.1.0 or later, which contains the fix from Pull Request #39501 and Pull Request #39507
- Restrict repository migration to trusted user groups by adjusting [repository] permissions in app.ini until patching is complete
- Review recent migration jobs for connections to unknown remote hosts and terminate any long-running tasks
Patch Information
The vulnerability is fixed in Gitea v28.1.0. See the Gitea 28.1.0 release announcement for the full changelog. Administrators running earlier branches should upgrade to this release.
Workarounds
- Disable repository migration from remote sources by setting DISABLE_MIGRATIONS = true or restricting ALLOWED_DOMAINS in the [migrations] section of app.ini
- Apply an outbound egress allowlist to limit the Gitea server to known trusted Git hosts
- Enforce per-process memory limits via systemd (MemoryMax=) or container runtime controls so a runaway migration cannot destabilize the host
# Configuration example: restrict migrations in app.ini
[migrations]
ALLOWED_DOMAINS = github.com,gitlab.com,trusted-internal.example
BLOCKED_DOMAINS =
ALLOW_LOCALNETWORKS = false
[repository]
DISABLE_MIGRATIONS = false
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

