GHSA-H999-WXWV-X8P8
Non-constant-time comparison of email MFA code in MfaService (CWE-208)
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-H999-WXWV-X8P8 divulgada · CVSS 3.7 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
### Summary
Poweradmin compares the stored email-based two-factor code with the user-supplied code using PHP's native `===` operator instead of the constant-time `hash_equals()`, creating a timing side-channel (CWE-208).
### Details
File: lib/Domain/Service/MfaService.php:418
$isValid = trim($storedSecret) === trim($code);
The code is generated with random_int(100000, 999999) (~20 bits of entropy), a much smaller space than the API key and reset token, where timing attacks are traditionally a greater concern.
### PoC
Environment: Poweradmin (main branch), PHP 8.4.24, SQLite backend.
1. Inspect the code at the line above to confirm the use of ===.
2. A local microbenchmark (~20,000 trials) of === vs hash_equals() showed a small (~5ns), repeatable timing difference between early- and late-position mismatches for ===; hash_equals() showed flat timing.
No PoC for practical remote timing extraction is provided, as the mitigating factors below make it impractical.
### Impact
MfaService enforces a hard lockout: MAX_VERIFY_ATTEMPTS = 5 failed attempts per VERIFY_LOCKOUT_SECONDS = 900 (15 minutes). This limits an attacker to 5 timing samples per 15-minute window, far too few to extract a timing signal over any realistic network path. Reported as a defense-in-depth issue.
### Suggested fix
$isValid = hash_equals(trim($storedSecret), trim($code));
Split from GHSA-7fw5-qphw-gh3v.
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 |
|---|---|---|---|---|
Packagistpoweradmin/poweradmin |
Corregida | 4.2.6, 4.3.5, 4.4.1 | — | — |
4.2.64.3.54.4.1Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/poweradmin/poweradmin/security/advisories/GHSA-h999-wxwv-x8p8Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
