GHSA-QF2X-2339-GR6R
MFA bypass: second factor verified against the attacker's account, then the session is promoted to the victim
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-QF2X-2339-GR6R divulgada · CVSS 8.8 (GitHub) | |
| Divulgación | Modificada | Última actualización del registro | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
Summary
The MFA verification step validates the one-time code against whichever user id is already in the session (the attacker), but on success promotes the session to the pending user id (the victim). An attacker who has their own account (with any MFA secret enrolled) and knows a victim's password can therefore pass the victim's MFA challenge using their own authenticator and land in the victim's session. This defeats MFA entirely for anyone whose password is known, including administrators.
Details
The flaw is in shared MFA/session code, so other currently-supported branches are likely affected.
Four facts combine:
- The authenticate POST is processed even inside an already-authenticated session.
- Posting the victim's credentials sets PENDING_USERID but leaves USERID.
- The code is checked against USERID (attacker), not PENDING_USERID (victim).
- On success the session is promoted to the victim.
Proof of concept
Confirmed at runtime on 4.5.0, PHP 8.2.
Prerequisites: the attacker has their own Poweradmin account with an MFA secret enrolled (it need
not even be fully enabled), and knows the victim's password.
Runtime confirmation of the core defect (verifyCode accepts a DISABLED record and the user-selection
picks USERID over PENDING):
// Real MfaService + a repo returning the attacker's record: enabled=false, valid secret.
$g = new PragmaRX\Google2FA\Google2FA();
$secret = $g->generateSecretKey();
$attackerMfa = UserMfa::create(42, false /*enabled*/, $secret); // DISABLED
$svc = new MfaService($repoReturning($attackerMfa), $config, $mail);
$code = $g->getCurrentOtp($secret);
var_dump($svc->verifyCode(42, $code)); // => true (no isEnabled() gate)And MfaVerifyController's selection with USERID(attacker)=7 and PENDING(victim)=42:
getLoggedInUserId() ?? PENDING ==> 7 (attacker's record is the one verified)
End-to-end (through the web UI), in the attacker's live session:
1. Attacker logs in to their own account. (USERID = attacker; a valid LOGIN_TOKEN is in session.)
2. Attacker POSTs authenticate=... with the victim's username+password and the still-valid LOGIN_TOKEN. SqlAuthenticator sets PENDING_USERID = victim; USERID stays = attacker; session is marked MFA-pending.
3. Attacker is sent to /mfa/verify and submits a code from THEIR OWN authenticator. The controller verifies it against USERID (= attacker) and it passes.
4. On success USERID is overwritten with PENDING_USERID (= victim). The attacker is now in the victim's session, MFA satisfied, for all later requests.
Impact
Complete MFA bypass (CWE-287 / CWE-304). Any attacker who knows a victim's password can authenticate as the victim without the victim's second factor, by substituting their own authenticator. This includes administrator accounts, yielding full takeover.
Attacker requirements: a logged-in attacker account of any privilege level, with an MFA secret enrolled, plus knowledge of the victim's password. No victim interaction.
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.7, 4.3.6, 4.4.2 | — | — |
4.2.74.3.64.4.2Arsenal 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-qf2x-2339-gr6rLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
