{"id":"GHSA-w6j9-vw59-27wv","revision":null,"records":[{"revision":"bce74cadedf9440e9b0ed7634ce98e62","observedAt":"2026-10-23T15:48:27.903+00:00","statement":{"source":"cve-program","id":"CVE-2026-25119","aliases":[],"title":"Gogs: Authentication Bypass via Unvalidated Reverse Proxy Headers","description":"Gogs is an open source self-hosted Git service. Prior to 0.14.3, 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. This vulnerability is fixed in 0.14.3.","state":0,"publishedAt":"2026-06-24T20:07:32.497+00:00","modifiedAt":"2026-06-25T17:12:31.75+00:00","affected":[{"ecosystem":"Vendor product","name":"gogs","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"vendor\": \"gogs\",\n                    \"product\": \"gogs\",\n                    \"versions\": [\n                        {\n                            \"version\": \"< 0.14.3\",\n                            \"status\": \"affected\"\n                        }\n                    ]\n                }"}],"metrics":[{"system":"CVSS 4.0","vector":"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","score":7.7,"severity":"HIGH"}],"references":["https://github.com/gogs/gogs/security/advisories/GHSA-w6j9-vw59-27wv","https://github.com/gogs/gogs/pull/8264","https://github.com/gogs/gogs/commit/0089c4c8e5b8d99eb6e5c8727f8f40d765f1f58a","https://github.com/gogs/gogs/releases/tag/v0.14.3"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-25119","license":"CVE Program Terms of Use","key":"cve-program:CVE-2026-25119","identifiers":["CVE-2026-25119"]},"retained":false,"historicalAffected":[]},{"revision":"0f78f4fff85a4da9abaef7647e0811cb","observedAt":"2026-11-23T15:29:55.352+00:00","statement":{"source":"euvd","id":"EUVD-2026-39063","aliases":["CVE-2026-25119","GHSA-w6j9-vw59-27wv"],"title":"Gogs is an open source self-hosted Git service. Prior to 0.14.3, when ENABLE_REVERSE_PROXY_AUTHENTICATION is enabled, Gogs accepts the configured authentication header (default: X-WEBAUTH-USER) directly from client requests without validati…","description":"Gogs is an open source self-hosted Git service. Prior to 0.14.3, 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. This vulnerability is fixed in 0.14.3.","state":0,"publishedAt":null,"modifiedAt":null,"affected":[],"metrics":[{"system":"EUVD CVSS 4.0","vector":"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","score":7.7,"severity":null}],"references":["https://github.com/gogs/gogs/security/advisories/GHSA-w6j9-vw59-27wv","https://github.com/gogs/gogs/pull/8264","https://github.com/gogs/gogs/commit/0089c4c8e5b8d99eb6e5c8727f8f40d765f1f58a","https://github.com/gogs/gogs/releases/tag/v0.14.3"],"sourceUrl":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2026-39063","license":"ENISA EUVD · source terms and attribution apply","enrichment":{"sourceStatus":null,"weaknesses":[],"productCriteria":[],"sourceDates":{"datePublished":"Jun 24, 2026, 8:07:32 PM","dateUpdated":"Jun 25, 2026, 5:12:31 PM"},"relatedAdvisories":[{"id":"WID-SEC-W-2026-2013","title":"Gogs: Mehrere Schwachstellen","vulnerabilityIds":["CVE-2022-1285","CVE-2024-39930","CVE-2024-39932","CVE-2024-39933","CVE-2025-64719","CVE-2026-25119","CVE-2026-26194","CVE-2026-47267","CVE-2026-52795","CVE-2026-52796","CVE-2026-52798","CVE-2026-52799","CVE-2026-52800","CVE-2026-52801","CVE-2026-52802","CVE-2026-52804","CVE-2026-52805","CVE-2026-52806","CVE-2026-52807","CVE-2026-52808","CVE-2026-52809","CVE-2026-52810","CVE-2026-52811","CVE-2026-52812","CVE-2026-52813","CVE-2026-52814","CVE-2026-52815","CVE-2026-52816"]}],"note":"EUVD source date text has no stated timezone and is retained without inventing a UTC instant. Related bulletin membership is not an alias, common cause or applicability claim. A missing vector with a zero score is treated as unrated. Complete vendor/product and underlying source evidence remains in the original JSON."},"key":"euvd:EUVD-2026-39063","identifiers":["EUVD-2026-39063","CVE-2026-25119","GHSA-w6j9-vw59-27wv"]},"retained":false,"historicalAffected":[]},{"revision":"c1ae34171e264db0942bfc246f374fdb","observedAt":"2026-10-25T06:17:10.452+00:00","statement":{"source":"nvd","id":"CVE-2026-25119","aliases":[],"title":"Gogs is an open source self-hosted Git service. Prior to 0.14.3, when ENABLE_REVERSE_PROXY_AUTHENTICATION is enabled, Gogs accepts the configured authentication header (default: X-WEBAUTH-USER) directly from client requests without validati…","description":"Gogs is an open source self-hosted Git service. Prior to 0.14.3, 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. This vulnerability is fixed in 0.14.3.","state":0,"publishedAt":"2026-06-24T21:16:52.903+00:00","modifiedAt":"2026-06-25T18:16:37.75+00:00","affected":[],"metrics":[{"system":"CVSS 4.0 · security-advisories@github.com · Secondary","vector":"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/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","score":7.7,"severity":"HIGH"}],"references":["https://github.com/gogs/gogs/commit/0089c4c8e5b8d99eb6e5c8727f8f40d765f1f58a","https://github.com/gogs/gogs/pull/8264","https://github.com/gogs/gogs/releases/tag/v0.14.3","https://github.com/gogs/gogs/security/advisories/GHSA-w6j9-vw59-27wv"],"sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2026-25119","license":"NIST NVD usage terms; underlying source attribution retained","enrichment":{"sourceStatus":"Deferred","weaknesses":["CWE-290"],"productCriteria":[],"sourceDates":{"published":"2026-06-24T21:16:52.903","lastModified":"2026-06-25T18:16:37.750"},"relatedAdvisories":[],"note":"NVD analysis and CPE criteria are source context, not proof that a package or your environment is affected. Complete affected data, logical configurations and SSVC are retained in the original JSON."},"key":"nvd:CVE-2026-25119","identifiers":["CVE-2026-25119"]},"retained":false,"historicalAffected":[]},{"revision":"7bf6aa8914484127b137f96536d162e4","observedAt":"2026-10-24T13:19:41.952+00:00","statement":{"source":"osv","id":"GHSA-w6j9-vw59-27wv","aliases":["CVE-2026-25119","GO-2026-5695"],"title":"Gogs has an Authentication Bypass via Unvalidated Reverse Proxy Headers","description":"## Summary\n\nWhen `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.\n\n## Root Cause\n\nThe 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.\n\n### Vulnerable Code Flow\n\nIn `internal/context/auth.go` lines 206-234:\n\n```go\nfunc authenticatedUser(store AuthStore, ctx *macaron.Context, sess session.Store) (_ *database.User, isBasicAuth, isTokenAuth bool) {\n    // ... existing auth checks ...\n\n    if uid <= 0 {\n        if conf.Auth.EnableReverseProxyAuthentication {\n            // Reads header DIRECTLY from client request - NO VALIDATION!\n            webAuthUser := ctx.Req.Header.Get(conf.Auth.ReverseProxyAuthenticationHeader)\n            if len(webAuthUser) > 0 {\n                user, err := store.GetUserByUsername(ctx.Req.Context(), webAuthUser)\n                if err != nil {\n                    if !database.IsErrUserNotExist(err) {\n                        log.Error(\"Failed to get user by name: %v\", err)\n                        return nil, false, false\n                    }\n\n                    // Check if enabled auto-registration.\n                    if conf.Auth.EnableReverseProxyAutoRegistration {\n                        // Creates new user with forged username!\n                        user, err = store.CreateUser(\n                            ctx.Req.Context(),\n                            webAuthUser,\n                            gouuid.NewV4().String()+\"@localhost\",\n                            database.CreateUserOptions{\n                                Activated: true,\n                            },\n                        )\n                        if err != nil {\n                            log.Error(\"Failed to create user %q: %v\", webAuthUser, err)\n                            return nil, false, false\n                        }\n                    }\n                }\n                // Returns user as authenticated without any verification!\n                return user, false, false\n            }\n        }\n        // ... fallback to basic auth ...\n    }\n    // ...\n}\n```\n\nThe code has **zero validation** that:\n1. The request came through a reverse proxy\n2. The header was set by the proxy (not the client)\n3. Gogs is actually behind a reverse proxy\n4. The direct access to Gogs is restricted\n\nThe vulnerability occurs when:\n- Gogs is publicly accessible (e.g., `0.0.0.0:3000`)\n- `ENABLE_REVERSE_PROXY_AUTHENTICATION = true`\n\n## Proof of Concept\n\n### Prerequisites\n\nGogs instance with the following configuration in `custom/conf/app.ini`:\n\n```ini\n[auth]\nENABLE_REVERSE_PROXY_AUTHENTICATION = true\n```\n\nAn attacker can impersonate any user including administrators:\n\n```bash\n# Become admin instantly\ncurl http://gogs.example.com/ -H \"X-WEBAUTH-USER: <username>\"\n```\n\n<img width=\"1835\" height=\"1143\" alt=\"impersonation_example\" src=\"https://github.com/user-attachments/assets/bae60772-5eb3-4f54-9fe0-5db01595bd56\" />\n\n## Recommended Fixes\n\nAdd validation to ensure headers come from trusted sources:\n\n```go\nfunc authenticatedUser(store AuthStore, ctx *macaron.Context, sess session.Store) (_ *database.User, isBasicAuth, isTokenAuth bool) {\n    // ... existing code ...\n\n    if uid <= 0 {\n        if conf.Auth.EnableReverseProxyAuthentication {\n            // Validate request is from trusted proxy\n            if !isRequestFromTrustedProxy(ctx.Req) {\n                log.Warn(\"Reverse proxy auth header received from untrusted source: %s\", ctx.RemoteAddr())\n                return nil, false, false\n            }\n\n            webAuthUser := ctx.Req.Header.Get(conf.Auth.ReverseProxyAuthenticationHeader)\n            // ... rest of the code ...\n        }\n    }\n    // ...\n}\n\n// New validation function\nfunc isRequestFromTrustedProxy(req *http.Request) bool {\n    // Check if request is from localhost/trusted IPs\n    remoteIP := getRemoteIP(req)\n\n    // Only accept from localhost by default\n    if remoteIP.IsLoopback() {\n        return true\n    }\n\n    // Check against configured trusted proxy IPs\n    for _, trustedIP := range conf.Auth.TrustedProxyIPs {\n        if remoteIP.String() == trustedIP {\n            return true\n        }\n    }\n\n    return false\n}\n```\n\nAdd configuration option:\n\n```ini\n[auth]\nENABLE_REVERSE_PROXY_AUTHENTICATION = false\nREVERSE_PROXY_AUTHENTICATION_HEADER = X-WEBAUTH-USER\n; Comma-separated list of trusted proxy IPs (default: 127.0.0.1)\nTRUSTED_PROXY_IPS = 127.0.0.1,::1\n; Whether to require trusted proxy validation (recommended: true)\nREQUIRE_TRUSTED_PROXY = true\n```\n\n## References\n\n- [CWE-290: Authentication Bypass by Spoofing](https://cwe.mitre.org/data/definitions/290.html)\n- [OWASP: Authentication Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Authentication_Cheat_Sheet.html)\n- [OWASP Top 10 2021 - A07: Identification and Authentication Failures](https://owasp.org/Top10/A07_2021-Identification_and_Authentication_Failures/)","state":0,"publishedAt":"2026-06-22T17:09:51+00:00","modifiedAt":"2026-07-21T13:30:33.2465055+00:00","affected":[{"ecosystem":"Go","name":"gogs.io/gogs","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"0.14.3"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V4","vector":"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","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"HIGH"}],"references":["https://github.com/gogs/gogs/security/advisories/GHSA-w6j9-vw59-27wv","https://nvd.nist.gov/vuln/detail/CVE-2026-25119","https://github.com/gogs/gogs/pull/8264","https://github.com/gogs/gogs/commit/0089c4c8e5b8d99eb6e5c8727f8f40d765f1f58a","https://github.com/gogs/gogs","https://github.com/gogs/gogs/releases/tag/v0.14.3"],"sourceUrl":"https://github.com/advisories/GHSA-w6j9-vw59-27wv","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-w6j9-vw59-27wv","identifiers":["GHSA-w6j9-vw59-27wv","CVE-2026-25119","GO-2026-5695"]},"retained":false,"historicalAffected":[]},{"revision":"463a338e09e54d6bb5265881b147e154","observedAt":"2026-10-24T13:19:41.952+00:00","statement":{"source":"osv","id":"GO-2026-5695","aliases":["CVE-2026-25119","GHSA-w6j9-vw59-27wv"],"title":"Gogs has an Authentication Bypass via Unvalidated Reverse Proxy Headers in gogs.io/gogs","description":"Gogs has an Authentication Bypass via Unvalidated Reverse Proxy Headers in gogs.io/gogs.\n\nNOTE: The source advisory for this report contains additional versions that could not be automatically mapped to standard Go module versions.\n\n(If this is causing false-positive reports from vulnerability scanners, please suggest an edit to the report.)\n\nThe additional affected modules and versions are: gogs.io/gogs before v0.14.3.","state":0,"publishedAt":"2026-06-25T22:34:38+00:00","modifiedAt":"2026-06-25T23:01:27.9994478+00:00","affected":[{"ecosystem":"Go","name":"gogs.io/gogs","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[],"references":["https://github.com/gogs/gogs/security/advisories/GHSA-w6j9-vw59-27wv","https://github.com/gogs/gogs/commit/0089c4c8e5b8d99eb6e5c8727f8f40d765f1f58a","https://github.com/gogs/gogs/pull/8264","https://github.com/gogs/gogs/releases/tag/v0.14.3"],"sourceUrl":"https://osv.dev/vulnerability/GO-2026-5695","license":"OSV · upstream source license applies","key":"osv:GO-2026-5695","identifiers":["GO-2026-5695","CVE-2026-25119","GHSA-w6j9-vw59-27wv"]},"retained":false,"historicalAffected":[]}],"coverage":[{"source":"cisa-kev:global","scope":"Complete CISA KEV catalog; all vendors. Missing entries do not establish absence of exploitation.","generation":"2026-11-24T11:25:35.5405878+00:00","complete":true,"records":1792,"lastAttemptAt":"2026-11-24T11:25:35.5405878+00:00","lastSuccessAt":"2026-11-24T11:25:35.7075047+00:00","error":null,"lastVerifiedAt":"2026-11-24T11:25:35.707505+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"cve-program","scope":"Official CVE Program baseline and cumulative hourly delta; all vendors, published and rejected records","generation":"cve-f6e4a7f93ed9acd6fcb1f804a4567f7b9b16730ac126110af8d6d24176317946-6231a31653a43e57f005d532b3b61ff1da85288f32bbf39b75f07bda011db41a","complete":true,"records":431100,"lastAttemptAt":"2026-11-24T11:25:35.0471978+00:00","lastSuccessAt":"2026-11-24T11:25:34.9172836+00:00","error":null,"lastVerifiedAt":"2026-11-24T11:25:35.0471978+00:00","snapshotPublishedAt":"2026-11-24T10:25:56+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"euvd","scope":"Rolling EUVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global EUVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-d7c5d9b448144635bf3c41ecc488a309","complete":false,"records":13935,"lastAttemptAt":"2026-11-24T11:35:58.3742494+00:00","lastSuccessAt":"2026-11-24T11:35:57.35+00:00","error":"535 identifier lookups failed; latest failures include AccessDenied (HTTP 403). Other identifiers were checked independently.","lastVerifiedAt":"2026-11-24T11:35:57.35+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13258,"expectedIdentifiers":13982,"failedIdentifiers":535},{"source":"first-epss:nuget","scope":"FIRST EPSS for explicit CVE aliases in the collected public NuGet archive. Not a global EPSS backfill.","generation":"2026-11-24T11:25:35.5405878+00:00","complete":true,"records":1131,"lastAttemptAt":"2026-11-24T11:25:35.5405878+00:00","lastSuccessAt":"2026-11-24T11:25:35.7082792+00:00","error":null,"lastVerifiedAt":"2026-11-24T11:25:35.7082793+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"nvd","scope":"Rolling NVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global NVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-18a230aff64e42c7b71e8312589a3430","complete":false,"records":13947,"lastAttemptAt":"2026-11-24T11:25:55.2915098+00:00","lastSuccessAt":"2026-11-24T11:25:55.288+00:00","error":null,"lastVerifiedAt":"2026-11-24T11:25:55.288+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13682,"expectedIdentifiers":13982,"failedIdentifiers":0},{"source":"osv:Go","scope":"Complete OSV Go ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"go-c86437892ddabdeaf17409463a17578b1e71dd185d64061100dd57629858f6d6","complete":true,"records":10074,"lastAttemptAt":"2026-11-24T11:25:35.3898621+00:00","lastSuccessAt":"2026-11-23T22:27:19.6557603+00:00","error":null,"lastVerifiedAt":"2026-11-24T11:25:35.3898621+00:00","snapshotPublishedAt":"2026-11-23T21:33:52+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:NuGet","scope":"Complete OSV NuGet ecosystem archive, including GitHub Advisory Database records; NuGet version matching only","generation":"nuget-6ba2352decd0c95d34a1b50f642582aa34659ce946f552488f0a5cea4e0cc09a","complete":true,"records":2020,"lastAttemptAt":"2026-11-24T11:25:35.1158017+00:00","lastSuccessAt":"2026-11-20T15:46:15.4249619+00:00","error":null,"lastVerifiedAt":"2026-11-24T11:25:35.1158017+00:00","snapshotPublishedAt":"2026-11-20T14:48:20+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:crates.io","scope":"Complete OSV crates.io ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"crates.io-3afd4dd07a6bf352a6a53c4438150c464a2527017b95ca94804134ea15f1eba9","complete":true,"records":3220,"lastAttemptAt":"2026-11-24T11:25:35.5015915+00:00","lastSuccessAt":"2026-11-24T10:25:37.8779609+00:00","error":null,"lastVerifiedAt":"2026-11-24T11:25:35.5015915+00:00","snapshotPublishedAt":"2026-11-24T09:33:40+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:npm","scope":"Complete OSV npm ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"npm-b3f815f4b80e6ee7009a469e05600427b49c4c540d96b9bae57af39cb7a4c7df","complete":true,"records":232959,"lastAttemptAt":"2026-11-24T11:25:35.2873819+00:00","lastSuccessAt":"2026-11-24T08:27:06.9384925+00:00","error":null,"lastVerifiedAt":"2026-11-24T11:25:35.2873819+00:00","snapshotPublishedAt":"2026-11-24T07:33:55+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null}]}