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-96400 Overview
CVE-2026-96400 is a Server-Side Request Forgery (SSRF) vulnerability [CWE-918] in Gitea's migration feature. When administrators configure [migrations] ALLOWED_DOMAINS with a wildcard entry such as * or a hostname wildcard, the URL validation logic permits requests to reserved and link-local addresses. This bypass works even when ALLOW_LOCALNETWORKS = false is explicitly set. The local-network block list fails to cover ranges like 169.254.0.0/16, and allow-listed hostnames are accepted without re-checking the resolved IP address. Authenticated users with permission to start migrations can reach cloud metadata endpoints such as 169.254.169.254 from the Gitea server.
Critical Impact
Authenticated attackers can leverage Gitea's migration function to query cloud metadata services and internal link-local addresses, potentially exposing credentials and sensitive configuration data from the host environment.
Affected Products
- Gitea instances prior to version 28.0.0
- Gitea deployments with [migrations] ALLOWED_DOMAINS configured with wildcard entries
- Gitea servers running in cloud environments (AWS, Azure, GCP) exposing Instance Metadata Services
Discovery Timeline
- 2026-10-06 - CVE-2026-96400 published to NVD
- 2026-10-07 - Last updated in NVD database
Technical Details for CVE-2026-96400
Vulnerability Analysis
The vulnerability stems from two independent flaws in Gitea's migration URL validation pipeline. First, the local-network block list omits reserved IPv4 ranges such as the link-local block 169.254.0.0/16. Second, when a hostname matches an entry in ALLOWED_DOMAINS, Gitea accepts the request without validating the resolved IP address against the local-network deny list.
This combination creates a classic SSRF primitive. An attacker-controlled hostname that matches the allow list, or any hostname when * is configured, can resolve to internal infrastructure. The resulting server-side HTTP request runs with the trust context of the Gitea process. In cloud deployments, this grants read access to the Instance Metadata Service (IMDS), including IAM credentials in environments where IMDSv1 is still accepted.
The default empty ALLOWED_DOMAINS configuration is not affected because no hostnames match the allow list.
Root Cause
The root cause is incomplete input validation in Gitea's migrations package. The IP range deny list did not enumerate all non-routable or reserved ranges defined by IANA. The allow-list check short-circuited the deny-list enforcement, treating hostname allow-listing as sufficient authorization rather than a necessary precondition that must still pass IP-level checks post-resolution.
Attack Vector
An authenticated user with migration privileges submits a repository migration request targeting a URL whose hostname matches the configured wildcard. The hostname resolves to a reserved address such as 169.254.169.254. Gitea's HTTP client then issues the request from the server, and the response body is processed as part of the migration workflow. See the GitHub Security Advisory GHSA-54w9-6cc5-9wj9 for additional technical context.
No verified exploit code is published for CVE-2026-96400. The Gitea Pull Request #39426 contains the upstream fix for the validation logic.
Detection Methods for CVE-2026-96400
Indicators of Compromise
- Outbound HTTP requests from the Gitea server process to 169.254.169.254, fd00::/8, or other link-local destinations.
- Migration tasks in Gitea logs referencing hostnames that resolve to RFC 3927 or RFC 6890 reserved address space.
- Unexpected access patterns against cloud Instance Metadata Service endpoints originating from the Gitea host.
- New or anomalous IAM credential usage tied to the Gitea instance role shortly after a migration event.
Detection Strategies
- Audit the [migrations] section of app.ini for ALLOWED_DOMAINS entries containing * or broad wildcards.
- Review Gitea application logs for migration jobs initiated by non-administrative accounts targeting unusual hostnames.
- Correlate Gitea process network telemetry with cloud provider audit logs to identify IMDS access events.
Monitoring Recommendations
- Instrument egress monitoring on the Gitea host to alert on connections to 169.254.0.0/16, 127.0.0.0/8, and private IPv4/IPv6 ranges.
- Enable cloud provider logging for IMDS access, such as AWS IMDSv2 enforcement metrics and CloudTrail credential-use events.
- Track migration task frequency per user to surface abuse patterns.
How to Mitigate CVE-2026-96400
Immediate Actions Required
- Upgrade Gitea to version 28.0.0 or later as announced in the Gitea 28.0.0 release.
- Remove wildcard entries from [migrations] ALLOWED_DOMAINS and restrict the allow list to specific hostnames that migrations legitimately require.
- Enforce IMDSv2 on cloud instances hosting Gitea to require session tokens for metadata access.
- Rotate any IAM credentials or secrets accessible to the Gitea instance if abuse is suspected.
Patch Information
Gitea version 28.0.0 contains the fix merged via Pull Request #39426. The patch extends the local-network deny list to cover reserved and link-local ranges and enforces IP-level validation after hostname allow-list checks. Full release details are available in the Gitea 28.0.0 release announcement.
Workarounds
- Set [migrations] ALLOWED_DOMAINS to an explicit list of trusted hostnames and remove any wildcard patterns.
- Set ALLOW_LOCALNETWORKS = false and enforce egress firewall rules that block the Gitea host from reaching 169.254.0.0/16 and other reserved ranges.
- Restrict migration permissions to a limited set of trusted users via Gitea's role configuration.
# Configuration example - app.ini hardening
[migrations]
ALLOWED_DOMAINS = github.com,gitlab.com,bitbucket.org
ALLOW_LOCALNETWORKS = false
BLOCKED_DOMAINS =
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

