Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A07:2025 - Authentication Failures
ASVS 5.0
V6 - Authentication Anti-spoofing controls
MITRE ATT&CK
1 technique across 1 tactic: Defense Evasion The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv3 – Jun 24, 2026
Authentication bypass in Gogs (self-hosted Git service) versions <= 0.14.2 allows any remote attacker who can reach the service to forge the X-WEBAUTH-USER header and impersonate any account, including administrators, when ENABLE_REVERSE_PROXY_AUTHENTICATION is turned on. Because Gogs trusts the reverse-proxy auth header without verifying the request actually came from the proxy, an attacker can also trigger automatic admin-level account creation if auto-registration is enabled. Publicly available exploit code exists (a single curl one-liner in the advisory); it is not in CISA KEV and no EPSS score was supplied.
Earlier versions of this analysis (2)
Authentication bypass in Gogs self-hosted Git service versions 0.14.2 and earlier allows any remote attacker who can reach the instance to forge the configured reverse-proxy header (default X-WEBAUTH-USER) and impersonate any account-including administrators-or trigger auto-creation of new accounts. The flaw (CWE-290, authentication bypass by spoofing) is exploitable only when ENABLE_REVERSE_PROXY_AUTHENTICATION is turned on, which is not the default. Publicly available exploit code exists (a single curl command), and the CVSS 4.0 vector includes E:P (proof-of-concept), but there is no public exploit identified as actively exploited and no CISA KEV listing.
Authentication bypass in Gogs versions 0.14.2 and earlier allows remote attackers to impersonate any user, including administrators, by forging the X-WEBAUTH-USER header when ENABLE_REVERSE_PROXY_AUTHENTICATION is enabled. The vulnerable code in internal/context/auth.go trusts the header from any source without verifying the request originated from a configured reverse proxy, and can additionally trigger automatic account creation when reverse-proxy auto-registration is on. Publicly available exploit code exists in the GHSA advisory (GHSA-w6j9-vw59-27wv); no public exploit identified at time of analysis as confirmed in-the-wild use.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 2 packages in go, euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Know when the next one hits your stack
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N/E:P
Header forging needs no privileges (PR:N) and is trivial (AC:L) once the non-default proxy-auth feature is on; admin impersonation compromises confidentiality and integrity, so C:H/I:H, A:N.
Primary rating from Vendor (https://github.com/gogs/gogs).
CVSS VectorVendor: https://github.com/gogs/gogs
Lifecycle Timeline
3DescriptionCVE.org
Summary
When ENABLE_REVERSE_PROXY_AUTHENTICATION is enabled, Gogs accepts the configured authentication header (default: X-WEBAUTH-USER) directly from client requests without validating that the request originated from a trusted reverse proxy. Any remote attacker who can reach the Gogs service can forge this header to impersonate any user or trigger automatic account creation, completely bypassing authentication.
Root Cause
The vulnerability exists because Gogs reads the authentication header directly from the incoming HTTP request without any verification that the header was set by a trusted reverse proxy.
Vulnerable Code Flow
In internal/context/auth.go lines 206-234:
func authenticatedUser(store AuthStore, ctx *macaron.Context, sess session.Store) (_ *database.User, isBasicAuth, isTokenAuth bool) {
// ... existing auth checks ...
if uid <= 0 {
if conf.Auth.EnableReverseProxyAuthentication {
// Reads header DIRECTLY from client request - NO VALIDATION!
webAuthUser := ctx.Req.Header.Get(conf.Auth.ReverseProxyAuthenticationHeader)
if len(webAuthUser) > 0 {
user, err := store.GetUserByUsername(ctx.Req.Context(), webAuthUser)
if err != nil {
if !database.IsErrUserNotExist(err) {
log.Error("Failed to get user by name: %v", err)
return nil, false, false
}
// Check if enabled auto-registration.
if conf.Auth.EnableReverseProxyAutoRegistration {
// Creates new user with forged username!
user, err = store.CreateUser(
ctx.Req.Context(),
webAuthUser,
gouuid.NewV4().String()+"@localhost",
database.CreateUserOptions{
Activated: true,
},
)
if err != nil {
log.Error("Failed to create user %q: %v", webAuthUser, err)
return nil, false, false
}
}
}
// Returns user as authenticated without any verification!
return user, false, false
}
}
// ... fallback to basic auth ...
}
// ...
}The code has zero validation that:
- The request came through a reverse proxy
- The header was set by the proxy (not the client)
- Gogs is actually behind a reverse proxy
- The direct access to Gogs is restricted
The vulnerability occurs when:
- Gogs is publicly accessible (e.g.,
0.0.0.0:3000) ENABLE_REVERSE_PROXY_AUTHENTICATION = true
Proof of Concept
Prerequisites
Gogs instance with the following configuration in custom/conf/app.ini:
[auth]
ENABLE_REVERSE_PROXY_AUTHENTICATION = trueAn attacker can impersonate any user including administrators:
# Become admin instantly
curl http://gogs.example.com/ -H "X-WEBAUTH-USER: <username>"<img width="1835" height="1143" alt="impersonation_example" src="https://github.com/user-attachments/assets/bae60772-5eb3-4f54-9fe0-5db01595bd56" />
Recommended Fixes
Add validation to ensure headers come from trusted sources:
func authenticatedUser(store AuthStore, ctx *macaron.Context, sess session.Store) (_ *database.User, isBasicAuth, isTokenAuth bool) {
// ... existing code ...
if uid <= 0 {
if conf.Auth.EnableReverseProxyAuthentication {
// Validate request is from trusted proxy
if !isRequestFromTrustedProxy(ctx.Req) {
log.Warn("Reverse proxy auth header received from untrusted source: %s", ctx.RemoteAddr())
return nil, false, false
}
webAuthUser := ctx.Req.Header.Get(conf.Auth.ReverseProxyAuthenticationHeader)
// ... rest of the code ...
}
}
// ...
}
// New validation function
func isRequestFromTrustedProxy(req *http.Request) bool {
// Check if request is from localhost/trusted IPs
remoteIP := getRemoteIP(req)
// Only accept from localhost by default
if remoteIP.IsLoopback() {
return true
}
// Check against configured trusted proxy IPs
for _, trustedIP := range conf.Auth.TrustedProxyIPs {
if remoteIP.String() == trustedIP {
return true
}
}
return false
}Add configuration option:
[auth]
ENABLE_REVERSE_PROXY_AUTHENTICATION = false
REVERSE_PROXY_AUTHENTICATION_HEADER = X-WEBAUTH-USER
; Comma-separated list of trusted proxy IPs (default: 127.0.0.1)
TRUSTED_PROXY_IPS = 127.0.0.1,::1
; Whether to require trusted proxy validation (recommended: true)
REQUIRE_TRUSTED_PROXY = trueReferences
Executive ViewAI
Gogs self-hosted Git service versions 0.14.2 and earlier contain an unauthenticated authentication bypass vulnerability that allows remote attackers to impersonate any account, including administrators, by forging reverse-proxy authentication headers. Organizations using Gogs for source code management face immediate risk of repository compromise, unauthorized code changes, and persistent unauthorized admin-level access.
Publicly available exploit code exists; immediate action required. Within 24 hours: disable ENABLE_REVERSE_PROXY_AUTHENTICATION if not required, or restrict Gogs network access exclusively to trusted proxy servers. Within 7 days: upgrade Gogs to patched version per vendor advisory and verify deployment. Within 30 days: audit all user accounts and Git activity logs, force administrator password resets, and verify no unauthorized admin accounts were created.
Apply vendor patch. Interim mitigation if patch cannot be deployed immediately: disable reverse-proxy authentication feature and restrict network access to Gogs to trusted proxy servers only.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Authentication bypass attacks exploit flaws in the verification mechanisms that control access to systems and applications.
Same weakness CWE-290 – Authentication Bypass by Spoofing
View allSame technique Authentication Bypass
View allVendor StatusVendor
SUSE
Severity: Important| Product | Status |
|---|---|
| SUSE Linux Enterprise Server 16.1 | Affected |
| SUSE Linux Enterprise Server for SAP applications 16.1 | Affected |
| SUSE Linux Enterprise Module for Package Hub 15 SP5 | Affected |
| SUSE Linux Enterprise Module for Package Hub 15 SP6 | Affected |
| openSUSE Leap 15.5 | Affected |
| openSUSE Leap 15.6 | Affected |
EUVD-2026-39063
GHSA-w6j9-vw59-27wv
NVD
CVE.org
EPSS
VulDB
Exploit-DB