GHSA-fprf-r6rv-xg99: SQL Injection

Published Oct 9, 2026
·
Updated

Summary

In Vikunja v2.6.0 the task position recalculation that runs when a saved filter view is created fails open when the requesting user has no accessible projects. Instead of aborting, the search that feeds the recalculation loses its project scope entirely and returns every task in the instance. The server then writes one taskpositions row per task per view (four views per filter) into views owned by the requesting user, including rows that reference tasks of other tenants the user can never see. Any authenticated user can trigger this. The impact is a cross-tenant integrity violation, a single-request write amplification primitive that scales with instance size, and a violation of the invariant stated in the fix for GHSA-w39f-h553-h2mx that position writes are scoped by project read access.

Details

Vikunja computes kanban and list ordering in a shared taskpositions table keyed by (taskid, projectviewid). When a saved filter is created, SavedFilter.Create (pkg/models/savedfilters.go:130) calls CreateDefaultViewsForProject (pkg/models/projectview.go:816) which, for every default view it creates, calls RecalculateTaskPositions with addExistingTasksToView = true (pkg/models/projectview.go:447).

RecalculateTaskPositions (pkg/models/taskposition.go:312) builds a TaskCollection and, for filter views (view.ProjectID < -1), resets the project scope to zero and injects the saved filter's filter string. The scope of the subsequent search is derived from getRelevantProjectsFromCollection (pkg/models/taskcollection.go:188), which for ProjectID == 0 returns exactly the projects the requesting user can access.

Inside dbTaskSearcher.Search (pkg/models/tasksearch.go), the WHERE clause is assembled at line 632:

go cond := builder.And(builder.Or(projectIDCond, favoritesCond), where, filterCond)

projectIDCond is only set when len(opts.projectIDs) > 0 and favoritesCond only when the caller opted into the favorites arm, which RecalculateTaskPositions never does. With zero accessible projects, an empty filter string (which produces no filter condition in getTaskFiltersFromFilterString) and no search string, all four children of the builder.And are invalid. go-xorm's condition builders silently drop invalid children, so the query becomes SELECT ... FROM tasks with no WHERE clause at all.

The result is written back unconditionally: the function deletes the view's position rows and bulk-inserts one row per returned task per view. Because the filter creation path runs this for four default views, one request writes 4 x totaltaskcount rows, every one of them referencing tasks the requesting user has no relationship with, including tasks in other users' private projects.

Reaching the zero-project precondition does not require any bug beyond this one. UpdateUserGeneralSettings (pkg/models/usersettings.go:105) assigns defaultprojectid from the request body without validating that the referenced project exists or belongs to the caller. A user can therefore point their default project at any project id, which unblocks deleting their own Inbox (deletion is refused only while the Inbox is the default project, error 3012 in pkg/models/error.go:482). After the Inbox is gone, getRawProjectsForUser returns an empty list.

Two neighboring controls confirm the intended invariant exists elsewhere and is enforced in sibling paths. The event-driven filter update path gates candidate filters on the filter owner's access to each task's project (matchTasksToViewsOfFilter, introduced by commit b1ad4063e7), and the fix for GHSA-w39f-h553-h2mx validates position target views. The recalculation path on filter creation has no equivalent gate and contradicts the advisory statement that recalculation "aborts on its own project read-access check".

PoC

vikunja-filter-empty-scope-cross-tenant-positions-PoC.zip

The attached archive contains deployment/deploy.sh (local Vikunja v2.6.0 on loopback with SQLite) and poc/poc.sh, which performs the full sequence:

1. Victim registers, creates a private project and a task. 2. Attacker registers, sets defaultprojectid to the victim's project via PUT /api/v2/user/settings/general, deletes their own Inbox, and now has zero accessible projects. 3. Control: GET /api/v2/projects/{victim} returns 403. 4. Attacker creates a saved filter with {"filter":"","filterincludenulls":true}. 5. Verification: direct SQLite inspection shows taskpositions rows referencing the victim's task in all four of the attacker's filter views. 6. Control: GET /api/v2/projects/{filterpseudoproject}/tasks returns 0 items, so the written rows are not readable back through collection endpoints.

Result: 10 checks passed on two consecutive runs, each from a wiped database.

Impact

An authenticated user, even one with no project access at all, causes the server to persist cross-tenant references: rows pointing at arbitrary other users' tasks are written into views the attacker controls. Task content is not exposed through the documented read paths (verified), so this is an integrity and availability issue rather than a direct disclosure:

- Cross-tenant integrity violation. The taskpositions state of the attacker's views now encodes other tenants' objects, against the access model the rest of the code enforces. - Write amplification and denial of service. One cheap request performs a full-table scan plus 4 x N inserts, where N is the number of tasks in the instance. On an instance with 100,000 tasks that is 400,000 rows per request, and the request can be repeated without bound. CPU, IO and storage costs scale with instance size while attacker cost stays constant.

Affected Software

1 affected component
go/code.vikunja.io/api>=1.0.0-rc0<=2.6.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade Vikunja to a version that resolves this vulnerability.

    Patch GHSA-w39f-h553-h2mx

Event History

Oct 9, 2026
Advisory Published
via GitHub·08:57 PM
Data Sourced
via GitHub·08:57 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

Which users can trigger the issue?

Any authenticated user can trigger it by creating a saved filter when they have no accessible projects. No user interaction beyond the request is required.

2

What happens when the vulnerable path is triggered?

The task search loses its project scope and returns every task in the instance. The server writes task_positions rows into views owned by the requester, including rows that reference tasks belonging to other tenants.

3

What is the operational impact of a single trigger?

Creating the saved filter creates four default views, and the server writes one task_positions row per task for each view. This produces write amplification that scales with the total number of tasks in the instance.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203