CVE-2026-57458

CVE-2026-57458 is a high-severity improper privilege management vulnerability in code.vikunja.io/api (go), affecting versions = 2.3.0. It is fixed in 2.4.0.

Does this CVE actually affect you?

Kodem shows which CVEs are reachable and running in your applications, so you fix what's exploitable, not just what's listed.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Runtime intelligence, not another scanner.

Summary

Vikunja: Scoped API token can mint unrestricted OAuth session credentials

A scoped API token can bypass its declared permissions by using the OAuth authorization flow to mint normal session credentials.

A token limited to:

{"oauth":["authorize"]}

can call /api/v1/oauth/authorize, receive an OAuth authorization code, exchange it at /api/v1/oauth/token, and obtain a normal bearer JWT plus refresh token. The resulting credentials are not restricted by the original API-token permissions.

Affected Component

  • Scoped API tokens
  • OAuth authorization flow
  • POST /api/v1/oauth/authorize
  • POST /api/v1/oauth/token

Technical Details

The issue is caused by an authentication-context mismatch between scoped API-token authentication and OAuth authorization-code issuance.

The vulnerable chain is:

  1. A scoped API token authenticates the request and sets the current user context.
  2. /api/v1/oauth/authorize accepts that API-token-authenticated user as a valid OAuth resource owner.
  3. The OAuth authorization endpoint issues an authorization code.
  4. /api/v1/oauth/token exchanges that code for a normal bearer JWT and refresh token.
  5. The resulting credentials are not bound to the original API-token permissions.

Relevant code paths:

  • pkg/routes/routes.go

    • registers /api/v1/oauth/authorize in an authenticated API route group that also accepts scoped API tokens
  • pkg/models/api_routes.go

    • exposes non-CRUD subroutes as API-token permissions
    • exposes the OAuth authorization endpoint under the oauth permission group
  • pkg/routes/api_tokens.go

    • stores api_token and api_user in the request context during API-token authentication
  • pkg/user/user.go

    • treats api_user as an authenticated current user
  • pkg/modules/auth/oauth2server/authorize.go

    • uses the current user and issues an OAuth authorization code
  • pkg/modules/auth/oauth2server/token.go

    • exchanges the authorization code for a normal JWT and refresh token

Steps to Reproduce

1. Create a scoped API token

Create an API token with only the following permission:

{"oauth":["authorize"]}

Observed response:

201 Created

The returned token had only the oauth.authorize permission.

2. Negative control: direct access with scoped token fails

Request:

GET /api/v1/user
Authorization: Bearer <scoped-api-token>

Observed response:

401 Unauthorized

Response body:

{"code":11,"message":"missing, malformed, expired or otherwise invalid token provided"}

This confirms that the scoped token cannot directly access the normal user route.

3. Obtain an OAuth authorization code with the scoped token

Request:

POST /api/v1/oauth/authorize
Authorization: Bearer <scoped-api-token>
Content-Type: application/json

Body:

{
  "response_type": "code",
  "client_id": "vikunja",
  "redirect_uri": "vikunja-flutter://callback",
  "code_challenge": "<pkce-s256-challenge>",
  "code_challenge_method": "S256"
}

Observed response:

200 OK

Response body:

{
  "code": "<redacted>",
  "redirect_uri": "vikunja-flutter://callback",
  "state": ""
}

The scoped API token successfully obtained an OAuth authorization code.

4. Exchange the authorization code for session credentials

Request:

POST /api/v1/oauth/token
Content-Type: application/json

Body:

{
  "grant_type": "authorization_code",
  "code": "<redacted>",
  "client_id": "vikunja",
  "redirect_uri": "vikunja-flutter://callback",
  "code_verifier": "<original-pkce-verifier>"
}

Observed response:

200 OK

Response body:

{
  "access_token": "<redacted>",
  "token_type": "bearer",
  "expires_in": 600,
  "refresh_token": "<redacted>"
}

The authorization code was exchanged for a normal access token and refresh token.

5. Use the minted access token on normal routes

Request:

GET /api/v1/user
Authorization: Bearer <minted-oauth-access-token>

Observed response:

200 OK

Additional scope check:

GET /api/v1/projects
Authorization: Bearer <minted-oauth-access-token>

Observed response:

200 OK

The minted OAuth access token could access normal non-OAuth routes that the original scoped API token could not access.

Expected Behavior

A scoped API token should not be able to obtain credentials with broader permissions than its declared scope.

/api/v1/oauth/authorize should require a normal user session or another authentication context suitable for OAuth authorization-code issuance. API-token-authenticated requests should not be accepted for minting OAuth authorization codes.

Actual Behavior

A token scoped only to oauth.authorize can obtain an OAuth authorization code and exchange it for a normal JWT plus refresh token.

The minted credentials are not restricted by the original API-token permissions.

Impact

A narrowly scoped API token with only oauth.authorize can be converted into normal session credentials for the same user.

This bypasses the intended API-token permission boundary. An attacker who obtains or is delegated such a limited token can mint a normal JWT and refresh token, then access routes outside the original token scope.

Runtime validation showed that the original scoped token could not access GET /api/v1/user, but the minted OAuth access token could access:

  • GET /api/v1/user
  • GET /api/v1/projects

No cross-user access, privilege escalation to admin, or access to another account was validated.

The application assigns, modifies, tracks, or checks privileges incorrectly, allowing a user to gain elevated access. Typical impact: privilege escalation beyond the intended level.

CVE-2026-57458 has a CVSS score of 8.1 (High). The vector is network-reachable, low privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (2.4.0); upgrading removes the vulnerable code path.

Affected versions

code.vikunja.io/api (= 2.3.0)

Security releases

code.vikunja.io/api → 2.4.0 (go)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

Already deployed Kodem?

See it in your environmentNew to Kodem? Get a demo →

Remediation advice

Upgrade code.vikunja.io/api to 2.4.0 or later to resolve this vulnerability.

Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.

Frequently Asked Questions

  1. What is CVE-2026-57458? CVE-2026-57458 is a high-severity improper privilege management vulnerability in code.vikunja.io/api (go), affecting versions = 2.3.0. It is fixed in 2.4.0. The application assigns, modifies, tracks, or checks privileges incorrectly, allowing a user to gain elevated access.
  2. How severe is CVE-2026-57458? CVE-2026-57458 has a CVSS score of 8.1 (High). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
  3. Which versions of code.vikunja.io/api are affected by CVE-2026-57458? code.vikunja.io/api (go) versions = 2.3.0 is affected.
  4. Is there a fix for CVE-2026-57458? Yes. CVE-2026-57458 is fixed in 2.4.0. Upgrade to this version or later.
  5. Is CVE-2026-57458 exploitable, and should I be worried? Whether CVE-2026-57458 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  6. What actually determines whether CVE-2026-57458 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  7. How do I fix CVE-2026-57458? Upgrade code.vikunja.io/api to 2.4.0 or later.

Other vulnerabilities in code.vikunja.io/api

Stop the waste.
Protect your environment with Kodem.