GHSA-H96G-59XP-7R5M
Two-factor authentication can be disabled without re-authentication (session + CSRF token only)
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-H96G-59XP-7R5M divulgada · CVSS 7.1 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
> Authorized research notice: This vulnerability was discovered during authorized security research in an isolated lab environment against a local instance of phpMyFAQ (main @ 9435f34bd8fcaaeee02a9f679192e46b1b5fedcf, 4.2.0-alpha.2; issues cross-checked against the 4.1 stable branch where applicable). No production systems or third-party data were accessed. I am reporting under coordinated disclosure and will not publish details for 90 days from this report to allow a fix. Please confirm receipt within 7 days.
Summary
`POST /api/user/remove-twofactor` disables TOTP two-factor authentication for the current user requiring only a session cookie and a CSRF token — no password re-entry and no current TOTP code. The same downgrade is reachable inline via `PUT /api/user/data/update`, which accepts a plain `twofactor_enabled` form field. Anyone with a foothold in the user's browser session can silently strip the account's second factor. Combined with the unverified password change reported separately, this converts any session compromise into a full, persistent account takeover.
Credit: Ahmed Ibrahim (@skeletonsec)
Affected versions
- Verified on `main` @ `9435f34` (4.2.0-alpha.2 nightly, `phpmyfaq/src/phpMyFAQ/Controller/Frontend/Api/UserController.php:288-321` and `:105`)
- Same defect verified on the `4.1` stable branch (`phpmyfaq/src/phpMyFAQ/Controller/Frontend/UserController.php:267-290` and inline toggle at `:93`), affecting the latest stable release line.
Root cause
`removeTwofactorConfig()` checks only the `remove-twofactor` CSRF token and `isLoggedIn()`, then executes `setUserData(['secret' => $newSecret, 'twofactor_enabled' => 0])`. No step-up authentication (password or current TOTP) is requested. `updateData()` additionally assigns `twofactor_enabled` directly from a form field under the same session+CSRF-only guard.
Proof of concept
- Victim account has 2FA enabled: password-only login is refused with a redirect to `/token?user-id=N` (TOTP demanded).
- Attacker holding the victim session: `GET /user/ucp`, take the `pmf-csrf-token-remove-twofactor` value.
- ```
- `faquserdata` now shows `twofactor_enabled = 0`; password-only login succeeds (302 → `/`, no `/token` step).
Verified end-to-end in an isolated lab with a known TOTP seed. PoC script and transcripts available on request.
Impact
Silent security-setting downgrade of any account, including administrators. After one request, password-only authentication suffices.
Suggested remediation
Require a current TOTP code (or password) and verify it before disabling 2FA; apply the same step-up check to the `twofactor_enabled` field in `updateData()`; notify the user by email and invalidate other sessions when 2FA is disabled.
CWE
CWE-308: Use of Single-factor Authentication
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 |
|---|---|---|---|---|
Packagistphpmyfaq/phpmyfaq |
Sin parche | — | — | — |
Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/thorsten/phpMyFAQ/security/advisories/GHSA-h96g-59xp-7r5mLas referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
