GHSA-5FC2-W2J4-6R8W
Bot API tokens keep working after the bot owner's account is disabled or locked
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-5FC2-W2J4-6R8W divulgada | |
| Divulgación | Modificada | Última actualización del registro | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
API tokens owned by a bot user keep authenticating after the bot's human owner is disabled or locked by an admin. Credential validation only checks the bot's own account status, and disabling an owner never changes the status of their bots. An admin who disables a user therefore doesn't cut off that user's automation, and the disabled user can keep acting through any bot token they hold.
Reported externally as TOK-BOT-01.
Details
Bot users (introduced in v2.4.0) are users with `bot_owner_id > 0`. Their owner can mint API tokens for them (`APIToken.OwnerID` = bot id).
All API-token paths resolve the token owner and check only that user's status:
- `pkg/models/api_tokens.go:353` `ValidateTokenAndGetOwner` loads `apiToken.OwnerID` (the bot) via `user.GetUserByID`. `finishLoadedUser` (`pkg/user/user.go:368`) rejects Disabled/Locked for the bot itself.
- `pkg/modules/auth/auth.go:276` `ValidateAPITokenString` (HTTP API, also used by MCP) does the same.
- `pkg/routes/caldav/auth.go:118` `checkUserCaldavTokens` and the feed auth go through the same owner load.
None of them look at `BotOwnerID`. Admin status changes (`user.SetUserStatus` / `User.SetStatus`) only update the target user's row and never cascade to bots owned by that user.
Impact
After an admin disables or locks an account (for example offboarding, or an account believed compromised), every bot owned by that account keeps working with its full permissions:
- read/write on every project or team shared with the bot, through API tokens on the HTTP API (v1 and v2), CalDAV, MCP and feeds;
- the disabled user, or whoever holds the bot tokens, can keep reading and changing that data, including projects the owner shared with the bot before being disabled.
The admin's "disable" therefore doesn't fully revoke the user's access. It needs a bot API token minted before the owner was disabled.
Proof of Concept
- As user A, create a bot (`PUT /api/v1/user/bots`). Share a project with it and create an API token with `owner_id` set to the bot.
- Check that `GET /api/v1/projects/<id>` with `Authorization: Bearer tk_…` returns 200.
- As an instance admin, disable user A (`PATCH /api/v2/admin/users/<A>/status` with status disabled, or `vikunja user change-status`).
- Repeat step 2. It still returns 200, and writes such as `POST /api/v1/tasks/<id>` also succeed.
Recommended Fix
When the authenticating user is a bot, also run the owner through the same status gate (Disabled, Locked, EmailConfirmationRequired), in the shared auth loaders used by API tokens, CalDAV, MCP and feeds. This makes the bot inherit its owner's state and needs no status cascade, so re-enabling the owner restores the bots automatically.
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
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-5fc2-w2j4-6r8wLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
