{"schema":"threatline.record/2","record":{"id":"CVE-2026-91983","aliases":["GHSA-9rg3-v78m-26q8","GO-2026-6726"],"summary":"Vikunja: API token scopes bypassed via task expand parameter (comments, reactions, time entry counts)","details":"## Summary\n\nAPI token permission checks only match the HTTP method and route path. The `expand` query parameter on task read endpoints embeds data from other permission groups (task comments, reactions, time entry counts) without checking whether the token holds those scopes. A token scoped only to `tasks` read permissions can therefore read task comments and reactions it was explicitly not granted.\n\n## Details\n\n`models.CanDoAPIRoute` (`pkg/models/api_routes.go`, ~line 440) authorises API tokens purely by comparing `method` and `c.Path()` against the routes stored for each granted permission group. The query string is never consulted.\n\nThe task read endpoints accept `expand`:\n\n- `GET /api/v1/tasks/:task`, `GET /api/v1/tasks` (`pkg/models/tasks.go` ReadOne/ReadAll, `pkg/models/task_collection.go`)\n- `GET /api/v2/tasks/:id`, `GET /api/v2/tasks`, `GET /api/v2/projects/:project/tasks` (`pkg/routes/api/v2/tasks.go`, `task_collection.go`)\n\nAccepted values include `comments`, `comment_count`, `reactions`, `time_entries_count`. `addMoreInfoToTasks` (`pkg/models/tasks.go`, ~line 683) loads and embeds that data. At that layer only a `web.Auth` (the plain owner user, resolved by `auth.GetAuthFromClaims`) is available, so the token's scopes cannot be enforced there either.\n\nResult: the `tasks_comments`, `reactions`, and `time_entries` permission groups are advisory for any data reachable through a task expansion.\n\n## Impact\n\nA holder of an API token scoped to `tasks: [read_one]` or `tasks: [read_all]` (or `projects_views_tasks: [read_all]`) can read the full bodies of task comments, all reactions, and time entry counts on every task the token owner can access, despite `GET /api/v1|v2/tasks/:task/comments` and the reactions endpoints correctly returning 401 for the same token.\n\nThe leak is limited to data the token owner can already see, and is read-only. The realistic victim is a user who grants a narrowly scoped token to a third-party integration expecting comments to stay private.\n\n## Proof of Concept\n\nAgainst the test fixtures (`pkg/db/fixtures/api_tokens.yml`, token 1 has `{\"tasks\":[\"read_all\",\"update\"]}`, plaintext `tk_2eef46f40ebab3304919ab2e7e39993f75f29d2e`):\n\n```\nGET /api/v2/tasks/1/comments\nAuthorization: Bearer tk_2eef46f40ebab3304919ab2e7e39993f75f29d2e\n-> 401 {\"code\":11,\"message\":\"missing, malformed, expired or otherwise invalid token provided\"}\n\nGET /api/v2/tasks?expand=comments&filter=id%3D1\nAuthorization: Bearer tk_2eef46f40ebab3304919ab2e7e39993f75f29d2e\n-> 200, response items[0].comments contains the full comment objects\n```\n\nSame behaviour with `expand=reactions`, and on the v1 endpoints `GET /api/v1/tasks?expand=comments` / `GET /api/v1/tasks/1?expand=comments`. Any user-created token with only `tasks` read permissions reproduces this.\n\n## Recommended Fix\n\nEnforce expansions in the single existing choke point, `models.CanDoAPIRoute`: after the method/path match succeeds, read `c.QueryParams()[\"expand\"]` and require the token to hold the owning group's read permission for each value, e.g.\n\n- `comments`, `comment_count` -> `tasks_comments.read_all`\n- `reactions` -> `reactions.read_all`\n- `time_entries_count` -> `time_entries.read_all`\n\n(`subtasks`, `buckets`, `is_unread` are task-level data and need nothing extra.) Doing this in the middleware covers both v1 and v2 without handler or model changes. Add a table-driven test alongside `pkg/webtests/api_token_method_matching_test.go` asserting a `tasks`-only token gets 401 with `expand=comments` and 200 once `tasks_comments.read_all` is added.","categories":["Libraries & packages"],"product":"code.vikunja.io/api","vendor":"go-vikunja","ecosystem":"go","affected_ranges":[{"source":"GitHub Advisory Database","source_url":"https://github.com/advisories/GHSA-9rg3-v78m-26q8","source_modified_at":"2026-10-09T20:51:53Z","fetched_at":"2026-10-23T18:42:43.628194Z","package":{"ecosystem":"go","name":"code.vikunja.io/api"},"range":">= 1.0.0, <= 2.5.0"},{"source":"CVE List","source_url":"https://www.cve.org/CVERecord?id=CVE-2026-91983","source_modified_at":"2026-09-15T15:52:07.941Z","fetched_at":"2026-10-23T18:45:31.882637Z","product":"vikunja","vendor":"go-vikunja","versions":[{"version":"1.0.0","lessThan":"2.6.0","status":"affected","versionType":"semver"},{"version":"2.6.0","status":"unaffected","versionType":"semver"}],"defaultStatus":"unaffected"},{"source":"OSV","source_url":"https://osv.dev/vulnerability/GHSA-9rg3-v78m-26q8","source_modified_at":"2026-10-19T21:41:16.622292055Z","fetched_at":"2026-10-23T18:42:43.628194Z","package":{"ecosystem":"Go","name":"code.vikunja.io/api","purl":"pkg:golang/code.vikunja.io/api"},"ranges":[{"events":[{"introduced":"1.0.0"},{"fixed":"2.6.0"}],"type":"SEMVER"}],"versions":[]}],"fixed_versions":[{"source":"GitHub Advisory Database","source_url":"https://github.com/advisories/GHSA-9rg3-v78m-26q8","source_modified_at":"2026-10-09T20:51:53Z","fetched_at":"2026-10-23T18:42:43.628194Z","package":{"ecosystem":"go","name":"code.vikunja.io/api"},"version":"2.6.0"},{"source":"CVE List","source_url":"https://www.cve.org/CVERecord?id=CVE-2026-91983","source_modified_at":"2026-09-15T15:52:07.941Z","fetched_at":"2026-10-23T18:45:31.882637Z","package":{"name":"vikunja","ecosystem":null},"version":"2.6.0","basis":"first unaffected version stated in the CVE record"},{"source":"OSV","source_url":"https://osv.dev/vulnerability/GHSA-9rg3-v78m-26q8","source_modified_at":"2026-10-19T21:41:16.622292055Z","fetched_at":"2026-10-23T18:42:43.628194Z","package":{"ecosystem":"Go","name":"code.vikunja.io/api","purl":"pkg:golang/code.vikunja.io/api"},"version":"2.6.0"}],"cvss":5.3,"severity":"Medium","kev":{"listed":false},"epss":{"probability":0.00305,"percentile":0.22086,"score_date":"2026-10-23"},"published_at":"2026-09-15T15:18:26.899Z","modified_at":"2026-10-19T21:41:16.622292055Z","provenance":[{"source":"GitHub Advisory Database","url":"https://github.com/advisories/GHSA-9rg3-v78m-26q8","fetched_at":"2026-10-23T18:42:43.628194Z","source_modified_at":"2026-10-09T20:51:53Z"},{"source":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2026-91983","fetched_at":"2026-10-23T18:45:31.882637Z","source_modified_at":"2026-09-15T15:52:07.941Z"},{"source":"OSV","url":"https://osv.dev/vulnerability/GHSA-9rg3-v78m-26q8","fetched_at":"2026-10-23T18:42:43.628194Z","source_modified_at":"2026-10-19T21:41:16.622292055Z"},{"source":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2026-91983","fetched_at":"2026-10-23T18:42:43.628194Z","source_modified_at":"2026-10-23"}],"sources":["GitHub Advisory Database","CVE List","OSV","EPSS"],"references":[{"source":"CVE List","url":"https://github.com/go-vikunja/vikunja/security/advisories/GHSA-9rg3-v78m-26q8","tags":["exploit"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-91983","source":"GitHub Advisory Database"},{"url":"https://github.com/go-vikunja/vikunja/pull/3688","source":"GitHub Advisory Database"},{"url":"https://github.com/go-vikunja/vikunja/commit/077dc4de79ce6f1ab59215a2c7bf9b30423685f2","source":"GitHub Advisory Database"},{"url":"https://github.com/go-vikunja/vikunja/releases/tag/v2.6.0","source":"GitHub Advisory Database"},{"source":"CVE List","url":"https://www.vulncheck.com/advisories/vikunja-before-2.6.0-api-token-scope-bypass-via-expand-parameter","tags":["third-party-advisory"]},{"url":"https://github.com/advisories/GHSA-9rg3-v78m-26q8","source":"GitHub Advisory Database"}],"locations":[],"motoko_assessment":{"status":"requires_architecture_review","automatic_remediation":false},"cve_state":"PUBLISHED","ssvc":{"exploitation":"poc","automatable":"no","technical_impact":"partial","assessed_at":"2026-09-15T15:51:30.464514Z"},"classification":{"method":"product-first software-layer rules","rules_version":"2.1","matched_on":"ecosystem","confidence":"heuristic","reviewed":false},"change_timestamp":"2026-10-19T21:41:16.622292055Z","content_hash":"4539fb6699d83882c14d38cb391ccb5effc1b6a98cd3f6784f8b95ee38738360"}}
