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