/

CVE-2026-33678

Severity:

HIGH RISK

(8.1)

Insecure Direct Object Reference (IDOR) in Vikunja Task

CVE-2026-33678

Analyzed

Vulnerability type

Category:

Insecure Direct Object Reference (IDOR)

CWE:

CWE-639

Impact:

Unauthorized Access and Modification of Attachments Across Projects

Severity:

HIGH RISK

(8.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Vikunja's task attachment handler previously loaded attachments solely by their numeric ID, ignoring the task context supplied in the request URL.

As a result, any authenticated user could pair a task they can access with an arbitrary attachment ID and download or delete attachments belonging to other tasks and projects.

Affected context

The vulnerability occurs in Vikunja's task attachment API, specifically in logic that reads a single attachment.

The TaskAttachment.ReadOne() function constrained the database query by attachment ID only, while permission checks in CanRead() were tied to the task ID from the URL.

In deployments where attachment IDs are sequential and globally visible to authenticated users, this mismatch between authorization context (task) and data lookup (attachment) makes horizontal privilege escalation possible.

Exploit preconditions

  • Attack surface: Vikunja HTTP API endpoints that serve download or delete operations for task attachments.
  • Required access: Any authenticated Vikunja account with access to at least one task that legitimately contains an attachment.
  • Trigger point: Issuing a request that supplies:
  • A task ID for which the attacker has read/delete rights, and
  • A target attachment ID belonging to some other task/project.
  • Why exploitation is possible: The permission check validates access to the task from the URL (CanRead()), but TaskAttachment.ReadOne() fetches the attachment purely by its ID (WHERE id = ?) without verifying that it belongs to that task, enabling cross-task attachment access.

Why this happens

This issue is a classic IDOR / broken object-level authorization problem mapped to CWE-639.

Authorization logic is bound to one resource (task), but the actual database lookup for the sensitive object (attachment) does not enforce that relationship.

The code trusts a single global attachment ID as sufficient to identify the resource, instead of treating it as scoped to a parent task or project.

Without a join or additional predicate tying attachment.id to the authorized task.id, any valid attachment ID becomes accessible to any user who can pass the initial task-level permission check.

Potential impact

  • Unauthorized download of attachments from tasks in other projects.
  • Unauthorized deletion of attachments belonging to other users or teams.
  • Exposure of sensitive information stored in attachments, such as documents, credentials, or internal files.
  • Indirect information disclosure through enumeration of attachment IDs and observing which IDs are valid.
  • Damage to data integrity where critical attachments are removed or tampered with.

General mitigation guidance

Effective mitigation focuses on enforcing object-level authorization that is consistently scoped to the correct parent resource:

  • Ensure all attachment queries include constraints that bind them to the authenticated user's authorized context, such as WHERE id = ? AND task_id = ?.
  • Model attachments as children of tasks/projects in both the data layer and the authorization layer, so access is always checked against the parent entity.
  • Centralize authorization checks for object retrieval and deletion to avoid drift between what is authorized (task) and what is actually loaded (attachment).
  • Treat globally sequential identifiers as untrusted; design APIs assuming that IDs can be guessed or enumerated and must be revalidated server-side.
  • Apply least-privilege access patterns so that general authenticated users have only the minimal required permissions on attachments.

How teams detect issues like this

Detection strategies generally revolve around identifying missing or inconsistent object-level authorization:

  • Static analysis: Search for data access patterns where child objects (e.g., attachments) are looked up solely by primary key without complementary predicates tying them to a parent resource or current user.
  • Code review: Flag controller or handler methods where:
  • Authorization is performed on one entity (task/project) but database queries operate on another (attachment/file) without enforcing the relationship.
  • Sequential or globally unique IDs are used directly from request parameters with no additional checks.
  • Automated tests: Add regression tests that simulate a user trying to access an attachment from a task or project they do not own, ensuring access is denied.
  • Runtime monitoring: Instrument APIs to log mismatches between the task ID in the URL and the task ID associated with the fetched attachment, then alert on suspicious patterns.

Sources

SourceLink
github.comgithub.com/go-vikunja/vikunja/security/advisories/GHSA-jfmm-mjcp-8wq2
vikunja.iovikunja.io/changelog/vikunja-v2.2.2-was-released

Frequently asked

questions

Yes, but only by authenticated users. Any user who can log in and access at least one task with attachments can exploit the issue over the Vikunja HTTP API.

No. Basic authenticated access is sufficient. The attacker does not need admin or project-owner rights; they only need any task they can legitimately access as a carrier for arbitrary attachment IDs.

The robust fix is to enforce object-level authorization by constraining attachment queries to both the attachment ID and its parent context (such as the task or project ID), and ensuring that the same context is used for both permission checks and database lookups.

Design APIs so that every access to a child resource is explicitly scoped to a parent entity (e.g., /tasks/{task_id}/attachments/{id}) and ensure the implementation verifies that relationship in the data layer. Combine this with consistent authorization checks, static analysis rules for unscoped ID lookups, and security-focused code reviews.

Find out what's already
exploitable in your codebase.