GHSA-mr3j-p26x-72x4

Suggest an improvement
Source
https://github.com/advisories/GHSA-mr3j-p26x-72x4
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/03/GHSA-mr3j-p26x-72x4/GHSA-mr3j-p26x-72x4.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-mr3j-p26x-72x4
Aliases
Published
2026-03-20T17:25:30Z
Modified
2026-03-25T21:03:44.770536Z
Severity
  • 5.3 (Medium) CVSS_V4 - CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N CVSS Calculator
Summary
Vikunja has an IDOR in Task Comments Allows Reading Arbitrary Comments
Details

An authenticated user can read any task comment by ID, regardless of whether they have access to the task the comment belongs to, by substituting the task ID in the API URL with a task they do have access to.

Details

The GET /api/v1/tasks/{taskID}/comments/{commentID} endpoint performs an authorization check against the task ID provided in the URL path, then loads the comment by its own ID without verifying it belongs to that task.

Root Cause

In pkg/models/task_comment_permissions.go, CanRead constructs a Task using the TaskID from the URL and checks Task.CanRead:

func (tc *TaskComment) CanRead(s *xorm.Session, a web.Auth) (bool, int, error) {
    t := Task{ID: tc.TaskID}
    return t.CanRead(s, a)
}

In pkg/models/task_comments.go, getTaskCommentSimple loads the comment by ID only, with NoAutoCondition() explicitly disabling XORM's implicit struct-field filtering:

func getTaskCommentSimple(s *xorm.Session, tc *TaskComment) error {
    exists, err := s.
        Where("id = ?", tc.ID).
        NoAutoCondition().
        Get(tc)
    // ...
}

The generic web handler (pkg/web/handler/read_one.go) calls CanRead before ReadOne, so the permission check passes against the attacker-controlled task ID, and then ReadOne returns the comment from a completely different task.

Attack Scenario

  1. Attacker is authenticated and has read access to any task (task ID A) — e.g. their own task.
  2. Attacker guesses or enumerates a comment ID (C) belonging to a task in another user's private project.
  3. Attacker requests: GET /api/v1/tasks/A/comments/C
  4. Authorization passes because the attacker can read task A.
  5. The comment C is loaded by ID only and returned, leaking its contents and author.

Credit

This vulnerability was found using GitHub Security Lab Taskflows.

Database specific
{
    "nvd_published_at": "2026-03-24T15:16:35Z",
    "severity": "MODERATE",
    "cwe_ids": [
        "CWE-639"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-03-20T17:25:30Z"
}
References

Affected packages

Go / code.vikunja.io/api

Package

Name
code.vikunja.io/api
View open source insights on deps.dev
Purl
pkg:golang/code.vikunja.io/api

Affected ranges

Type
SEMVER
Events
Introduced
0Unknown introduced version / All previous versions are affected
Last affected
2.1.0

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/03/GHSA-mr3j-p26x-72x4/GHSA-mr3j-p26x-72x4.json"