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

> Attackers can impersonate users via spoofed headers in default Gitea Docker configurations, requiring configuration changes to restrict trusted proxies.

- **Severity:** Critical 9.8 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 3 Jul 2026
- **Updated:** 7 Jul 2026
- **Also known as:** GHSA-f75j-4cw6-rmx4, GO-2026-6051

## What is CVE-2026-20896?

CVE-2026-20896 is a critical authentication bypass vulnerability in Gitea Open Source Git Server, published on 3 Jul 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

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

Weakness: CWE-284 (Improper Access Control)

## Which versions are affected by CVE-2026-20896?

3 open source packages ship an affected version, including code.gitea.io/gitea.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `code.gitea.io/gitea` | Go | All versions | 1.26.3 |
| `code.gitea.io/gitea` | Go | All versions | 1.26.3 |
| `code.gitea.io/gitea` | Go | All versions | 1.26.3 |

## How do I fix CVE-2026-20896?

Upgrade code.gitea.io/gitea to 1.26.3 or later.

## Is CVE-2026-20896 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-20896 exists.

Public exploit code:

- CVE-2026-20896 Gitea Docker X-WEBAUTH-USER auth bypass checker (github_poc): https://github.com/szybnev/cve-2026-20896-gitea-poc
- Public PoC and detector for CVE-2026-20896 ("Gitea Docker: One Header, Any User") (github_poc): https://github.com/rz1027/CVE-2026-20896
- this is a modified POC of rz1027 for CVE-2026-20896 (github_poc): https://github.com/XaocZenon/CVE-2026-20896
- https://github.com/kaleth4/CVE-2026-20896 (github_poc): https://github.com/kaleth4/CVE-2026-20896
- Gitea Docker Image Authentication Bypass (github_poc): https://github.com/EQSTLab/CVE-2026-20896
- An explanation and PoC to exploit CVE-2026-20896 Authentication Bypass Vulnerability on Gitea. Being able to steal session tokens for valid users in the Gitea instance. (github_poc): https://github.com/judgedbykira/CVE-2026-20896-Gitea-Authentication-Bypass

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-20896 and fix it if it is affected.

What it is: CVE-2026-20896 is a critical authentication bypass vulnerability in Gitea Open Source Git Server, published on 3 Jul 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-20896 exists.

Affected packages and fixed versions:
- code.gitea.io/gitea (Go): affected all versions; fixed in 1.26.3
- code.gitea.io/gitea (Go): affected all versions; fixed in 1.26.3
- code.gitea.io/gitea (Go): affected all versions; fixed in 1.26.3

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-20896/ (Markdown: https://insights.sbomify.com/CVE-2026-20896/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-20896
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-20896
- OSV: https://osv.dev/vulnerability/CVE-2026-20896

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-20896/
Summaries are generated and may contain mistakes; the official description above is the record.
