GHSA-V77X-58XV-3FMX
Missing Authorization on Install/Update Service Allows Any Authenticated User to Trigger Database Migrations
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:L
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-V77X-58XV-3FMX divulgada · CVSS 5.4 (GitHub) | |
| Divulgación | Modificada | Última actualización del registro | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
The `Install::runUpdate()` and `Install::runInstall()` methods in `Leantime\Domain\Install\Services\Install` are annotated with `@api` (exposing them via JSON-RPC) but have no `#[RequiresPermission]` attribute and no internal authorization check. Any authenticated user - including the lowest-privilege role (editor, role 20) - can trigger database migrations via the JSON-RPC endpoint.
Severity
Medium - CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:L/VA:H/SC:N/SI:N/SA:N
Affected products
- Ecosystem: Composer
- Package name: leantime/leantime
- Affected versions: <= 3.9.8
- Patched versions: None
Details
Vulnerable code
`app/Domain/Install/Services/Install.php`:
/**
* @api <-- exposed via JSON-RPC, no RequiresPermission
*/
public function runUpdate(): bool|array
{
session()->forget('db-version');
return $this->installRepo->updateDB();
}
/**
* @api <-- exposed via JSON-RPC, no RequiresPermission
*/
public function runInstall(array $values): bool
{
return $this->installRepo->setupDB($values);
}Neither method has a `#[RequiresPermission]` attribute. The `PermissionEnforcer` returns immediately (no-op) when no attribute is present (line 47-48 of `PermissionEnforcer.php`).
Attack scenarios
Scenario 1: Denial of Service via repeated migration execution
A low-privilege user calls `runUpdate()` repeatedly via JSON-RPC. Each call clears the cached db-version and re-runs all migration scripts against the production database. Depending on migration complexity and database size, this causes significant load, potential table locks, and service degradation.
Scenario 2: Premature migration during version upgrade
When a new Leantime version is deployed but the administrator has not yet completed pre-upgrade steps (backups, maintenance window), a low-privilege user can trigger migrations prematurely by calling `runUpdate()`, potentially causing data inconsistency if the upgrade requires a specific sequence.
Scenario 3: runInstall attempt
While `runInstall()` returns false on an already-initialized database, it is still callable - the authorization gap exists regardless of the runtime outcome.
Additionally, `Cron::runScheduledTasks()` is exposed under the same pattern (no `#[RequiresPermission]`), allowing any authenticated user to trigger scheduled task execution on demand.
Reproduction
- Deploy Leantime v3.9.8 with Docker
- Create an admin account and a low-privilege (editor, role 20) account
- Create an API key for the low-privilege user
- Run:
curl -sS http://target/api/jsonrpc \
-H "x-api-key: lt_<user>_<key>" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"leantime.rpc.install.install.runUpdate","params":{},"id":1}'
# Returns: {"jsonrpc":"2.0","result":true,"id":1}Verified on Leantime v3.9.8.
Remediation
Add admin-only authorization to all Install service methods:
#[RequiresPermission(InstallPermissions::MANAGE, global: true)]
public function runUpdate(): bool|array
{
session()->forget('db-version');
return $this->installRepo->updateDB();
}Or remove the `@api` annotation from the Install service class entirely, as these operations should never be accessible via API.
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-v77x-58xv-3fmxLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
