GHSA-FWQX-CC24-3J43
Low-privilege authenticated user can take over an owner account through unguarded JSON-RPC onboarding methods
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-FWQX-CC24-3J43 divulgada · CVSS 8.8 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
Missing authorization in Leantime's JSON-RPC onboarding methods allows a low-privilege authenticated user to overwrite another user's password and role, including the instance owner's. A second unguarded onboarding method activates the modified account. With local password login enabled, this provides a path from a `readonly` account to owner-level control of the application.
The root cause is a combination of missing object authorization and unrestricted privileged fields. `Onboarding::saveAccount` and `Onboarding::completeOnboarding` accept a caller-supplied user record without verifying its relationship to the authenticated user or a valid invitation. They call `Users::editUser` internally, bypassing the dispatch-time permission attribute on that method.
Suggested severity: High, CVSS 3.1 8.8
`CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
Affected code and assessment scope
The affected onboarding and authorization paths are present in the official v3.9.8 source at commit `32be54edfc5fd33f35ea178f9d51b86276599069`. Source review on September 12, 2026 also confirmed those paths at `master` commit `056835f1c29cf1f587415e6c45ddaf8d69f8d24c`. This does not establish an introduced-in version or a range covering all earlier releases.
The local assessment recorded the password/role overwrite and related authorization findings against a self-hosted build. The version comparison above is source verification, not a fresh runtime test of both revisions. No Leantime-operated infrastructure or third-party instance was tested.
Root cause
`app/Domain/Api/Controllers/Jsonrpc.php` resolves an RPC method to an internal service method, requires an `@api` docblock tag, prepares the arguments, and invokes `PermissionEnforcer::enforce` before the service call. In `app/Core/Auth/Permissions/PermissionEnforcer.php`, absence of a `#[RequiresPermission]` attribute causes an immediate return:
$attribute = $this->attributeFor($class, $method);
if ($attribute === null) {
return;
}The default configuration enables permission enforcement, but that setting does not protect methods without the attribute. Additional authorization inside a method can still protect it; the affected onboarding methods have no such check.
`Onboarding::saveAccount` is `@api`-tagged and accepts `array $userInvite`, `string $name`, `string $jobTitle`, and `string $password`. It validates password strength, then sets:
$userInvite['status'] = 'i';
$userInvite['user'] = $userInvite['username'];
$userInvite['password'] = $password;
session(['tempPassword' => $password]);
if ($this->userService->editUser($userInvite, $userInvite['id'])) {
return 'saved';
}The caller controls the target `id`, `role`, and `clientId`. The `#[RequiresPermission(UsersPermissions::EDIT, global: true)]` declaration on `Users::editUser` is evaluated when that method is dispatched directly, but is not automatically evaluated on this ordinary internal PHP call. The service forwards the record to the user repository, which hashes the supplied plaintext password and updates the row selected by the supplied ID.
`Onboarding::completeOnboarding` is also exposed without a permission or ownership check. It sets `status = 'A'`, clears the password field in the update payload so the existing hash is retained, and calls the same user-update service. Activation happens before the subsequent automatic-login step.
Source references for v3.9.8:
- JSON-RPC dispatch
https://github.com/Leantime/leantime/blob/32be54edfc5fd33f35ea178f9d51b86276599069/app/Domain/Api/Controllers/Jsonrpc.php - Permission enforcer
https://github.com/Leantime/leantime/blob/32be54edfc5fd33f35ea178f9d51b86276599069/app/Core/Auth/Permissions/PermissionEnforcer.php - Onboarding methods
https://github.com/Leantime/leantime/blob/32be54edfc5fd33f35ea178f9d51b86276599069/app/Domain/Auth/Services/Onboarding.php - User service
https://github.com/Leantime/leantime/blob/32be54edfc5fd33f35ea178f9d51b86276599069/app/Domain/Users/Services/Users.phpand user repositoryhttps://github.com/Leantime/leantime/blob/32be54edfc5fd33f35ea178f9d51b86276599069/app/Domain/Users/Repositories/Users.php
Reproduction
Use a disposable local installation with a `readonly` account and a target owner account that can use local password login. The sample target is user ID `1`, username `admin@example.com`, client ID `1`; substitute the actual fixture values. ID `1` is an example, not a required target.
Authenticate each RPC using a Bearer token belonging to the low-privilege user. Authenticated users can create personal access tokens from their settings. Browser-session authentication is also supported for AJAX requests: send the authenticated session cookie together with `X-Requested-With: XMLHttpRequest`. A cookie alone on a non-AJAX API request is insufficient because `StartSession` selects the in-memory session driver for that request type.
1. Overwrite the target password and role
POST /api/jsonrpc
Content-Type: application/json
Authorization: Bearer <low-privilege-token>
{"jsonrpc":"2.0","id":1,"method":"leantime.rpc.auth.onboarding.saveAccount",
"params":{"userInvite":{"id":1,"username":"admin@example.com","role":50,"clientId":1},
"name":"Test Owner","jobTitle":"test","password":"Str0ng!Pass"}}Expected successful result: `{"jsonrpc":"2.0","result":"saved","id":1}`. Verify that the target row now contains a hash matching the supplied password and role `50`, which maps to `owner`. This method sets status to `i`, so a separate activation step is needed before normal web login.
2. Activate the target through the unguarded sibling method
POST /api/jsonrpc
Content-Type: application/json
Authorization: Bearer <low-privilege-token>
{"jsonrpc":"2.0","id":2,"method":"leantime.rpc.auth.onboarding.completeOnboarding",
"params":{"userInvite":{"id":1,"username":"admin@example.com",
"firstname":"Test","lastname":"Owner","role":50,"clientId":1}}}The update sets status to `A` and retains the planted password hash. The method then attempts automatic login using `session('tempPassword')`. API sessions do not persist this value between ordinary requests, so that later step can produce an error after the database update. Do not use the RPC response alone as evidence that activation succeeded or failed; inspect the target record and test a separate login.
If the fixture has 2FA enabled, the separately unguarded `leantime.rpc.twoFA.twoFA.disable2FA` method accepts `{"userId":1}` and clears the target's 2FA state. That is an additional request, not part of the two-call case with 2FA disabled.
3. Verify the resulting identity and permissions
Use a fresh browser session to log in with the target username and planted password. Verify the authenticated user's ID and owner role, and check access to an owner-authorized function. An HTTP 200 by itself is not proof: a redirect to a login or 2FA page can also finish with HTTP 200. Record final URLs and authenticated identity, and confirm that the original password no longer authenticates.
Additional affected methods
Source review found the same missing authorization pattern in these RPC-exposed service methods:
- 2FA state: `TwoFA::{getSetupData,saveSecret,verifyAndEnable,disable2FA}` accept a target `userId` without checking ownership. `getSetupData` returns the stored secret when one exists, or a freshly generated enrollment secret otherwise. It omits the QR code when 2FA is already enabled. `verifyAndEnable` still requires a valid TOTP code for the supplied secret; the missing check is authorization to change the target user.
- User and project inventory: `Projects::getAllUsers` returns user details across client boundaries, excluding API-source accounts. `Projects::getAllProjects` returns project metadata across client boundaries but excludes projects marked closed by the repository's default filter. Neither method checks the caller's project membership.
- Ticket-hour aggregates: `Timesheets::getLoggedHoursForTicketByDate(int $ticketId)` and `getSumLoggedHoursForTicket(int $ticketId)` expose ticket-level aggregate hours without a project-membership check. These are aggregates, not individual users' timesheet records.
- Notification insertion: `Notifications::addNotifications(array $notifications)` passes caller-supplied target user IDs, messages, authors, and URLs to the notification repository without an authorization check.
- Scheduler and queue execution: `Cron::runScheduledTasks()` invokes `schedule:run`, which evaluates scheduled jobs for execution; it does not unconditionally run every scheduled task. `Queue::processQueue(Workers $worker)` processes queued work for the selected worker without a role check. Actual effects depend on the configured jobs and queued messages.
These observations support an audit of the RPC surface. They should not be treated as a blanket statement that every unannotated method is exploitable or that every listed variant has been independently reproduced end to end.
Impact and scoring
Under the reproduction conditions, a low-privilege authenticated user can take over an owner account and gain application-level access to project data and user administration. The default owner role grants all registered permissions. The source includes owner-accessible user and project deletion operations; the onboarding overwrite itself can also prevent a target's normal password login by changing its password and setting inactive status.
The proposed CVSS 3.1 score is 8.8 (High): network access, low complexity, low privileges required, no victim interaction, and high confidentiality, integrity, and availability impact within the Leantime application. Availability reflects account lockout and destructive application administration. Scope is unchanged because the assessed impact remains within the application's security authority.
The affected source has been checked at the revisions listed above. Deployment-specific authentication restrictions, plugins, and custom authorization changes can affect reachability; this is not a claim that every deployment or every release is affected.
Suggested remediation
- Validate the caller's authority over the target record inside the affected service methods, including internal-call paths. For invitation onboarding, resolve the invited user from a validated, appropriately scoped invitation token on the server instead of trusting a submitted user record.
- Restrict writable fields to those appropriate for the operation. Self-service profile or onboarding updates must not accept caller-selected `role`, `clientId`, arbitrary activation state, or target ID. Role changes need explicit grant limits; a self-ownership check alone is insufficient.
- Require explicit authorization coverage for RPC exposure. Deny methods lacking an authorization policy unless they have been deliberately reviewed and allowlisted for their intended callers. Keep object-level checks on paths that can also be called internally.
- Apply ownership and appropriate reauthentication checks to 2FA management, membership or administrative checks to cross-client reads, and explicit permissions to notification and scheduler/queue operations.
- Until fixed, restrict access to `/api/jsonrpc` to necessary trusted callers where operationally possible. CSRF protection for browser-session requests is defense in depth and does not prevent abuse by an already authenticated low-privilege caller.
Reported by Hamid Babaee.
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
Packagistleantime/leantime |
Sin parche | — | — | — |
Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/Leantime/leantime/security/advisories/GHSA-fwqx-cc24-3j43Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
