/

CVE-2026-59712

Severity:

HIGH RISK

(8.1)

Broken Access Control (CWE-639) in Leantime JSON-RPC API

CVE-2026-59712

Deferred

Vulnerability type

Category:

Broken Access Control / Insecure Direct Object Reference

CWE:

CWE-639

Impact:

Credential Exposure and Account Takeover

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

A broken access control issue in Leantime's JSON-RPC API allows authenticated users to call users.getUser with arbitrary user IDs and retrieve entire credential records.

This exposure includes password hashes, TOTP secrets, and session tokens, enabling offline password cracking, 2FA bypass, account takeover, and session hijacking when an attacker can access the API.

Affected context

The vulnerability occurs in Leantime deployments that expose the JSON-RPC API and use the Users::getUser method to retrieve user information.

It manifests when the method is callable by general authenticated users without per-object authorization checks to ensure they can only access their own account data.

The issue is most relevant in multi-user or multi-tenant environments where users should not see each other's credentials, but the application trusts a supplied user ID parameter without enforcing ownership or role constraints.

Exploit preconditions

  • Attack surface: Application JSON-RPC API endpoint providing users.getUser
  • Required access: Valid authenticated user account with ability to issue JSON-RPC calls
  • Trigger point: Calling users.getUser with user IDs belonging to other accounts
  • Why exploitation is possible: The method relies on client-supplied identifiers and lacks server-side authorization checks that bind the request to the caller's identity and role, leading to an Insecure Direct Object Reference (IDOR) condition under CWE-639.

Why this happens

The root cause is missing object-level authorization for user records in the Users::getUser path.

The API trusts the userId parameter provided by the client and directly queries and returns the associated database row without verifying that the requester is allowed to view that specific record.

This design pattern matches CWE-639: Authorization Bypass Through User-Controlled Key, where resource access is controlled solely by a user-controlled identifier instead of being mediated by robust access control logic.

As a result, sensitive credential fields such as password hashes, TOTP secrets, and session tokens—intended to remain internal—are exposed to any authenticated caller who can iterate over user IDs.

Potential impact

  • Attackers may retrieve password hashes for all users and perform offline password cracking.
  • Attackers could obtain TOTP secrets and potentially bypass two-factor authentication protections.
  • Attackers can collect active session tokens, enabling session hijacking and impersonation of other users.
  • Attackers may fully compromise administrator or privileged accounts, leading to data exposure or modification across the application.
  • Attackers could conduct large-scale account enumeration and profiling of the user base.

General mitigation guidance

Effective mitigation focuses on enforcing robust, server-side access control at the object level and minimizing exposure of credential material through APIs.

Recommended defensive patterns include:

  • Implementing per-record authorization checks in all user-related endpoints, ensuring that callers can only access their own user record unless explicitly granted elevated privileges.
  • Avoiding reliance on user-supplied identifiers alone; derive the effective user ID from the authenticated session or token whenever possible.
  • Designing API schemas that never return sensitive credential fields (password hashes, TOTP seeds, session tokens) to any client, treating them as write-only or strictly internal.
  • Centralizing access-control decisions in reusable middleware or service layers to ensure consistent enforcement across all API methods.
  • Applying least-privilege principles to roles and permissions so that generic users cannot invoke administrative-level data retrieval operations.

How teams detect issues like this

Detection efforts can target both code patterns and runtime behavior.

Useful strategies include:

  • Static analysis rules that flag controller or service methods where database queries are parameterized with user-controlled identifiers without a corresponding authorization check.
  • Code review checklists that explicitly require verification of object-level access control for any endpoint that handles user IDs or other record keys.
  • Logging and monitoring of JSON-RPC calls for unusual patterns, such as a single user ID requesting many different user records in a short timeframe.
  • Security testing and automated API fuzzing that attempts to access other users' resources by modifying IDs, combined with policies that treat any cross-user data access as a failure condition.
  • Use of API gateways or WAF rules that can add coarse-grained protections and highlight anomalous enumeration attempts, even if they cannot enforce fine-grained authorization alone.

Sources

SourceLink
github.comgithub.com/Leantime/leantime
github.comgithub.com/Leantime/leantime/commit/4f2612d13e0e8a2093092a846b44506cf133b671
github.comgithub.com/Leantime/leantime/issues/3556
vulncheck.comvulncheck.com/advisories/leantime-credential-disclosure-via-unauthenticated-json-rpc-users-getuser-method

Frequently asked

questions

Yes, it can be exploited remotely by anyone who can authenticate to the Leantime instance and reach the JSON-RPC API endpoint, without needing elevated privileges.

An attacker needs a valid user account or another means of obtaining authenticated access; from there, they can abuse users.getUser to enumerate and retrieve other users' credential data.

The safest pattern is to enforce strict, server-side object-level authorization on all user retrieval methods and redesign responses so that sensitive credential fields are never exposed through client-facing APIs.

Establish a consistent access-control architecture that binds each request to the authenticated user, avoid trusting client-supplied IDs for authorization, minimize the data returned by APIs, and integrate security reviews or automated checks focused on IDOR and broken access control before deployment.

Find out what's already
exploitable in your codebase.