Summary
Vikunja contains broken authorization checks that expose share hashes and allow attachment operations based on unvalidated identifiers.
Under certain conditions, users with basic read access can escalate to admin-level shares and download or delete file attachments across all projects on a vulnerable instance.
Affected context
This vulnerability manifests in Vikunja's API endpoints responsible for link sharing and task attachments.
It becomes relevant when:
- Users can access the
LinkSharing.ReadAllendpoint and see share metadata beyond their intended scope. - The
GetTaskAttachmentendpoint relies on user-supplied task IDs for permission checks but retrieves attachments by their own sequential IDs.
In environments where these endpoints are exposed to regular project users, the flawed authorization logic can lead to broader access than intended.
Exploit preconditions
- Attack surface: Vikunja HTTP API, specifically link sharing and attachment-related endpoints.
- Required access: Valid user account with at least read-level access to some projects or tasks.
- Trigger points:
- Calling
LinkSharing.ReadAllto enumerate share hashes and associated data. - Invoking
GetTaskAttachmentand related attachment operations using crafted attachment IDs. - Why exploitation is possible:
- The link sharing endpoint exposes share hashes to users who should not control or view admin-level shares, enabling escalation.
- Attachment operations verify permissions against user-supplied task IDs but then act on attachments by globally sequential IDs without enforcing ownership, effectively creating an insecure direct object reference (IDOR) condition.
Why this happens
The core issue is broken object-level authorization, aligning with CWE-639: Authorization Bypass Through User-Controlled Key.
The link sharing endpoint returns sensitive share hashes to any user with read access, treating visibility as equivalent to management authority.
The task attachment endpoint trusts user-supplied task identifiers for the permission check but subsequently uses attachment IDs that are not bound to the user or project context, allowing access to any attachment on the instance.
Conceptually, the design fails to enforce authorization at the resource level (per share, per attachment) and instead relies on loosely related parameters, resulting in users being able to act on objects they do not own.
Potential impact
- Users may escalate from read-level shares to admin-level shares using exposed share hashes.
- Attackers could download arbitrary file attachments across all projects on the instance.
- Sensitive documents and files can be exposed to unauthorized users.
- Malicious users may delete attachments belonging to other projects, causing data loss and disruption.
- Compromise of confidentiality, integrity, and availability of stored project files.
General mitigation guidance
Effective mitigation focuses on enforcing strict, resource-level authorization checks and minimizing exposure of sensitive identifiers.
Recommended patterns include:
- Validating access per share object: ensure that listing or retrieving share hashes is restricted to principals that own or administratively control those shares.
- Binding attachment operations to the authenticated user's accessible projects and tasks, enforcing checks on the actual attachment record rather than only on user-supplied task IDs.
- Avoiding the exposure of powerful tokens or share hashes in broad listing endpoints; treat them as secrets with least-privilege visibility.
- Implementing a consistent authorization layer that evaluates access based on the resource's owner, project, and permission model, rather than trusting client-provided IDs.
- Applying defense-in-depth with role-based access control and limiting destructive operations (such as delete) to appropriate roles and contexts.
How teams detect issues like this
Detection can rely on both code-level and behavioral techniques:
- Static analysis and manual review to identify endpoints where authorization checks depend on user-controlled IDs or where object ownership is not verified at the resource level.
- Reviewing API handlers for list and read-all operations that expose tokens, hashes, or identifiers that can be used to control or access other objects.
- Logging attachment and share operations (download, delete, update) with resource IDs and user identities, and monitoring for patterns where a single user accesses or deletes resources across many unrelated projects.
- Implementing security tests (e.g., unit and integration tests) that simulate cross-project access attempts, ensuring that users are prevented from acting on objects they do not own.
- Using automated API security scanners or authorization-focused tooling that flags insecure direct object references and missing ownership checks.

