/

CVE-2026-54418

Severity:

HIGH RISK

(8.1)

Broken Access Control (CWE-862) in Leantime 2FA RPC

CVE-2026-54418

Received

Vulnerability type

Category:

Broken Access Control

CWE:

CWE-862

Impact:

Unauthorized access to two-factor authentication data and controls

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 JSON-RPC TwoFA methods do not adequately verify that the authenticated caller is authorized to act on the specified user account. An authenticated user may therefore retrieve another account's live TOTP secret or disable that account's two-factor authentication, weakening account protection and potentially enabling further compromise.

Affected context

The issue occurs in Leantime deployments through version 3.6.2 when the JSON-RPC dispatcher exposes the TwoFA methods getSetupData, saveSecret, verifyAndEnable, and disable2FA. Risk is present when these methods accept a caller-supplied userId without consistently enforcing ownership, session binding, or a permission attribute appropriate to the target account.

Exploit preconditions

  • Attack surface: Authenticated JSON-RPC endpoints in the Leantime TwoFA service
  • Required access: A valid authenticated Leantime account
  • Target condition: The caller can submit a user identifier for an account they do not own
  • Trigger point: Invocation of a TwoFA method that reads or changes the target account's settings
  • Why exploitation is possible: Authorization checks do not reliably bind the requested user identifier to the authenticated session or an explicitly granted administrative permission

Why this happens

The underlying bug is an object-level authorization failure mapped to CWE-862: Missing Authorization. Sensitive account-management methods trust a caller-supplied userId without consistently applying ownership validation, session pinning, or a permission-attribute gate before accessing or modifying the referenced account. This creates an insecure direct object reference pattern in the JSON-RPC layer.

Potential impact

  • An attacker may read another user's live TOTP secret
  • An attacker may disable two-factor authentication for another account
  • Account protections may be weakened or bypassed
  • A compromised authenticated account could be used to target higher-privileged users
  • Organizations could experience unauthorized access, privacy loss, or follow-on account compromise

General mitigation guidance

Mitigation generally centers on enforcing authorization at every sensitive RPC method rather than relying on the caller-supplied object identifier.

Common defensive patterns include:

  • Binding account-management operations to the authenticated session by default
  • Requiring explicit, narrowly scoped administrative permissions for cross-account actions
  • Validating ownership and authorization before reading or changing any 2FA state
  • Avoiding client-controlled identifiers when the target account can be derived from the session
  • Applying consistent authorization middleware across all RPC endpoints
  • Limiting administrative privileges and auditing sensitive 2FA operations
  • Reducing the amount of secret material returned through application interfaces

How teams detect issues like this

Organizations commonly detect this class of issue through:

  • Static analysis rules that identify sensitive operations using caller-controlled object identifiers
  • Code review checks for missing ownership, session-binding, or permission validation
  • Endpoint inventories that compare authorization requirements across related RPC methods
  • Policy tests verifying that users cannot read or modify another account's security settings
  • Runtime monitoring for unusual cross-account 2FA access, secret retrieval, or disablement events
  • Automated security testing that exercises object-level authorization boundaries with multiple user roles

Sources

SourceLink
github.comgithub.com/Leantime/leantime

Frequently asked

questions

Yes, where the affected JSON-RPC endpoints are reachable through the Leantime application and the attacker has a valid authenticated account. It does not generally require direct server or database access.

The described issue indicates that an authenticated user may invoke the methods without the ownership or permission checks expected for cross-account operations. The exact scope depends on deployment roles and endpoint exposure.

Enforce server-side authorization for every TwoFA operation, bind normal requests to the authenticated user's account, and require narrowly scoped administrative permissions for legitimate cross-account actions.

Use centralized authorization middleware, avoid trusting client-supplied account identifiers, test horizontal and vertical access-control boundaries, and audit sensitive account-security operations.

Find out what's already
exploitable in your codebase.