CVE-2025-68937: Forgejo template repository symlinks let users overwrite server files

Critical 9.5 EPSS 0.5% Gitea / Forgejo

When Forgejo creates a repository from a template repository, it reads template files, expands variables and writes the result; if a template file was a symlink pointing outside the repository, Forgejo followed it and wrote to the symlink target. A user who can create a crafted template repository can corrupt any file the Forgejo process can write to, which may lead to shell access on the server or container. Forgejo rates it critical (CVSS 4.0 9.5). Gitea fixed a similar template-repository file-access flaw in 1.24.7.

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   # minimum fixed: 13.0.2 or 11.0.7
# 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
# current releases also include later fixes (e.g. CVE-2026-89094 in 16.0.4 / 15.0.8)
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.