Executive brief
Gitea, a popular self-hosted Git service, is vulnerable to a security flaw in its repository restoration feature. An attacker with administrative or operator access can use a specially crafted backup file to trick the server into reading sensitive files from its own storage, such as database passwords, private encryption keys, and system configuration files. This could lead to a full compromise of the server's data and connected services.
Technical details
A Local File Inclusion (LFI) vulnerability exists in Gitea's 'restore-repo' command due to insufficient scheme validation in the URI processing logic. The 'DownloadURL' field within a user-supplied 'release.yml' file is passed to the 'uri.Open()' function, which supports the 'file://' scheme via 'os.Open()'. An attacker with the ability to execute the restoration command or provide a malicious archive to an administrator can exfiltrate sensitive files (e.g., 'app.ini', SSH keys) by mapping them as release attachments. The vulnerability is rooted in 'services/migrations/gitea_uploader.go' and 'modules/uri/uri.go'. A fix is available in version 1.27.0 which restricts allowed URI schemes.
Affected products
- Gitea Gitea < 1.27.0
Timeline
- 2026-07-13: disclosed: Initial disclosure to vendor
- 2026-07-21: advisory: GitHub Advisory published