Gitea Docker Images Insecure Default Allows User Impersonation via X-WEBAUTH-USER
Gitea Docker images ship with a critical misconfiguration, CVE-2026-20896, where `REVERSE_PROXY_TRUSTED_PROXIES = *` by default, enabling any client to bypass authentication and impersonate users via the `X-WEBAUTH-USER` HTTP header when reverse proxy authentication is enabled, leading to unauthorized access to user accounts, including administrative ones.
CVE search metadata
CVE search record: CVE-2026-20896. Severity: critical. CVSS: 9.8. EPSS: 31.81%. KEV: no. Product: gitea/gitea Docker images, go/code.gitea.io/gitea. Brief: Gitea Docker Images Insecure Default Allows User Impersonation via X-WEBAUTH-USER. Brief link: https://feed.craftedsignal.io/briefs/2026-07-gitea-docker-impersonation/
What's new
- 1. poc_available Aug 15, 20:31 via sploitus
Gitea Docker images (versions prior to 1.26.3) contain a critical security misconfiguration, CVE-2026-20896, where the app.ini template hard-codes REVERSE_PROXY_TRUSTED_PROXIES = *. This default deviates from the secure documented standard of 127.0.0.0/8,::1/128 (loopback only). When ENABLE_REVERSE_PROXY_AUTHENTICATION is set to true in a vulnerable Gitea Docker deployment, any process or attacker capable of directly reaching the Gitea container's HTTP port can impersonate any user. This is achieved by simply supplying an X-WEBAUTH-USER HTTP header with a known or guessable username, bypassing standard authentication mechanisms like passwords or session cookies. This vulnerability affects gitea/gitea Docker images up to version 1.26.2 and poses a significant risk for unauthorized access.
Attack Chain
- Deployment of Vulnerable Gitea Container: An organization deploys a
gitea/giteaDocker image (version prior to 1.26.3) configured withENABLE_REVERSE_PROXY_AUTHENTICATION = true, retaining the image's defaultREVERSE_PROXY_TRUSTED_PROXIES = *. - Network Exposure: The Gitea container's HTTP port (e.g., 3000) is directly accessible to an attacker, potentially bypassing any intended authenticating reverse proxy.
- User Enumeration/Knowledge: The attacker identifies or guesses valid usernames within the Gitea instance (e.g., 'admin', 'alice').
- Crafting Malicious HTTP Request: The attacker crafts an HTTP GET or POST request targeting the vulnerable Gitea instance, including the
X-WEBAUTH-USERheader set to an identified username. - Authentication Bypass: The misconfigured Gitea instance, treating all incoming connections as trusted proxies, accepts the
X-WEBAUTH-USERheader from the attacker's source IP as a legitimate authentication credential. - Account Impersonation: The attacker's request is processed with the privileges of the user specified in the
X-WEBAUTH-USERheader, granting unauthorized access to that user's account. - Impact: The attacker gains full control over the impersonated user's Gitea account, allowing actions such as repository modification, unauthorized access to code, or privilege escalation if an administrative account was targeted, leading to full control of the Git hosting platform.
Impact
Successful exploitation of CVE-2026-20896 allows any process that can directly access the Gitea Docker container's HTTP port to completely bypass authentication and impersonate any existing user. This includes highly privileged accounts like administrators (e.g., 'admin', 'gitea_admin'), leading to full compromise of the Gitea instance. Attackers can gain unauthorized access to source code repositories, manipulate project data, create new users, delete existing content, or achieve complete control over the Git hosting platform. While specific victim counts are not available, all deployments using vulnerable Gitea Docker images with ENABLE_REVERSE_PROXY_AUTHENTICATION enabled are at critical risk.
Recommendation
- Patch CVE-2026-20896 by upgrading
gitea/giteaDocker images to version 1.26.3 or newer immediately to address the insecure default configuration. - Manually Configure Trusted Proxies: If immediate upgrade is not feasible, modify the
REVERSE_PROXY_TRUSTED_PROXIESsetting inapp.inito explicitly list only the IP addresses of trusted reverse proxies (e.g.,127.0.0.0/8,::1/128) and restart the Gitea container. - Deploy the Sigma rule titled "Detect CVE-2026-20896 Exploitation - Gitea Impersonation via X-WEBAUTH-USER" to your SIEM and tune it for your environment.
- Enable comprehensive web server logging to capture HTTP request headers and client IP addresses, which are critical log sources for detecting the exploitation behavior described.
Detection coverage 1
Detect CVE-2026-20896 Exploitation - Gitea Impersonation via X-WEBAUTH-USER
highDetects exploitation of CVE-2026-20896 where a misconfigured Gitea Docker instance, with `REVERSE_PROXY_TRUSTED_PROXIES = *` and `ENABLE_REVERSE_PROXY_AUTHENTICATION = true`, receives an `X-WEBAUTH-USER` header from a non-loopback IP, indicating an authentication bypass attempt.
Detection queries are available on the platform. Get full rules →