GHSA-FRF4-3PRF-3VCH
Login CSRF via form-encoded login and OIDC callback on /api/v2
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-FRF4-3PRF-3VCH divulgada · CVSS 4.6 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
## Summary
An attacker with an account on the instance gets a victim's browser to submit a cross-site HTML form to v2 `/login` or the v2 OIDC callback, carrying the attacker's credentials or OIDC code. The response sets the refresh cookie for the attacker's session. When the victim's JWT expires, the frontend refreshes into the attacker's identity.
## Details
- `pkg/routes/api/v2/huma.go:80-88` registers `application/x-www-form-urlencoded` API-wide (meant for `/oauth/token`), and Huma decodes by Content-Type, so a form body binds into the json-tagged `user.Login`. A form POST needs no CORS preflight. v1 is not affected: Echo's form binder maps only `form`-tagged struct fields, and `user.Login` / `openid.Callback` carry only `json`/`query` tags, so a v1 form POST binds nothing and fails before any cookie is set.
- `pkg/routes` has no CSRF, Origin or `Sec-Fetch` checks.
- `exchangeOidcTokens` (`pkg/modules/auth/openid/openid.go:614-627`) trusts `code` and `redirect_url` from the body, with no server-side state. The OIDC `state` is checked only in the frontend, which a direct form POST skips.
- The refresh that switches identity is at `frontend/src/stores/auth.ts:453-462`.
- Authenticated routes are not affected: the bearer token is in localStorage. Refresh is not affected: the Lax cookie isn't sent on a cross-site POST.
Related: GHSA-pq54-9g68-cxjr (closed) reported the missing OIDC `state`/`nonce` with a JSON PoC, which a browser can't send cross-site without a preflight. Form-encoded bodies are the remaining gap that makes the unbound callback, and the password login, reachable from a plain cross-site form.
## Impact
The victim unknowingly works in the attacker's account, so tasks, notes and files they add are readable by the attacker. Requires an attacker account and a victim visiting an attacker page; it takes effect at the next token refresh. Affects releases with the refresh cookie (v2.0.0 and later).
## Fix
Stop registering the form format API-wide. Add one middleware on both API groups that rejects form Content-Type with 415, except on `/oauth/token`. Optionally reject `Sec-Fetch-Site: cross-site` on session-issuing endpoints.
_Found via internal security review (deep #44, deep #11)._
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
gocode.vikunja.io/api |
Sin parche | — | — | v0.24.6 no afectada |
Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/go-vikunja/vikunja/security/advisories/GHSA-frf4-3prf-3vchLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
