Summary
Vikunja's project reparenting logic allowed users with only inherited Write access to escalate their privileges to Admin on a project by moving it under a project they own.
Because the system computed permissions via a recursive hierarchy query, changing a project's parent could unintentionally upgrade the user's effective permission level, granting administrative control they were not meant to have.
Affected context
This vulnerability affects Vikunja instances where:
- Projects are organized in hierarchical trees (parent/child relationships).
- Permissions are inherited from parent projects using a recursive CTE or similar hierarchical permission computation.
- Users can move (reparent) projects by changing
parent_project_idbased solely on having Write permission on the new parent.
In such setups, permission inheritance and ownership semantics intersect in ways that can unintentionally elevate a user's effective rights when the project hierarchy is modified.
Exploit preconditions
- Attack surface: Application-level project management interface (web UI or API).
- Required access:
- An authenticated user account.
- Inherited Write permission on a project via a parent project share (not direct Admin on the project itself).
- Ownership (or Admin-level rights) on a different project tree that can serve as a new parent.
- Trigger point: Changing the
parent_project_idof a project so that it becomes a child of a project where the attacker has stronger permissions. - Why exploitation is possible: The
CanUpdatecheck only verifies that the user can Write to the new parent project. After reparenting, the recursive CTE re-evaluates permissions and, due to inheritance rules, treats the user as Admin on the moved project, effectively upgrading their rights beyond what was originally granted.
Why this happens
The underlying issue is an improper privilege management design in the project permission model, aligning with CWE-269.
Vikunja computes permissions using a recursive CTE across the project hierarchy, with inheritance rules that derive a user's effective permission from parents. The update logic for changing a project's parent (parent_project_id) only enforced a CanWrite requirement on the new parent but did not reason about how reparenting would alter the effective permission chain.
As a result, a user who had limited, inherited Write access to a project could move it into a hierarchy where they hold stronger rights (Admin/owner), causing the permission calculation to reclassify their level on the moved project as Admin. The permission check evaluated the state before hierarchy change too narrowly and did not constrain the resulting post-change permission level, enabling privilege escalation through data model manipulation rather than direct role assignment.
Potential impact
- A user with inherited Write access on a project may become Admin on that project after reparenting it under their own project tree.
- Users can gain the ability to modify or delete projects they were only meant to contribute to.
- Unauthorized management of project-level configuration, sharing, or access control may become possible.
- Potential exposure, modification, or deletion of tasks, attachments, and associated project data that should remain under stricter control.
- In multi-tenant or shared environments, one collaborator could extend their control beyond what the project owner intended.
General mitigation guidance
Effective mitigation focuses on making hierarchy-changing operations privilege-safe and aligning them with the intended permission semantics:
- Require a higher permission level (e.g., Admin or equivalent) on the project being moved, not just on the new parent, before allowing reparenting.
- When permissions are computed via inheritance, design update paths so that they cannot be used to alter the inheritance chain in a way that increases the user's own effective rights without an explicit grant.
- Introduce explicit invariants: for example, disallow any move that would increase a user's effective permission level on the moved resource unless an administrator or owner explicitly approves it.
- Centralize permission checks around high-risk operations (reparenting, bulk moves, transfers of ownership) to avoid one-off logic that bypasses the overall security model.
- Prefer secure-by-default permission models where inheritance cannot silently convert contributor roles into administrative roles through structural changes alone.
How teams detect issues like this
Organizations can look for this class of issue through:
- Static analysis and code inspection:
- Identify operations that modify hierarchical relationships (e.g.,
parent_project_id, folder trees, group membership) and verify they require sufficiently strong permissions on both the target resource and its container. - Review uses of recursive CTEs or hierarchical permission calculations to ensure that structural mutations cannot raise the actor's effective privilege without explicit checks.
- Security-focused code review:
- Flag any logic that checks permissions only on the container (parent) while performing impactful changes on the contained resource.
- Examine "move", "transfer", or "reparent" endpoints for symmetry with "delete" and "ownership change" permission requirements.
- Policy and test enforcement:
- Add regression tests that simulate users with inherited permissions attempting hierarchy changes and assert that their effective permissions do not silently increase.
- Use automated code review tools or linters to enforce patterns such as "modifying resource relationships must invoke centralized permission helpers" rather than ad-hoc checks.

