Gogs is an open source self-hosted Git service. Prior to version 0.14.2, gogs api still accepts tokens in url params like token and…
GitHub_M·CWE-598·Published 2026-03-05
Gogs is an open source self-hosted Git service. Prior to version 0.14.2, gogs api still accepts tokens in url params like token and access_token, which can leak through logs, browser history, and referrers. This issue has been patched in version 0.14.2.
Gogs is an open source self-hosted Git service. Prior to version 0.14.2, gogs api still accepts tokens in url params like token and access_token, which can leak through logs, browser history, and referrers. This issue has been patched in version 0.14.2.
Gogs: Access tokens get exposed through URL params in API requests in gogs.io/gogs
### Summary The Gogs API still accepts tokens in URL parameters such as `token` and `access_token`, which can leak through logs, browser history, and referrers. ### Details A static review shows that the API still checks tokens in the URL query before looking at headers: - internal/context/auth.go reads `c.Query("token")` - internal/context/auth.go falls back to `c.Query("access_token")` - internal/context/auth.go only checks the `Authorization` header when the query token is empty - internal/context/auth.go authenticates using that token and marks the request as token-authenticated Token-authenticated requests are accepted by API routes through `c.IsTokenAuth` checks: - internal/route/api/v1/api.go ### Impact If tokens are sent in URLs such as `/api/v1/user?token=...`, they can leak in logs, browser or shell history, and referrer headers, and can be reused until revoked. ### Recommended Fix - Authentication headers should be used exclusively for token transmission. - Token parameters should be blocked at the proxy or WAF level. - Query strings should be scrubbed from logs. - A strict referrer policy should be set. ### Remediation A fix is available at https://github.com/gogs/gogs/releases/tag/v0.14.2.
Gogs es un servicio Git autoalojado de código abierto. Antes de la versión 0.14.2, la API de Gogs aún aceptaba tokens en parámetros de URL como 'token' y 'access_token', los cuales pueden filtrarse a través de registros, el historial del navegador y referentes. Este problema ha sido parcheado en la versión 0.14.2.
| Version | Type | Source | Base | Exp | Impact | Vector |
|---|---|---|---|---|---|---|
| 3.1 | Primary | NVD | 5.3 | 3.9 | 1.4 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N |
| 3.1 | Secondary | GHSA | 5.3 | — | — | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N |
| 4.0 | Primary | cve.org | 6.9 | — | — | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N |
| 4.0 | Primary | cve.org | 6.9 | — | — | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N |
| 4.0 | Secondary | NVD | 6.9 | — | — | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N/E:X/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 |
| 4.0 | Secondary | GHSA | 6.9 | — | — | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N |