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-104636 Overview
CVE-2026-104636 is a Server-Side Request Forgery (SSRF) vulnerability in Gitea, the self-hosted Git service. Gitea validated the initial remote URL for push mirrors, wiki remote checks, and fetches of migrated pull request heads. However, the subsequent raw Git operations followed HTTP redirects without revalidating the destination. A repository administrator with access to a policy-allowed endpoint that returns a redirect could coerce Gitea's Git client into contacting an internal address blocked by the outbound host policy. The weakness is tracked under CWE-918.
Critical Impact
An authenticated repository administrator can bypass Gitea's outbound host policy and reach internal services reachable from the Gitea server.
Affected Products
- Gitea self-hosted Git service (versions prior to v28.0.0)
- Deployments using push mirrors, wiki remote checks, or migrated pull request head fetches
- Instances relying on outbound host policy to block internal targets
Discovery Timeline
- 2026-10-06 - CVE-2026-104636 published to NVD
- 2026-10-07 - Last updated in NVD database
Technical Details for CVE-2026-104636
Vulnerability Analysis
Gitea enforces an outbound host policy to prevent server-side requests to internal or disallowed addresses. The policy check runs when a remote URL is first supplied for operations such as push mirror configuration, wiki remote validation, and fetches of migrated pull request heads. After validation, Gitea delegates the actual transfer to the underlying Git client. The client follows HTTP redirects by default, and Gitea did not revalidate redirect targets against the configured host policy.
An attacker with repository administrator privileges can register a legitimate external endpoint that answers with a 3xx redirect pointing to an internal address. The Git transport then follows that redirect and issues requests to the internal destination. Impact depends on what services are reachable from the Gitea host, such as cloud metadata endpoints, internal admin consoles, or unauthenticated APIs on the management network.
Root Cause
The root cause is incomplete enforcement of the SSRF defense. Validation occurred only on the initially supplied URL, not on each hop of the HTTP transaction. Redirect targets inherited the trust of the original request, breaking the host policy boundary.
Attack Vector
Exploitation requires an authenticated repository administrator and the ability to configure a push mirror, wiki remote, or migration source. The attacker points Gitea at an attacker-controlled HTTP endpoint permitted by policy. That endpoint responds with a redirect to an internal URL. The Git client follows the redirect, and the resulting request leaves the server with Gitea's network identity. Full technical detail is available in the GitHub Security Advisory GHSA-g4hw-fg4c-89mq and Pull Request #39426.
Detection Methods for CVE-2026-104636
Indicators of Compromise
- Push mirror, wiki, or migration configurations that reference external hosts returning HTTP 3xx responses to internal targets
- Outbound connections from the Gitea process to RFC1918 ranges, link-local addresses such as 169.254.169.254, or loopback endpoints
- Unexpected access entries in internal service logs sourced from the Gitea server IP
Detection Strategies
- Review Gitea audit logs for recently created or modified push mirrors, wiki remotes, and repository migrations by administrator accounts
- Inspect outbound HTTP traffic from Gitea for 3xx responses whose Location headers resolve to internal networks
- Correlate Git fetch activity with DNS resolutions pointing to private address space
Monitoring Recommendations
- Enable egress logging on the Gitea host and alert on connections to internal management subnets
- Monitor cloud instance metadata endpoints for requests originating from the Gitea workload
- Track configuration-change events for mirror, wiki, and migration features through the Gitea API
How to Mitigate CVE-2026-104636
Immediate Actions Required
- Upgrade Gitea to v28.0.0 or later, which revalidates redirect destinations against the outbound host policy
- Audit existing push mirrors, wiki remotes, and migration sources for suspicious external endpoints
- Restrict repository administrator privileges to trusted operators only
Patch Information
The fix is included in Gitea Release v28.0.0 and documented in the Gitea Blog Release Announcement. The code change is tracked in GitHub Pull Request #39426, which extends host policy enforcement across HTTP redirects performed by the Git client.
Workarounds
- Place Gitea behind an egress proxy that enforces an allowlist of external destinations and strips redirects to private ranges
- Disable push mirrors, wiki remote checks, and repository migrations until the upgrade is applied
- Deny the Gitea host network access to cloud metadata services and internal admin interfaces at the firewall layer
# Example egress restriction using iptables to block metadata and loopback targets
iptables -A OUTPUT -m owner --uid-owner gitea -d 169.254.169.254 -j REJECT
iptables -A OUTPUT -m owner --uid-owner gitea -d 10.0.0.0/8 -j REJECT
iptables -A OUTPUT -m owner --uid-owner gitea -d 172.16.0.0/12 -j REJECT
iptables -A OUTPUT -m owner --uid-owner gitea -d 192.168.0.0/16 -j REJECT
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

