Summary
CVE-2026-58508 is a critical Server-Side Request Forgery (SSRF) vulnerability affecting Gitea’s repository migration and mirror functionality. The flaw actually comprises two distinct SSRF weaknesses — a DNS rebinding issue and a missing re-validation of target addresses — that together allow an attacker to cause the Gitea server to issue requests to internal, non-public network destinations. It carries a CVSS v3.1 score of 9.1 (Critical), reflecting network-exploitable access with high confidentiality and integrity impact.
Technical details
- Root cause: Gitea’s migration/mirror feature validates a target hostname/URL for SSRF protection at an initial point in time, but does not consistently re-validate the resolved IP address at the moment the outbound connection is actually made.
- DNS rebinding: An attacker-controlled domain can initially resolve to a public/allowed IP during validation, then be changed (rebound) to resolve to an internal address by the time Gitea performs the actual outbound request, bypassing the allow-list check.
- Missing re-validation: Because the resolved address used for validation and the address used for the connection are not guaranteed to be the same, the server can end up connecting to internal hosts or cloud metadata endpoints instead of the intended external target.
- Attack vector: Network — exploited by supplying a malicious migration/mirror source URL to the repository migration functionality; no user interaction and no privileges beyond access to the migration feature are required.
- Impact: Successful exploitation can be used to reach internal network services, read internal files, or query cloud instance metadata endpoints from the Gitea server, resulting in high confidentiality and integrity impact.
Affected software
- Gitea Open Source Git Server — all versions 0 through 1.26.4
- Fixed in Gitea 1.27.0 and later
Severity
- CVSS v3.1 Base Score: 9.1 (Critical)
- Vector:
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N
Mitigation and recommended actions
- Immediate: Upgrade Gitea to version 1.27.0 or later, which includes the fix (PR #38406) for both the DNS rebinding and missing re-validation SSRF issues.
- If immediate patching is not possible:
- Restrict or disable the repository migration/mirror feature for untrusted or external users.
- Ensure outbound network access from the Gitea server is restricted at the network/firewall layer so it cannot reach internal-only hosts or cloud metadata services (e.g., block access to 169.254.169.254 and RFC1918 ranges from the Gitea host where not required).
- Monitor logs for migration/mirror requests targeting unexpected or internal-looking hostnames.

