GHSA-W64Q-7P4M-J8G8
Kanban task-bucket move lets a user put a task into another project's bucket
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-W64Q-7P4M-J8G8 divulgada | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
The task-bucket move endpoint in Vikunja authorizes the bucket side and the task side of the operation independently but never checks that the two belong to the same project. `TaskBucket.CanUpdate` (`pkg/models/kanban_task_bucket.go:53-68`) confirms the caller can write to the project that owns the URL-supplied bucket/view and, separately, that the caller can write to the body-supplied task; it does not verify that the task's project matches the view's project. Any authenticated user who has write access to two projects can therefore move a task from one project into a kanban bucket of the other project, persisting a cross-project `task_buckets` row. When the target bucket is the view's done bucket, the move also toggles the foreign task's done state and clears or sets its date fields. The foreign task does not become visible in the destination view; the impact is limited to inconsistent kanban state.
Root Cause
Vikunja enforces per-project isolation: a task, its views, and its buckets must all belong to the same project. The task-bucket move operation accepts the project, view, and bucket from the URL and the task id from the request body, so the task is a separate resource dimension from the view/bucket. The authorization method validates each dimension in isolation but omits the relationship invariant that the task and the view share a project. The code comment at `pkg/models/kanban_task_bucket.go:64-65` explicitly recognizes that the body-supplied task may live in a different project, yet only adds an individual write check for it, not a project-membership check. The analogous task-position endpoint received exactly this membership guard, so the two sibling endpoints now diverge.
Missing authorization check in pkg/models/kanban_task_bucket.go:53-68 (TaskBucket.CanUpdate):
func (b *TaskBucket) CanUpdate(s, a) (bool, error) {
bucket := Bucket{ID: b.BucketID, ProjectID: b.ProjectID, ProjectViewID: b.ProjectViewID}
canDoBucket, err := bucket.canDoBucket(s, a) // user can write the view's project
if err != nil || !canDoBucket { return false, err }
task := &Task{ID: b.TaskID}
return task.CanWrite(s, a) // user can write the task's project
}
// No check that task.ProjectID == view.ProjectID
Present guard in the sibling endpoint pkg/models/task_position.go:87-88:
if view.ProjectID != task.ProjectID { return false, nil }Impact
An attacker needs an authenticated account with write access to two projects: one they control (the destination, supplying the URL project/view/bucket) and one holding the task they want to inject (any project they can write to, including one shared with other users). Both preconditions are ordinary for a multi-project or shared-project deployment. With a single request the attacker persists a `task_buckets` row linking a task from project B into a kanban view of project A. This breaks the project-isolation invariant for kanban state. The foreign task does not show up in project A's kanban view, because view reads are scoped to the view's projects (`pkg/models/kanban.go:260`), so members of project A learn nothing about it. What the stray row does: it counts toward the A bucket's task limit while staying invisible (`pkg/models/tasks.go:879`), and done-bucket moves upsert it into A's other views (`pkg/models/kanban_task_bucket.go:197-215`). If the targeted bucket is the view's done bucket, the move additionally mutates the foreign task's `done`, `done_at`, `due_date`, `start_date`, and `end_date` fields. The attacker already holds write access to that task, so the done-state change is not a new write primitive, only an alternate trigger. There is no confidentiality impact, no privilege escalation, and no availability impact beyond filling a bucket's limit with invisible tasks.
Proof of Concept
Dependencies: a running Vikunja >= 2.6.0 instance, bash, curl, python3.
Setup: one authenticated user who is a member with write access of two projects.
PROJ_A = attacker-controlled project (destination)
VIEW_A = a kanban view in PROJ_A
BUCKET_A= a bucket in VIEW_A (use the view's done bucket to also toggle done-state)
PROJ_B = a different project the user can write to
TASK_B = a task in PROJ_B to inject
TOKEN = JWT or API token for the user
BASE = e.g. http://localhost:3456/api/v2Steps:
- Confirm `TASK_B` belongs to `PROJ_B` and note its current `done` state.
- Issue the cross-project bucket move against `PROJ_A`'s view, supplying `TASK_B` in the body.
- Observe the task's state and the persisted `task_buckets` row. The task itself is not listed in `PROJ_A`'s kanban view.
# Step 2: inject the foreign task into PROJ_A's kanban bucket
curl -s -X PUT \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d "{\"task_id\": ${TASK_B}}" \
"${BASE}/projects/${PROJ_A}/views/${VIEW_A}/buckets/${BUCKET_A}/tasks"HTTP 200
{"task_id": <TASK_B>, "project_view_id": <VIEW_A>, "bucket_id": <BUCKET_A>, ...}
# A task_buckets row now links TASK_B (owned by PROJ_B) to VIEW_A / BUCKET_A.
# TASK_B is not listed in VIEW_A, but it counts toward BUCKET_A's limit.
# If BUCKET_A is VIEW_A's done bucket, TASK_B is additionally marked done.Attack Chain
- Exposure: The move endpoint ships enabled on both API versions and requires only an authenticated session: `POST /api/v1/projects/{project}/views/{view}/buckets/{bucket}/tasks` (`pkg/routes/routes.go:972`) and `PUT /api/v2/projects/{project}/views/{view}/buckets/{bucket}/tasks` (`pkg/routes/api/v2/task_bucket.go:34-47`). Both pass through `SetupTokenMiddleware()` and `handler.DoUpdate` (`pkg/web/handler/core.go:138`).
- Control: The project, view, and bucket are taken from the URL path (the v2 handler overwrites any body values at `pkg/routes/api/v2/task_bucket.go:62-64`), while `task_id` is read from the request body and fully attacker-controlled.
- Path: `handler.DoUpdate` calls `TaskBucket.CanUpdate` (`pkg/models/kanban_task_bucket.go:53-68`) and then `TaskBucket.Update` into `updateTaskBucket` (`pkg/models/kanban_task_bucket.go:88-231`).
- Guard: `canDoBucket` (`pkg/models/kanban_permissions.go:45-56`) only confirms the caller can write the view's project; `task.CanWrite` (`pkg/models/tasks_permissions.go:60-62`, delegating to `canDoTask` at lines 65-87) only confirms the caller can write the task's own project. No check compares `task.ProjectID` with `view.ProjectID`, and `updateTaskBucket` adds none.
- Primitive: `b.upsert` (`pkg/models/kanban_task_bucket.go:70-85`, invoked at line 219) inserts the `(task_id, project_view_id, bucket_id)` row; when the target is the done bucket, lines 171-185 update the task's done and date columns.
- Result: A cross-project `task_buckets` row is persisted. It is invisible in the view but counts toward the bucket limit, and a done-bucket target also toggles the task's done state.
Bypass Evidence
The relevant protection is the project-isolation invariant that a task and the view it is placed in must share a project. The strongest candidate guards were examined and each fails to enforce it: `canDoBucket` validates only the caller's authority over the view's own project (`pkg/models/kanban_permissions.go:45-56`); `task.CanWrite` validates only the caller's authority over the task's own project, and because the move handler never sets a differing `ProjectID` on the task bean, the project-change branch in `canDoTask` (`pkg/models/tasks_permissions.go:72-83`) is not exercised; and `updateTaskBucket` performs view/bucket consistency checks (`GetProjectViewByIDAndProject`, `getBucketByID`, `view.ID != bucket.ProjectViewID`) but no task-to-view project comparison. The sibling task-position endpoint carries the exact missing guard at `pkg/models/task_position.go:87-88` (`if view.ProjectID != task.ProjectID { return false, nil }`), confirming by direct comparison that the task-bucket path lacks it. The earlier bucket-endpoint hardening against view mass-assignment added individual-entity checks but, as the inline comment at `pkg/models/kanban_task_bucket.go:64-65` records, deliberately added only a per-task write check rather than a membership check, leaving this relationship unguarded.
Affected Versions
- Ecosystem: `go`
- Package: `code.vikunja.io/api`
- Confirmed affected range: `<= 2.7.0`
- Latest release checked: `2.7.0` (GitHub release v2.7.0
https://github.com/go-vikunja/vikunja/releases/tag/v2.7.0) - Fix status: not fixed
The vulnerable code is present at the examined release 2.7.0 (released 2026-10-02, commit `3ae00e9dedac8673bae36f651f8c6e0a38e82527`). The task-position fix shipped in 2.6.0 did not touch the task-bucket code path, and the earlier bucket-endpoint hardening (released in 2.4.0) added only individual-entity authorization. No released version contains the task-to-view project-membership check for the bucket endpoint, so no fixed version is established. The exact introduction boundary could not be determined from the available checkout; the endpoint predates 2.4.0.
Suggested Fix
Enforce the project-membership invariant before the upsert, mirroring the task-position endpoint. In `TaskBucket.CanUpdate` (or immediately before `b.upsert` in `updateTaskBucket`), load the view by `ProjectViewID` and the task by `TaskID` and reject the request when the task does not belong to the view, in addition to the existing bucket and task write checks. Mirror `pkg/models/task_position.go` including its saved-filter branch (`:79`, before the project guard at `:87`): a bare `view.ProjectID != task.ProjectID` check breaks saved-filter kanban views, whose `ProjectID` is negative and which `canWriteBucketProject` (`pkg/models/kanban_permissions.go:64`) supports. Ensure the check covers both the v1 and v2 routes (both already flow through `TaskBucket.CanUpdate`), and apply it before the done-bucket side effect so a cross-project move cannot mutate the foreign task's done or date fields. As an interim mitigation, operators can limit multi-project and shared-project write access, but this does not fully close the gap for any user who legitimately holds write access to more than one project.
---
Reported by zx.
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 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-w64q-7p4m-j8g8Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
