Vikunja: CalDAV relation creation bypasses TaskRelation.CanCreate, allowing an unauthorized write into any task by known UIDGHSA-g38j-7v97-x298
Fix: go-vikunja/vikunja#3688GHSA-g38j-7v97-x298 is a security vulnerability in code.vikunja.io/api. A fix is available for code.vikunja.io/api — see the affected versions and patch details below.
Real-World Exposure
code.vikunja.io/apiReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Go packages — download data is not available via public APIs for these ecosystems.
Description
Summary
Creating a task relation over CalDAV does not run the TaskRelation.CanCreate permission check that the REST API enforces. An attacker can attach a relation to any task whose UID they know, including tasks in projects they have no access to. The identical operation over REST is correctly refused with 403.
Details
persistRelations (pkg/routes/caldav/listStorageProvider.go, ~line 986) resolves the related task with an unscoped UID lookup (models.GetTaskSimpleByUUID) and calls rel.Create(s, a) directly, with no CanCreate check. pkg/caldav/parsing.go maps RELATED-TO;RELTYPE=CHILD to RelationKindSubtask. Because the CalDAV path never invokes the model's permission method, an authenticated user can create a subtask/parent relation between a task they own and an arbitrary victim task identified only by its UID.
Task UIDs are json:"-" (never exposed over REST) but are exposed over CalDAV to anyone who has ever had read access to the containing project. Revoking that access does not unlearn the UID, so the realistic attacker is a removed collaborator.
This write primitive also feeds the cross-project subtask-disclosure issue (GHSA-3hc7-r24j-rpwc): it lets an attacker create the very cross-project subtask edge that read path leaks across, removing that finding's "the attacker cannot create one to a project they can't access" precondition.
A secondary effect of the same unchecked path: the createDummy branch can Create a task unchecked when the referenced UID does not resolve.
PoC (verified at runtime against v2.5.0, commit c775a6c8)
Baseline control — REST refuses:
PUT /api/v1/tasks/{attackerTask}/relations (attacker JWT)
{"task_id":{attackerTask},"other_task_id":{victimTask},"relation_kind":"subtask"}
-> HTTP 403 Forbidden
Exploit — CalDAV succeeds:
PUT /dav/projects/{attackerProject}/{attackerTaskUID}.ics (BasicAuth attacker)
BEGIN:VCALENDAR
VERSION:2.0
BEGIN:VTODO
UID:{attackerTaskUID}
RELATED-TO;RELTYPE=CHILD:{victimTaskUID}
END:VTODO
END:VCALENDAR
-> HTTP 201
Result: a task_relations row is written with task_id={victimTask}, relation_kind=parenttask, created_by_id={attacker} — a persisted, attacker-attributable write onto a task in a project the attacker cannot access.
Impact
Broken access control (missing authorization) on relation creation. An attacker can pollute the relation set of arbitrary tasks by UID and create the cross-project edges that enable subtask disclosure. Read of the related task's contents still requires the separate disclosure path; this finding is the unauthorized write.
Fix
Route CalDAV relation creation through TaskRelation.CanCreate, and scope the UID lookup to projects the caller can access.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐹Go | code.vikunja.io/api | all versions | 2.6.0go get code.vikunja.io/api@v2.6.0 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for code.vikunja.io/api, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update code.vikunja.io/api to 2.6.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-g38j-7v97-x298 is resolved across your whole dependency graph.
Workarounds
Put an independent control in front of the weakness: restrict the affected endpoint or interface to trusted networks, require an additional authentication factor or proxy-level check, and invalidate existing sessions and credentials in case the flaw has already been used.
Frequently Asked Questions
Is GHSA-g38j-7v97-x298 in your dependencies?
Find it across Go, including transitive dependencies.