Background
Vikunja is an open-source, self-hostable task and project manager. People use it to keep to-do lists and manage team projects. Besides its regular HTTP API, it has a WebSocket endpoint at /api/v2/ws. A WebSocket is a long-lived connection that stays open so the server can push live updates and notifications to the browser without being asked.
Logins in Vikunja are sessions. When a user signs in, the server creates a session record and gives the client a signed JWT access token that includes the session’s ID (the sid claim). A user can see their active sessions, for example on other devices, and delete (revoke) any of them, for instance after losing a phone.
Terms used below:
- JWT (JSON Web Token) is a signed token. The server can verify the signature without a database lookup, which is fast, but also means the token stays valid until it expires unless the server checks something else.
- Revocation is the act of cancelling a login before its token would have expired.
- Hub is the part of the server that keeps track of connected WebSocket clients and sends them events.
Summary
The WebSocket authentication path accepts a valid access token without checking whether its server-side session has been revoked. A socket authenticated before revocation can therefore keep receiving private notifications, and the same token can open a new socket while it remains valid.
A JWT signature establishes that the token was issued by the application. The session record determines whether that login is still authorized. Deleting the session should affect the live channel as well as other login mechanisms. Here, the connection retains its authenticated identity after the session is removed. Because server-pushed messages do not trigger a fresh HTTP authentication check, an established socket can remain useful beyond the access token’s normal lifetime.
How the Vulnerability Works
Signed tokens bring a trade-off. A JWT proves that the server issued it, but it says nothing about whether the login is still wanted. To support “log out of this device”, Vikunja stores a server-side session row and expects its checks to look at that row. If a check looks only at the signature, a revoked login keeps working until the token’s expiry.
For the HTTP API, Vikunja relies on short-lived access tokens (10 minutes) and invalidates a session’s refresh token when the session is deleted, so a revoked login stops working within minutes. The WebSocket path has no equivalent limit. The client opens a socket and sends its token as the first message. The server calls auth.GetUserIDFromToken, which validates the JWT and returns the user, and it never looks up the session. Two problems follow:
- Admission. After the user revokes a session, someone holding that session’s still-unexpired token can open a new WebSocket and be accepted.
- Connection lifetime. A socket that was already open and registered with the hub keeps receiving events after the revocation. Messages pushed by the server do not trigger any new authentication check, so the connection continues to hold the identity it was given.
1. Attacker has the victim's access token (for example from a compromised device)
2. Attacker opens /api/v2/ws and authenticates -> accepted
3. Victim notices the problem and revokes the session
4. Attacker's socket stays connected -> still receives private notifications
5. New socket with the same token before it expires -> also acceptedA WebSocket stays open until the client closes it, so the 10-minute token lifetime does not bound it. Enabling TOTP, which is documented as invalidating all sessions, has the same blind spot. This does not give an attacker a way to get a token. It undermines the main tool the victim has for recovering from a stolen one. A user who clicks “log out of that device” reasonably expects the access to end then. Instead, the live channel carries on, and can outlive the token itself because an accepted connection is never rechecked.
The fix is for admission to resolve the token’s session ID against active sessions, and for the server to close or revalidate open connections when their session is deleted. The weakness is insufficient session expiration (CWE-613).
Prerequisites
The attacker must already possess the victim’s valid access token, for example from a compromised device. This finding concerns the access that remains after revocation. It does not provide a way to obtain the token.
The attacker can either establish a socket before the session is deleted or reconnect with the deleted session’s token while that token is still valid. Authentication with an expired or invalid token is outside the demonstrated admission bypass.
Attack Path
- STARTAttacker possesses a valid user access token
- STEP 01Authenticate at /api/v2/ws
A valid signature alone does not establish that the session is still authorized.
MITIGATION Resolve the JWT session ID against active server-side sessions
- STEP 02Keep a socket open while the user revokes its session
- STEP 03Remain subscribed after revocation
MITIGATION Disconnect or revalidate connections when their session is deleted
- STEP 04Receive subsequent private notifications
Root Cause
Vikunja access tokens include a sid claim identifying a server-side session. The WebSocket endpoint at GET /api/v2/ws authenticates through the first client message, using auth.GetUserIDFromToken. That path checks the JWT but does not consult the corresponding session row. Consequently, deleting the row has no effect on a subsequent socket authentication while the access token remains valid.
The second failure concerns already established connections. Once registered with the hub, the connection receives subscribed events without another session-state check. Token expiry limits how long an old token can open a new connection, but it does not automatically terminate a connection accepted earlier. Both admission and connection lifetime must enforce revocation.
Validation
The proof of concept on v2.6.0 first established an authenticated socket and subscribed to notification.created. It then deleted all victim sessions and confirmed that the session list was empty. Two separate observations followed: a fresh socket accepted the old token, and the original socket received a new notification after another user mentioned the victim in a task comment.
The fresh connection confirms the missing session lookup. The existing connection confirms that session deletion does not disconnect subscribers. A garbage token was rejected, so the test did not bypass JWT signature validation.
| Connection state | Expected after revocation | Recorded behavior |
|---|---|---|
| Invalid token | Reject authentication | Rejected |
| New connection, still-valid token for deleted session | Reject authentication | Accepted |
| Connection authenticated before session deletion | Stop private pushes | Received a later notification |
Impact
After revocation, the live channel can still expose notification payloads containing task, project and comment information. A user may see an empty session list while a previously authenticated device remains subscribed to new events.
The exposure is limited to notifications the victim is otherwise authorized to receive. It does not demonstrate access to unrelated accounts or the ability to open a new socket with an expired token. The long-lived connection, rather than indefinite reuse of the token for new connections, is what can outlast the short REST access-token lifetime.
Remediation
Upgrade to Vikunja 2.7.0 or later. The linked patch addresses this finding. The repository advisory page still says no patched version. The required boundary is session validation at authentication plus disconnection or revalidation after revocation.
Checking session existence only when the socket opens addresses the reconnect case but leaves existing sockets alive. Associate hub connections with their session IDs so session deletion can close the affected connections, or periodically revalidate session state with a bounded delay. Session-wide invalidation actions, including TOTP enrollment, should use the same mechanism.
Regression coverage should check both a socket already connected at deletion time and a reconnect using the old token. Testing only the session-list API or refresh-token failure can give a false impression that all access channels have been revoked.
References
- Project repository (https://github.com/go-vikunja/vikunja)
- GitHub security advisory (https://github.com/go-vikunja/vikunja/security/advisories/GHSA-4hv6-xc92-j86g)
- NVD: CVE-2026-111917 (https://nvd.nist.gov/vuln/detail/cve-2026-111917)
- VulnCheck advisory (https://www.vulncheck.com/advisories/vikunja-2.3.0-before-2.7.0-websocket-authentication-ignores-session-revocation)
- Vikunja 2.7.0 release (https://github.com/go-vikunja/vikunja/releases/tag/v2.7.0)
- Patch (https://github.com/go-vikunja/vikunja/commit/46ae98355462acbea451356326146675d3feeaab)