/

CVE-2026-59713

Severity:

HIGH RISK

(8.1)

OIDC Login CSRF (CWE-352) in Leantime verifyState()

CVE-2026-59713

Deferred

Vulnerability type

Category:

Cross-Site Request Forgery (CSRF)

CWE:

CWE-352

Impact:

Session Fixation and Account Impersonation

Severity:

HIGH RISK

(8.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Leantime's OIDC login flow contains a CSRF vulnerability where the verifyState() method unconditionally returns true without validating the state parameter.

An attacker can abuse this flaw by crafting malicious callback URLs with attacker-controlled authorization codes, potentially forcing users into a session fixation scenario and logging victims in as the attacker.

Affected context

This vulnerability occurs within Leantime's OpenID Connect (OIDC) authentication integration when the application relies on the verifyState() method to confirm the integrity of the OIDC login response.

It becomes relevant in deployments where:

  • OIDC is enabled for user authentication
  • The application processes authorization code callbacks from an identity provider
  • The state parameter is expected to provide CSRF protection during the login handshake

Exploit preconditions

  • Attack surface: The OIDC callback endpoint that processes authorization codes and state parameters.
  • Required access: Ability to induce a victim's browser to follow a crafted OIDC callback URL (e.g., via a link, iframe, redirect, or injected content).
  • Trigger point: The victim's browser sends the attacker-crafted callback request to the Leantime OIDC endpoint, invoking verifyState().
  • Why exploitation is possible: The verifyState() method returns true without validating the state parameter, neutralizing the CSRF protection that should bind an OIDC login response to a specific user-initiated request.

Why this happens

The root cause is the omission of state parameter validation in the OIDC login CSRF protection logic.

Instead of verifying that the returned state matches a server-side, user-specific value created during the initial login request, verifyState() always returns true.

This aligns with CWE-352: Cross-Site Request Forgery, as the application accepts a sensitive authentication action triggered through a forged request lacking proper anti-CSRF checks.

Potential impact

  • Attackers may fix victim sessions to authenticated states tied to attacker-controlled accounts.
  • Victims could be silently logged in as the attacker, enabling account impersonation.
  • Application audit trails and activity logs can become misleading due to session confusion.
  • Follow-on attacks may include data exposure, configuration tampering, or misuse of project resources under the victim's identity.

General mitigation guidance

Effective mitigation focuses on restoring robust CSRF protections within the OIDC login flow:

  • Implement strict state validation by generating cryptographically strong, per-request state values and storing them server-side or in a secure client-bound context.
  • Ensure the verifyState() method compares the returned state to the expected value and rejects mismatches or missing states.
  • Couple the state parameter to the user's session and intended action, preventing reuse or sharing across users or requests.
  • Prefer secure-by-default OIDC/OAuth client libraries that handle CSRF and state validation automatically, reducing the chance of custom logic errors.
  • Minimize session fixation risk by regenerating session identifiers on successful login and avoiding reuse of pre-authentication sessions.

How teams detect issues like this

Detection commonly centers on reviewing authentication flows and CSRF defenses:

  • Static analysis rules that flag authentication or OIDC code paths where state parameters are not validated or are ignored.
  • Code reviews focused on login and callback handlers, checking that state and other anti-CSRF tokens are compared against server-side expectations.
  • Security policies requiring use of vetted OIDC/OAuth client libraries and prohibiting custom token/state handling without peer review.
  • Automated tests or security checks that simulate forged OIDC callbacks and verify that the application correctly rejects unauthenticated or mismatched responses.

Sources

SourceLink
github.comgithub.com/Leantime/leantime
github.comgithub.com/Leantime/leantime/commit/9630eb7db682fb1b4e23cdabf3428d03ec6f5094
github.comgithub.com/Leantime/leantime/issues/3535
vulncheck.comvulncheck.com/advisories/leantime-oidc-login-csrf-via-unconditional-state-verification-stub

Frequently asked

questions

It is exploitable wherever Leantime's OIDC login is accessible to users and the application processes OIDC callback URLs, as long as attackers can convince victims to visit attacker-crafted links.

Attackers do not require direct access to the server; they mainly need the ability to deliver crafted callback URLs to victims and rely on the victim's browser to send those requests while authenticated or in a relevant session context.

The safest pattern is to implement robust state parameter validation backed by server-side storage or secure binding to the user session, reject any callback with missing or mismatched state, and regenerate session identifiers on successful login to prevent fixation.

Future prevention involves consistently using well-reviewed OIDC/OAuth client libraries, mandating CSRF/token validation in authentication flows, integrating security-focused code reviews, and adding automated tests that exercise login and callback endpoints with malformed or forged state values.

Find out what's already
exploitable in your codebase.