# GHSA-w2ch-4xgr-22ww: Vikunja: Task relation deletion does not check read access to the other task, allowing cross-project relation removal

> Authenticated users with write access to one project can delete task relations linking to inaccessible projects, causing unauthorized data modification.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 9 Oct 2026
- **Also known as:** GO-2026-6754

## What is GHSA-w2ch-4xgr-22ww?

GHSA-w2ch-4xgr-22ww is a missing authorization vulnerability in code.vikunja.io/api, published on 9 Oct 2026. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

## Summary

Deleting a task relation only requires write access on the base task. Unlike relation creation, it does not verify that the caller can read the other task. A user with write access to one project can therefore delete relations whose other end lives in a project they have no access to. Since the delete removes both the forward and inverse rows, the relation also disappears for the other project's members.

## Details

`TaskRelation.CanCreate` (`pkg/models/task_relation_permissions.go:32-52`) requires write access on `TaskID` **and** read access on `OtherTaskID`.

`TaskRelation.CanDelete` (`pkg/models/task_relation_permissions.go:25-29`) only checks `Task{ID: rel.TaskID}.CanUpdate(s, a)`; `OtherTaskID` is never authorized.

`TaskRelation.Delete` (`pkg/models/task_relation.go:314-354`) then deletes both the `(task_id, other_task_id, kind)` row and its inverse, so the relation is removed from the far task as well.

Affects `DELETE /api/v1/tasks/{id}/relations/{kind}/{otherTaskId}` and the equivalent v2 endpoint.

## Impact

Low, integrity only. An authenticated user holding write permission on a shared project can remove task relations that link into projects they cannot read. No data is disclosed and no privilege is gained; the attacker cannot recreate the relation. The far project's owner sees the relation vanish without indication of who removed it.

Preconditions: the attacker has write access to a project containing a task that is already related to a task in a project they cannot access.

## Proof of Concept

1. As `owner`, create project `P_near` with task `near` and project `P_far` with task `far`.
2. Share `P_near` with `attacker` at write permission (`permission: 1`). Do not share `P_far`.
3. As `owner`: `PUT /api/v1/tasks/{near}/relations` with `{"other_task_id": far, "relation_kind": "related"}` -> 200.
4. As `attacker`: `GET /api/v1/tasks/{far}` -> 403 (confirms no access).
5. As `attacker`: `PUT /api/v1/tasks/{near}/relations` with the same body -> 403 (create path is enforced).
6. As `attacker`: `DELETE /api/v1/tasks/{near}/relations/related/{far}` -> 200 `"Successfully deleted."`
7. As `owner`: `GET /api/v1/tasks/{far}` -> `related_tasks` is now empty.

Reproduced against `vikunja/vikunja:2.5.0`.

## Recommended Fix

Make `CanDelete` mirror `CanCreate`: after checking `CanUpdate` on the base task, also require `CanRead` on `OtherTaskID`.

## Which versions are affected by GHSA-w2ch-4xgr-22ww?

3 open source packages ship an affected version, including code.vikunja.io/api.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `code.vikunja.io/api` | Go | All versions | None |
| `code.vikunja.io/api` | Go | From 0.9 | 2.6.0 |
| `code.vikunja.io/api` | Go | From 0.9 | 2.6.0 |

## How do I fix GHSA-w2ch-4xgr-22ww?

Upgrade code.vikunja.io/api to 2.6.0 or later.

## Is GHSA-w2ch-4xgr-22ww being exploited?

There is no known exploitation of GHSA-w2ch-4xgr-22ww in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-w2ch-4xgr-22ww and fix it if it is affected.

What it is: GHSA-w2ch-4xgr-22ww is a missing authorization vulnerability in code.vikunja.io/api, published on 9 Oct 2026. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-w2ch-4xgr-22ww in the wild and no public exploit code.

Affected packages and fixed versions:
- code.vikunja.io/api (Go): affected all versions; no fix listed
- code.vikunja.io/api (Go): affected from 0.9; fixed in 2.6.0
- code.vikunja.io/api (Go): affected from 0.9; fixed in 2.6.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-w2ch-4xgr-22ww/ (Markdown: https://insights.sbomify.com/GHSA-w2ch-4xgr-22ww/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-w2ch-4xgr-22ww

---
From sbomify Insights: https://insights.sbomify.com/GHSA-w2ch-4xgr-22ww/
Summaries are generated and may contain mistakes; the official description above is the record.
