GHSA-4hv6-xc92-j86g: Vikunja WebSocket Authentication Ignores Server-side Session Vulnerability

MODERATE
CVSS 6.5
CWE-613
Published
Advisory Summary

GHSA-4hv6-xc92-j86g is a MODERATE (CVSS 6.5) websocket authentication ignores server-side session vulnerability (CWE-613: Insufficient Session Expiration) affecting Vikunja libraries in the Go ecosystem. The issue involves websocket authentication ignores server-side session state, so revoked sessions keep receiving live pushes. Remediation is available in the latest vendor maintenance releases.

GHSA-4hv6-xc92-j86g at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-4hv6-xc92-j86g
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-613: Insufficient Session Expiration
Affected Product Vikunja
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 6.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix GHSA-4hv6-xc92-j86g

To remediate this vulnerability, upgrade all affected Vikunja dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

code.vikunja.io/api fixed: Latest secure release
Upgrade code.vikunja.io/api to Latest secure release
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for code.vikunja.io/api

How to Check if You Are Affected

To determine whether your application is affected by GHSA-4hv6-xc92-j86g, inspect your project dependencies for Vikunja:

inspect dependencies for code.vikunja.io/api

Analyze the terminal output to locate any version of Vikunja in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-613: Insufficient Session Expiration, where according to wasc, "insufficient session expiration is when a web site permits an attacker to reuse old session credentials or session ids for authorization.". In Vikunja, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary Vikunja v2.6.0 introduced server-side sessions with revocation semantics: `DELETE /api/v2/user/sessions/{id}` documents "Revokes a specific session by its UUID", and enabling TOTP calls `DeleteAllUserSessions` to invalidate all sessions. The WebSocket endpoint accepts any cryptographically valid user JWT without ever resolving its `sid` (session id) claim against the sessions table. A connection authenticated before revocation stays authenticated and continues to receive live pushes indefinitely, and even brand-new WebSocket connections are accepted with a token whose session was deleted. The revocation feature therefore does not cover the WebSocket boundary at all. ### Details User access JWTs carry a session reference: `NewUserJWTAuthtoken` (`pkg/modules/auth/auth.go:188`) sets `claims["sid"] = sessionID`, and the API login-session documentation describes the claim as tying the JWT to a server-side session. On the HTTP side nothing consumes the claim per request either (REST access tokens simply expire after their short TTL, a design the maintainers documented when fixing GHSA-96q5, and refresh tokens are correctly invalidated when the session row is deleted). The WebSocket endpoint `GET /api/v2/ws` authenticates through the first client message. `Connection.handleAuth` (`pkg/websocket/connection.go:168`) validates the token exclusively with `auth.GetUserIDFromToken` (`pkg/modules/auth/auth.go:292`): ```go func GetUserIDFromToken(tokenString string) (int64, error) { token, err := jwt.Parse(tokenString, func(_ *jwt.Token) (any, error) { return []byte(config.ServiceSecret.GetString()), nil }) ... typ, ok := claims["type"].(float64) if !ok || int(typ) != AuthTypeUser { return 0, jwt.ErrTokenInvalidClaims } ... } ``` The function verifies signature and token type only. No session lookup occurs anywhere in the WebSocket path, and no re-validation happens after the initial auth. Consequently: 1. A connection authenticated before `DELETE /api/v2/user/sessions/{id}` (or before TOTP enable, which runs `models.DeleteAllUserSessions`, `pkg/routes/api/v2/user_totp.go:208`) remains registered in the hub and keeps receiving every subscribed event, such as `notification.created` with the full notification object including comment, task and project content. 2. A new connection opened after the deletion, using the same pre-revocation token, authenticates successfully. 3. Session deletion is observable only in the REST surface. The user's session list empties, the refresh token dies on next use, but the WebSocket channel never notices. For REST the exposure is bounded by the 10-minute access-token TTL. For WebSocket it is not: a connection lives until the client closes it, so a session the user believes revoked retains a live, server-pushed data channel with no time bound. ### PoC > [vikunja-ws-auth-ignores-session-revocation-PoC.zip](https://github.com/user-attachments/files/32741065/vikunja-ws-auth-ignores-session-revocation-PoC.zip) The attached archive contains `deployment/deploy.sh` (local Vikunja v2.6.0 on loopback with SQLite) and `poc/poc.sh` running `poc/poc.py`: 1. Victim registers and logs in. Second user registers for later interaction. 2. Control: the victim's WebSocket authenticates and subscribes to `notification.created`. Negative control: a garbage token is rejected with `invalid_token`. 3. Every victim session is deleted via `DELETE /api/v2/user/sessions/{id}` (the list afterwards reports 0 remaining). 4. Exploit A: a brand-new WebSocket connection authenticates successfully with the deleted-session token. 5. Exploit B: the second user comments on a task mentioning the victim. The victim's pre-revocation WebSocket connection receives the `notification.created` push with the full notification payload. Result: 10 checks passed on two consecutive runs, each from a wiped database. ### Impact Session revocation, the mechanism a user relies on when a device is lost or a token is suspected stolen, silently excludes the WebSocket channel. A stolen or leaked access token can be converted into a push channel that survives every revocation action available to the user, including TOTP enrollment whose documented purpose is invalidating all sessions, and keeps delivering the victim's notifications (comment mentions, task and project metadata) until the attacker chooses to disconnect. The fix is to resolve the `sid` claim against the sessions table during `handleAuth` and to re-validate or drop hub connections when their session is deleted.

