Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

Gitea: SSRF in restore-repo via unsanitized pull_request.yml Head.CloneURL (CVE-2026-58441)

0
Medium
Published: 07/21/2026 (07/21/2026, 20:37:29 UTC)
Source: GCVE Database
Product: code.gitea.io/gitea

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

Attack Vector
Local
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Changed
Confidentiality
High
Integrity
None
Availability
None
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:N/A:N

Affected software

Goghsa
code.gitea.io/gitea
Affected versions
<1.27.0

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 07/22/2026, 00:50:18 UTC

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.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

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 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses