Summary
Vikunja through version 2.4.0 contains a principal-type confusion vulnerability in permission checks involving LinkSharing principals. An attacker with a link-sharing JWT may cause a link-share identifier to be interpreted as a user identifier, potentially enabling unauthorized team changes, bot-user enumeration or deletion, and team-roster disclosure when identifiers collide.
Affected context
The vulnerability occurs in Vikunja permission checks that process LinkSharing principals and compare their identifiers with user identifiers without consistently validating the principal type. Risk is present when an attacker possesses a valid link-sharing JWT and identifier values overlap in the relevant autoincrement spaces.
Exploit preconditions
- Attack surface: Vikunja team and user-management permission checks
- Required access: A valid link-sharing JWT with permissions reaching an affected operation
- Trigger point: Authorization decisions involving link-share or user principals
- Why exploitation is possible: Missing principal-type guards allow a LinkSharing identifier to be treated as a user identifier when numeric IDs collide
Why this happens
The underlying bug is a failure to preserve and validate principal type during authorization decisions. Permission checks use an identifier without confirming whether it belongs to a LinkSharing principal or a user principal, allowing a value associated with one identity class to select an object in another class. This maps to CWE-639: Authorization Bypass Through User-Controlled Key, because an attacker-controlled or attacker-influenced key affects access control without adequate object and type validation.
Potential impact
- An attacker may remove victims from teams
- Victim bot users could be enumerated or deleted
- Team rosters may be disclosed to unauthorized link-share users
- Team membership and automation resources could be disrupted
- Conflicting principal identifiers could cause broader authorization errors
General mitigation guidance
Mitigation generally focuses on making authorization decisions type-aware and binding every identifier to the intended principal class.
Common defensive patterns include:
- Enforcing explicit principal-type checks before resource lookup and authorization
- Using strongly typed identity representations rather than bare numeric identifiers
- Binding authorization decisions to the authenticated principal and intended resource type
- Applying deny-by-default behavior when identity type or ownership is ambiguous
- Limiting link-sharing privileges to the minimum required operations
- Avoiding reliance on identifier uniqueness across unrelated principal namespaces
- Adding regression tests for identifier collisions and cross-type access attempts
How teams detect issues like this
Organizations can look for this class of issue through:
- Static analysis rules that flag authorization lookups using untyped or user-controlled identifiers
- Code review checks for missing principal-type or resource-type validation
- Tests that exercise collisions between link-share, user, bot, and other identity namespaces
- Policy enforcement requiring authorization checks to occur after identity and resource type resolution
- Audit-log monitoring for unusual team removals, bot-user deletions, or roster access through link-sharing sessions
- Automated security review tools that identify cross-object authorization flows

