Close captcha-bypass and email-abuse vectors
- Block direct /api/auth/sign-up at the middleware (404): it bypassed the Turnstile/honeypot wrapper. /api/register is unaffected — it invokes auth.handler programmatically, not through HTTP. - Tighten rate limits on send-verification-email and forget-password (3/min/IP): both send emails to arbitrary addresses and shared the loose global 100/min limit. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -54,6 +54,10 @@ export const auth = betterAuth({
|
||||
// массовый сброс паролей + общие IP (офис/NAT). 10/мин/IP — защита
|
||||
// от брутфорса сохраняется, но терпимо к повторам и опечаткам.
|
||||
"/sign-in/email": { window: 60, max: 10 },
|
||||
// Эндпоинты, отправляющие письма на произвольный адрес: глобальный
|
||||
// лимит 100/мин позволял абузить почтовую репутацию домена.
|
||||
"/send-verification-email": { window: 60, max: 3 },
|
||||
"/forget-password": { window: 60, max: 3 },
|
||||
},
|
||||
},
|
||||
trustedOrigins: [
|
||||
|
||||
Reference in New Issue
Block a user