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.dev: Gitea: Local File Inclusion via file:// URI in Migration Restore (CVE-2026-58420)

0
Medium
Published: 07/21/2026 (07/21/2026, 20:59:53 UTC)
Source: GCVE Database
Product: gitea.dev

Description

Gitea versions prior to 1.27.0 contain a local file inclusion vulnerability in the restore-repo command. This occurs because the DownloadURL field in release attachments is passed to a function that supports the file:// URI scheme without validating or restricting it. An attacker with operator-level access who can supply a crafted archive to the restore-repo command can cause the server to read arbitrary files accessible to the Gitea process user and store their contents as release attachments retrievable via the API.

CVSS v4.0

Attack Vector
Local
Attack Complexity
Low
Attack Requirements
None
Privileges Required
High
User Interaction
None
Vuln. Confidentiality
High
Vuln. Integrity
None
Vuln. Availability
None
Subsq. Confidentiality
None
Subsq. Integrity
None
Subsq. Availability
None
CVSS:4.0/AV:L/AC:L/AT:N/PR:H/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N

Affected software

Goghsa
gitea.dev
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:47:12 UTC

Technical Analysis

Gitea's restore-repo command processes user-supplied release.yml files from an archive, passing the DownloadURL field of release attachments to uri.Open(), which supports file:// URIs without validation. This allows an attacker with operator-level privileges who can supply a crafted archive to cause the server to read arbitrary local files and save their contents as release attachments. The vulnerability arises from lack of scheme validation and path restrictions in uri.Open(), enabling local file inclusion (LFI).

Potential Impact

An attacker with operator or admin access who can run the restore-repo command with a crafted archive can read any file on the server filesystem accessible to the Gitea process user. This includes sensitive files such as configuration files containing database passwords and secret keys, SSH private keys, TLS certificates and keys, cloud provider credentials, and any other readable files. The exfiltrated file contents are stored silently as release attachments and can be retrieved via the Gitea API, potentially leading to credential and key disclosure.

Mitigation Recommendations

Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until an official fix is available, restrict operator and admin access to the restore-repo command and avoid restoring repositories from untrusted archives. Monitor vendor communications for patches addressing this vulnerability and apply them promptly once released.

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-5ggr-2f2h-jmvm
Osv Schema Version
1.4.0
Aliases
["CVE-2026-58420"]
Ecosystems
["Go"]
Database Specific Severity
MODERATE
Cvss Version
4.0

Threat ID: 6a600ab19c2644c7f8fe1c97

Added to database: 07/22/2026, 00:11:29 UTC

Last enriched: 07/22/2026, 00:47:12 UTC

Last updated: 07/22/2026, 00:47:12 UTC

Views: 2

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