llamaCVEVulnerability Intelligence
/
Advisory · GitHub · Go · github.com/OliveTin/OliveTin

GHSA-FXMJ-CJVJ-X372

OAuth2 session token is the state parameter — exposed in URLs and INFO-level logs, enabling session hijacking / account takeover

Sin parche publicado
Descargar PNG JSON
CVSS 3.1
8.1
Alta
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N Fuente: GitHub
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
ParcheSin parcheEl fabricante no ha publicado corrección
Exposición7 dDesde la divulgación, 12 nov 2026, 6:38 p. m.
Detección6 dDesde la divulgación hasta su ingreso al índice
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Explotación
Remediación
Monitoreo
Detectada +1
12 nov 26
19 nov 26
20 nov 26
12 nov 26
14 nov 26
16 nov 26
18 nov 26
20 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-FXMJ-CJVJ-X372 divulgada · CVSS 8.1 (GitHub)
Monitoreo Detectada Ingresó al índice
Monitoreo Verificada Última verificación contra las fuentes
Resumen
Descripción del advisory
Texto original · GitHub · en inglés
Summary

For OAuth2 logins, OliveTin uses the same random value as both the OAuth `state` (CSRF) parameter and the long-lived session identifier (`olivetin-sid-oauth` cookie). That value travels in URL query strings (to the IdP in the authorization request, and back in the `/oauth/callback?...&state=` URL) and is additionally written to OliveTin's own logs at INFO level. It is never rotated after authentication. Anyone who can read that value — from OliveTin's logs, a reverse-proxy/SIEM access log, the IdP's logs, the `Referer` header, or browser history — obtains a working session token for the user who logged in and can authenticate as them by setting it as their own `olivetin-sid-oauth` cookie. Because OliveTin is intentional RCE, hijacking a user with `exec` ACLs yields command execution as that user.

Details

### Affected component
`service/internal/auth/otoauth2/restapi_auth_oauth2.go` (OAuth2 login / callback / session lookup). Verified on tag 3000.21.0.

### Root cause
`HandleOAuthLogin` generates `state`, stores it server-side, puts it verbatim in the `olivetin-sid-oauth` cookie, logs it at INFO, and sends it to the IdP in the URL:

state, err := randString(16)
...
h.setOAuthCallbackCookie(w, r, "olivetin-sid-oauth", state)      // cookie value == state
log.Infof("OAuth2 state: %v mapped to provider %v ...", state)   // token written to INFO log
http.Redirect(w, r, provider.AuthCodeURL(state), http.StatusFound) // token in URL -> IdP / proxy logs / Referer

`HandleOAuthCallback` only fills in the username on the existing entry and redirects — no new session id / cookie is issued:

registeredState, state, ok := h.checkOAuthCallbackCookie(w, r)   // /oauth/callback?code=..&state=<token>
...
h.registeredStates[state].Username  = userinfo.Username
http.Redirect(w, r, "/", http.StatusFound)                        // cookie (== pre-auth state) unchanged

`CheckUserFromOAuth2Cookie` → `lookupOAuth2UserByState` resolves the cookie value directly to the authenticated user and performs no `createdAt`/expiry check (stale entries are only removed by a sweep that runs when someone hits `/oauth/login`; the 900s cookie `MaxAge` is client-side only).

Proof of concept
  1. Guest baseline: `POST /api/WhoAmI {}` → `{"authenticatedUser":"guest","acls":[]}`.
  2. Victim logs in. The login redirect — logged by the IdP, any reverse proxy, and present in Referer/history — contains the token, identical to the cookie:
  3. OliveTin's own stdout log, at default INFO level, contains the token:
  4. Attacker (separate client, no victim cookies) uses only that value:
  5. RCE by design via the hijacked session:
Impact

Account takeover / session hijacking of any OAuth2 user whose login token is observable in a log or URL. For users with `exec` ACLs this is remote command execution as that user. A single operator or log-pipeline consumer can harvest valid tokens for all OAuth2 users.

### Why this is not an existing advisory
- Not GHSA-xpxj-f2fm-rqch (OAuth2 *state-map memory DoS*) — that is unbounded map growth; this is the token *value* being reused and exposed. The listed fix for that cluster ("TTL sweep to match the 15-minute cookie MaxAge") actually reinforces the expiry weakness here.
- Not GHSA-3v7p (OAuth2 auth bypass via `authHttpHeaderUsername` spoofing) — this requires no header spoofing and no trusted-header configuration.
Checked against `.github/SECURITY_ADVISORY_DUPLICATES.md` (live `main`, 2026-11-06): no cluster covers session-token reuse, token exposure via URL/logs, session rotation, or server-side session expiry.

### Remediation
1. On successful callback, generate a fresh session id (`randString`) and set it as `olivetin-sid-oauth`; store the user under the new id and delete the `state` entry. Treat `state` as single-use and discard it after the callback — never reuse it as the session token (this also rotates the session on privilege change, closing fixation).
2. Stop logging the raw `state`/session value (drop it from the INFO log line, or redact it).
3. Enforce server-side expiry in `lookupOAuth2UserByState` (reject entries older than the session lifetime) instead of relying on a login-triggered sweep and the client-side cookie `MaxAge`.

### How it was found
Manual source review tracing the lifetime of `state` from `HandleOAuthLogin` → `AuthCodeURL`/cookie/INFO-log → `HandleOAuthCallback` → `CheckUserFromOAuth2Cookie`, confirmed with a local source build and a mock OAuth2 provider.

Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.

Vector CVSS 3.1

Desglose de métricas

Opción resaltada = valor del vector · izquierda = peor caso · GitHub
Vector de ataqueAV:N
RedAdyacenteLocalFísica
ComplejidadAC:L
BajaAlta
PrivilegiosPR:N
NingunoBajosAltos
InteracciónUI:R
NingunaRequerida
AlcanceS:U
CambiadoSin cambio
ConfidencialidadC:H
AltoBajoNinguno
IntegridadI:H
AltoBajoNinguno
DisponibilidadA:N
AltoBajoNinguno
Versiones

Rangos afectados

Afectada Corregida
github.com/OliveTin/OliveTin≤ 3000.21.0
3000.21.0
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
Gogithub.com/OliveTin/OliveTin
Sin parche — — —
Explotación

Arsenal público

Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.

Referencias
Advisoryhttps://github.com/OliveTin/OliveTin/security/advisories/GHSA-fxmj-cjvj-x372

Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.