feat: enforce admin 2FA, step-up auth, stronger password policy
Implements OWASP audit recommendations P1-P3: P1 - Two-factor authentication (TOTP) mandatory for admins: - better-auth twoFactor plugin; new two_factor table + user flag (migration 0010, MUST run before deploying the app) - requireAdmin throws TWO_FACTOR_REQUIRED without a finished setup; pages redirect to the new /zwei-faktor wizard which uses a weak guard (allowWithoutTwoFactor) so admins can never lock themselves out. Wizard lives outside /admin to avoid layout redirect loops. - login flow handles twoFactorRedirect and asks for the TOTP code; backup codes are shown once during enablement P2 - Step-up for destructive operations (ASVS 2.5.4): - hardDeleteEditorialAction and resetUsageDataAction reject sessions older than 15 minutes (SESSION_STALE) with actionable German messages instead of throwing opaque digests P3 - Password policy (NIST 800-63B): - minimum length raised from 8 to 12 plus common-password denylist, enforced for registration AND reset/change via a before-hook
This commit is contained in:
1 parent
9308b46d84
commit
0d939593c8
20 files changed
+2613
-29
No files matched your search
@@ -71,6 +71,13 @@
|
||||
"when": 1786455754414,
|
||||
"tag": "0009_usage_created_at_index",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 10,
|
||||
"version": "7",
|
||||
"when": 1787617368189,
|
||||
"tag": "0010_two-factor",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user