CVE-2026-20896: Gitea Docker images trust X-WEBAUTH-USER from any IP (user impersonation)
The official Gitea Docker images (root and rootless) shipped an app.ini template with REVERSE_PROXY_TRUSTED_PROXIES = *, instead of the documented loopback-only default. When an admin enables reverse-proxy authentication (ENABLE_REVERSE_PROXY_AUTHENTICATION = true), anyone who can reach the container's HTTP port directly can log in as any user, including admins, by sending an X-WEBAUTH-USER header; with auto-registration enabled they can also create accounts. Binary and self-built installs that follow app.example.ini are not affected. Rated CVSS 9.8.
- CVE-2026-20896CVE identifier
- 9.8CVSS 3.1 base score (critical)
- 2.8%EPSS: chance of exploitation in the next 30 days (higher than 86% of CVEs)
- 2026-07-03published
What do these terms mean? CVE · CVSS score · exploited (KEV) · EPSS · backported fix · all terms
What to do now
- Check whether you run the affected software and which version (commands below).
- Install the fixed version for your system: see “Patch it” below.
- Recreate the Gitea container; restart it again after editing app.ini.
- If you cannot patch today, apply the temporary mitigation below and patch as soon as possible.
Affected and fixed versions
Affected:
- Gitea Docker images 1.26.2 and earlier (only when reverse-proxy authentication is enabled)
Fixed in:
- Gitea 1.26.3 (Gitea recommends 1.26.4 or later)
Am I affected?
docker exec gitea gitea --version
docker exec gitea grep -n 'REVERSE_PROXY_TRUSTED_PROXIES\|ENABLE_REVERSE_PROXY_AUTHENTICATION' /data/gitea/conf/app.ini
docker inspect gitea --format '{{range .Config.Env}}{{println .}}{{end}}' | grep -i REVERSE_PROXY
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.
Docker images
docker pull docker.gitea.com/gitea:1.26.4 # or any later release, e.g. 1.27.2
# in docker-compose.yml set: image: docker.gitea.com/gitea:1.26.4 (rootless: 1.26.4-rootless)
docker compose up -d
# existing app.ini files are not rewritten by an image upgrade: check [security] REVERSE_PROXY_TRUSTED_PROXIES and set it to your proxy's addressGeneral update steps for every system are on the Linux and Unix & BSD pages; after updating, see which services to restart.
If you cannot patch yet
- In app.ini [security] set REVERSE_PROXY_TRUSTED_PROXIES to only your authenticating proxy (the documented default is 127.0.0.0/8,::1/128), e.g. via the environment variable GITEA__security__REVERSE_PROXY_TRUSTED_PROXIES=127.0.0.0/8,::1/128, and restart.
- If you do not use reverse-proxy authentication, keep ENABLE_REVERSE_PROXY_AUTHENTICATION = false ([service]); the image is only exploitable when it is enabled.
- Do not publish the Gitea container's HTTP port anywhere except to the authenticating proxy.
Related vulnerabilities
Sources
- Gitea security advisory GHSA-f75j-4cw6-rmx4
- Gitea blog: Gitea 1.26.3 and 1.26.4 are released
- Gitea PR #38151 (fix)
- Gitea app.example.ini (REVERSE_PROXY_TRUSTED_PROXIES default)
- https://github.com/go-gitea/gitea/releases/tag/v1.26.3
- CVE-2026-20896 on CVE.org
- CVE-2026-20896 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.