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.
- CVE-2025-68937CVE identifier
- 9.5CVSS 4.0 base score (critical)
- 0.5%EPSS: chance of exploitation in the next 30 days (higher than 43% of CVEs)
- 2025-12-25published
What do these terms mean? CVE · CVSS score · exploited (KEV) · EPSS · backported fix · all terms
What to do now
- Check whether you run Gitea / Forgejo and which version (commands below).
- Install the fixed version for your system: see “Patch it” below.
- Restart Forgejo with the new binary or image.
Affected and fixed versions
Affected:
- Forgejo before 13.0.2
- Forgejo 11 LTS before 11.0.7
Fixed in:
- Forgejo 13.0.2
- Forgejo 11.0.7 (LTS)
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 binaryUbuntu
not in distro repos: upstream binaryRHEL, AlmaLinux, Rocky, Oracle
sudo dnf upgrade --refresh forgejo (EPEL; Gitea: upstream binary)Fedora
sudo dnf upgrade --refresh forgejoSUSE / openSUSE
not in Leap 16: upstream binaryAmazon Linux
not packaged: upstream binaryArch Linux
sudo pacman -SyuAlpine
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 -dBuilt 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 forgejoGeneral update steps for every system are on the Linux and Unix & BSD pages; after updating, see which services to restart.
Related vulnerabilities
Sources
- Forgejo 13.0.2 release notes
- Forgejo 11.0.7 release notes
- Forgejo security announcement: v11.0.7 and v13.0.2
- Forgejo fix commit 449b5bf
- Gitea blog: Gitea 1.24.7 is released
- https://codeberg.org/forgejo/forgejo/milestone/29156
- https://codeberg.org/forgejo/forgejo/milestone/27340
- CVE-2025-68937 on CVE.org
- CVE-2025-68937 on NVD
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.