Summary
Vikunja's link sharing implementation allowed users with a read-only share link to list all link shares for a project, including the secret hashes used to authenticate other roles.
By abusing the ReadAllWeb handler, an attacker could obtain hashes for write or admin link shares on the same project and escalate their privileges to full admin access.
Affected context
This vulnerability occurs in Vikunja instances that expose project link sharing features and allow multiple link shares with different permission levels (read, write, admin) on the same project.
It specifically involves the LinkSharing.ReadAll() logic exposed through the ReadAllWeb handler, which returns all link shares for a project to an authenticated link share user without enforcing per-share authorization checks.
The risk is present when users rely on link shares for delegating access instead of individual user accounts and when link share secrets are treated as the sole authentication factor.
Exploit preconditions
- Attack surface: HTTP API / web interface for link sharing in Vikunja projects.
- Required access: Possession of any valid link share for a target project (e.g., a read-only link share URL).
- Trigger point: Invoking the endpoint backed by
LinkSharing.ReadAll()viaReadAllWeb, which enumerates link shares for the project. - Why exploitation is possible: The
ReadAllWebhandler does not callLinkSharing.CanRead()or an equivalent per-share authorization check, allowing any link share-authenticated user to retrieve all link share definitions and their secret hashes. Those hashes can then be reused to authenticate as higher-privileged link shares (write/admin).
Why this happens
The underlying issue is an improper access control pattern where authorization checks are inconsistently applied across related operations.
While LinkSharing.CanRead() is used to guard access to individual shares via ReadOne, the bulk listing path (ReadAllWeb → ReadAll) omits this check, effectively treating possession of any project link share as sufficient to enumerate all shares.
This maps to CWE-285: Improper Authorization, where an endpoint fails to enforce the intended authorization policy and exposes sensitive authentication material (secret hashes for other shares).
Conceptually, the bug arises from:
- Having multiple roles or privilege levels encoded in separate link shares.
- Exposing an aggregation/list API that returns all authorization tokens (link share hashes) to any caller with minimal privileges.
- Not centralizing authorization logic, leading to inconsistent enforcement between "read one" and "read all" operations.
Potential impact
- Escalation from read-only link share access to write or admin level within the same project.
- Unauthorized modification or deletion of tasks, lists, and project data.
- Addition or alteration of project configuration, integrations, or metadata controlled by admin-level permissions.
- Impersonation of higher-privileged project access for social engineering or further compromise.
- Potential leakage of additional sensitive link shares that might be reused across other contexts if operators follow insecure practices.
General mitigation guidance
Effective mitigation focuses on enforcing consistent, centralized authorization checks and avoiding exposure of raw authentication tokens:
- Route all link sharing operations (list, read, create, update, delete) through a shared authorization layer that uniformly applies the same policy (e.g., always invoking a
CanRead/CanManageequivalent). - Treat link share secrets and hashes as sensitive authentication material and avoid returning them in list responses, especially to users authenticated via another link share.
- Implement least privilege semantics for link shares—link-based identities should only see their own share and derived permissions, not the full set of project shares.
- Consider scoping link share identifiers and secrets so that they cannot be used across multiple privilege levels or projects.
- Apply defense-in-depth by logging and rate-limiting link share listing endpoints and by limiting how many active link shares can exist per project.
How teams detect issues like this
Detection and assurance strategies can focus on both code-level and runtime signals:
- Static analysis / code scanning:
- Flag handlers or controllers that return collections of security-sensitive records (e.g., API keys, tokens, link share secrets) without calling a common authorization helper.
- Search for differences between "read one" and "read all" paths to ensure they share the same access control checks.
- Code review practices:
- Review list endpoints (
ReadAll,List*,GetAll*) to ensure they filter results based on the caller's identity and permissions, rather than simply using project-level scoping. - Verify that no endpoint returns raw authentication or secret fields once a user is already authenticated with another token.
- Runtime monitoring:
- Log calls to link sharing APIs, including which identity type (user vs link share) is used, and alert on unusual enumeration patterns.
- Apply security testing or fuzzing tools to enumerate link sharing endpoints and verify that lower-privileged link shares cannot discover or reuse higher-privileged tokens.
- Automated review and CI integration can regularly scan for newly introduced endpoints that handle link shares or other secret-bearing objects.

