CVE-2026-89094: Forgejo template repository expansion plants .git folder for host RCE

Critical 9.9 EPSS 0.9% Gitea / Forgejo

When Forgejo creates a repository from a template, it expands variables in files listed in .forgejo/template before initializing the new Git repository. A malicious template repository could use this expansion to create a new .git folder that git then adopts, letting the attacker read arbitrary data from the Forgejo host and execute arbitrary processes on it. Any user able to create a repository from an attacker-controlled template can trigger it; Forgejo labels the fix critical and the CVE is scored CVSS 9.9.

What do these terms mean? CVE · CVSS score · exploited (KEV) · EPSS · backported fix · all terms

What to do now

  1. Check whether you run Gitea / Forgejo and which version (commands below).
  2. Install the fixed version for your system: see “Patch it” below.
  3. Restart Forgejo with the new binary or image.

Affected and fixed versions

Affected:

Fixed in:

Am I affected?

forgejo --version
curl -s https://<your-forgejo-host>/api/v1/version
docker exec forgejo forgejo --version

Patch it

Use the commands for your system. Distribution packages often keep an older version number with the fix backported, so compare with the fixed package versions in the table below, not only with the upstream version.

Debian
not in distro repos: upstream binary
Ubuntu
not in distro repos: upstream binary
RHEL, AlmaLinux, Rocky, Oracle
sudo dnf upgrade --refresh forgejo (EPEL; Gitea: upstream binary)
Fedora
sudo dnf upgrade --refresh forgejo
SUSE / openSUSE
not in Leap 16: upstream binary
Amazon Linux
not packaged: upstream binary
Arch Linux
sudo pacman -Syu
Alpine
apk update && apk upgrade gitea forgejo (or forgejo-lts)
FreeBSD
pkg update && pkg upgrade gitea forgejo (or forgejo-lts)
Docker images
docker pull codeberg.org/forgejo/forgejo:16.0.4   # rootless: 16.0.4-rootless; 15 line: 15.0.8
# set the new tag in docker-compose.yml, then:
docker compose up -d
Built from source
# binary install; back up the data directory and database first
wget -O forgejo https://codeberg.org/forgejo/forgejo/releases/download/v16.0.4/forgejo-16.0.4-linux-amd64
chmod +x forgejo
sudo systemctl stop forgejo
sudo cp forgejo /usr/local/bin/forgejo
sudo systemctl start forgejo

General update steps for every system are on the Linux and Unix & BSD pages; after updating, see which services to restart.

Related vulnerabilities

Sources

Page generated automatically from official sources on 2026-11-03 18:05 UTC and reviewed by an editor. Always confirm with your vendor's advisory.