Gitea: SSRF in restore-repo via unsanitized pull_request.yml Head.CloneURL (CVE-2026-58441)
Gitea contains a Server-Side Request Forgery (SSRF) vulnerability in its restore-repo CLI command due to improper validation of the pull_request.yml Head.CloneURL field. The safety check intended to validate this URL is disabled by passing an empty base URL, allowing attacker-controlled URLs to be used in git fetch commands. This can lead to SSRF attacks against internal services or disclosure of local git repositories accessible via file:// URLs. The vulnerability affects versions prior to 1.27.0. No remote code execution via git transport helpers was found. No public exploit is known.
AI Analysis
Technical Summary
The Gitea restore-repo CLI command restores repositories from dump archives and parses pull_request.yml files. The Head.CloneURL field from these files is used to add git remotes and fetch from them without proper validation because the CheckAndEnsureSafePR function is called with an empty commonCloneBaseURL parameter. This causes the safety check to be effectively disabled since strings.HasPrefix with an empty prefix always returns true. As a result, arbitrary URLs controlled by an attacker can be used in git fetch commands executed by the server. This enables SSRF attacks against internal or cloud metadata endpoints and disclosure of local git repositories via file:// URLs. The issue is confirmed in versions 1.26.4, release/v1.27, and main branches. Remote code execution via git transport helpers was tested and ruled out.
Potential Impact
An attacker who can convince an administrator to run the restore-repo command on a malicious dump can cause the Gitea server to perform git fetch operations against arbitrary URLs. This allows SSRF attacks targeting internal-only services or cloud metadata endpoints accessible from the Gitea host. Additionally, it can disclose local git repositories accessible via file:// URLs readable by the Gitea process. There is no known remote code execution impact. The vulnerability requires local or administrative access to run restore-repo with a crafted dump.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is available, avoid running the restore-repo command on untrusted or unauthenticated dump archives. Validate or sanitize pull_request.yml files before use to ensure Head.CloneURL fields do not contain attacker-controlled URLs. Monitor vendor announcements for patches addressing this issue.
Gitea: SSRF in restore-repo via unsanitized pull_request.yml Head.CloneURL (CVE-2026-58441)
Description
Gitea contains a Server-Side Request Forgery (SSRF) vulnerability in its restore-repo CLI command due to improper validation of the pull_request.yml Head.CloneURL field. The safety check intended to validate this URL is disabled by passing an empty base URL, allowing attacker-controlled URLs to be used in git fetch commands. This can lead to SSRF attacks against internal services or disclosure of local git repositories accessible via file:// URLs. The vulnerability affects versions prior to 1.27.0. No remote code execution via git transport helpers was found. No public exploit is known.
CVSS v3.1
Score 6.3medium
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The Gitea restore-repo CLI command restores repositories from dump archives and parses pull_request.yml files. The Head.CloneURL field from these files is used to add git remotes and fetch from them without proper validation because the CheckAndEnsureSafePR function is called with an empty commonCloneBaseURL parameter. This causes the safety check to be effectively disabled since strings.HasPrefix with an empty prefix always returns true. As a result, arbitrary URLs controlled by an attacker can be used in git fetch commands executed by the server. This enables SSRF attacks against internal or cloud metadata endpoints and disclosure of local git repositories via file:// URLs. The issue is confirmed in versions 1.26.4, release/v1.27, and main branches. Remote code execution via git transport helpers was tested and ruled out.
Potential Impact
An attacker who can convince an administrator to run the restore-repo command on a malicious dump can cause the Gitea server to perform git fetch operations against arbitrary URLs. This allows SSRF attacks targeting internal-only services or cloud metadata endpoints accessible from the Gitea host. Additionally, it can disclose local git repositories accessible via file:// URLs readable by the Gitea process. There is no known remote code execution impact. The vulnerability requires local or administrative access to run restore-repo with a crafted dump.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is available, avoid running the restore-repo command on untrusted or unauthenticated dump archives. Validate or sanitize pull_request.yml files before use to ensure Head.CloneURL fields do not contain attacker-controlled URLs. Monitor vendor announcements for patches addressing this issue.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-xmj7-xj85-hfc3
- Osv Schema Version
- 1.4.0
- Aliases
- ["CVE-2026-58441"]
- Ecosystems
- ["Go"]
- Database Specific Severity
- MODERATE
- Cvss Version
- 3.1
Threat ID: 6a600ab89c2644c7f8fe2614
Added to database: 07/22/2026, 00:11:36 UTC
Last enriched: 07/22/2026, 00:50:18 UTC
Last updated: 07/31/2026, 12:28:12 UTC
Views: 18
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.