GHSA-4hv6-xc92-j86g Affected Vikunja Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
code.vikunja.io/api
Go
≥ 2.3.0
≤ 2.6.0

References

Frequently Asked Questions

What is GHSA-4hv6-xc92-j86g?
GHSA-4hv6-xc92-j86g is a security vulnerability in Vikunja involving WebSocket authentication ignores server-side session state, so revoked sessions keep receiving live pushes under CWE-613: Insufficient Session Expiration.
Which Vikunja versions are affected?
Affected versions include releases prior to current release patches across affected packages: code.vikunja.io/api.
What version fixes GHSA-4hv6-xc92-j86g?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is code.vikunja.io/api affected?
Yes, code.vikunja.io/api is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of GHSA-4hv6-xc92-j86g?
GHSA-4hv6-xc92-j86g has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N.
What CWE is associated with GHSA-4hv6-xc92-j86g?
GHSA-4hv6-xc92-j86g is classified under CWE-613: Insufficient Session Expiration (According to WASC, "Insufficient Session Expiration is when a web site permits an attacker to reuse old session credentials or session IDs for authorization.").
How can I check Go dependencies for GHSA-4hv6-xc92-j86g?
Run the dependency tree command: 'inspect dependencies for code.vikunja.io/api'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-4hv6-xc92-j86g",
  "modified" : "2026-10-09T20:57:35Z",
  "published" : "2026-10-09T20:57:34Z",
  "aliases" : [ ],
  "summary" : "Vikunja: WebSocket authentication ignores server-side session state, so revoked sessions keep receiving live pushes",
  "details" : "### Summary\n\nVikunja v2.6.0 introduced server-side sessions with revocation semantics: `DELETE /api/v2/user/sessions/{id}` documents \"Revokes a specific session by its UUID\", and enabling TOTP calls `DeleteAllUserSessions` to invalidate all sessions. The WebSocket endpoint accepts any cryptographically valid user JWT without ever resolving its `sid` (session id) claim against the sessions table. A connection authenticated before revocation stays authenticated and continues to receive live pushes indefinitely, and even brand-new WebSocket connections are accepted with a token whose session was deleted. The revocation feature therefore does not cover the WebSocket boundary at all.\n\n### Details\n\nUser access JWTs carry a session reference: `NewUserJWTAuthtoken` (`pkg/modules/auth/auth.go:188`) sets `claims[\"sid\"] = sessionID`, and the API login-session documentation describes the claim as tying the JWT to a server-side session. On the HTTP side nothing consumes the claim per request either (REST access tokens simply expire after their short TTL, a design the maintainers documented when fixing GHSA-96q5, and refresh tokens are correctly invalidated when the session row is deleted).\n\nThe WebSocket endpoint `GET /api/v2/ws` authenticates through the first client message. `Connection.handleAuth` (`pkg/websocket/connection.go:168`) validates the token exclusively with `auth.GetUserIDFromToken` (`pkg/modules/auth/auth.go:292`):\n\n```go\nfunc GetUserIDFromToken(tokenString string) (int64, error) {\n\ttoken, err := jwt.Parse(tokenString, func(_ *jwt.Token) (any, error) {\n\t\treturn []byte(config.ServiceSecret.GetString()), nil\n\t})\n\t...\n\ttyp, ok := claims[\"type\"].(float64)\n\tif !ok || int(typ) != AuthTypeUser {\n\t\treturn 0, jwt.ErrTokenInvalidClaims\n\t}\n\t...\n}\n```\n\nThe function verifies signature and token type only. No session lookup occurs anywhere in the WebSocket path, and no re-validation happens after the initial auth. Consequently:\n\n1. A connection authenticated before `DELETE /api/v2/user/sessions/{id}` (or before TOTP enable, which runs `models.DeleteAllUserSessions`, `pkg/routes/api/v2/user_totp.go:208`) remains registered in the hub and keeps receiving every subscribed event, such as `notification.created` with the full notification object including comment, task and project content.\n2. A new connection opened after the deletion, using the same pre-revocation token, authenticates successfully.\n3. Session deletion is observable only in the REST surface. The user's session list empties, the refresh token dies on next use, but the WebSocket channel never notices.\n\nFor REST the exposure is bounded by the 10-minute access-token TTL. For WebSocket it is not: a connection lives until the client closes it, so a session the user believes revoked retains a live, server-pushed data channel with no time bound.\n\n### PoC\n\n> [vikunja-ws-auth-ignores-session-revocation-PoC.zip](https://github.com/user-attachments/files/32741065/vikunja-ws-auth-ignores-session-revocation-PoC.zip)\n\nThe attached archive contains `deployment/deploy.sh` (local Vikunja v2.6.0 on loopback with SQLite) and `poc/poc.sh` running `poc/poc.py`:\n\n1. Victim registers and logs in. Second user registers for later interaction.\n2. Control: the victim's WebSocket authenticates and subscribes to `notification.created`. Negative control: a garbage token is rejected with `invalid_token`.\n3. Every victim session is deleted via `DELETE /api/v2/user/sessions/{id}` (the list afterwards reports 0 remaining).\n4. Exploit A: a brand-new WebSocket connection authenticates successfully with the deleted-session token.\n5. Exploit B: the second user comments on a task mentioning the victim. The victim's pre-revocation WebSocket connection receives the `notification.created` push with the full notification payload.\n\nResult: 10 checks passed on two consecutive runs, each from a wiped database.\n\n### Impact\n\nSession revocation, the mechanism a user relies on when a device is lost or a token is suspected stolen, silently excludes the WebSocket channel. A stolen or leaked access token can be converted into a push channel that survives every revocation action available to the user, including TOTP enrollment whose documented purpose is invalidating all sessions, and keeps delivering the victim's notifications (comment mentions, task and project metadata) until the attacker chooses to disconnect. The fix is to resolve the `sid` claim against the sessions table during `handleAuth` and to re-validate or drop hub connections when their session is deleted.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "code.vikunja.io/api"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.3.0"
      }, {
        "last_affected" : "2.6.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/go-vikunja/vikunja/security/advisories/GHSA-4hv6-xc92-j86g"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/go-vikunja/vikunja"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-613" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-10-09T20:57:34Z",
    "nvd_published_at" : null
  }
}