You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ThrottlerModule is configured in AppModule with named buckets (short/medium/long) but @Throttle() decorators are only applied to newsletter and contact endpoints. All auth, booking, and payment routes are effectively unprotected against brute-force and API abuse attacks.
@Throttle() from @nestjs/throttler — apply per controller or per route handler
Tasks
Verify the global ThrottlerGuardAPP_GUARD is correctly rejecting over-limit requests with HTTP 429 Too Many Requests; write a quick smoke test or manual test to confirm
Apply @Throttle({ short: { ttl: 1000, limit: 3 } }) to all auth endpoints: POST /auth/login, POST /auth/register, POST /auth/forgot-password
Apply strictest limits to OTP and 2FA endpoints: max 5 per 10 minutes — POST /auth/verify-otp, POST /auth/2fa/verify, POST /auth/2fa/sms/send-code, POST /auth/2fa/sms/verify
Apply @Throttle({ medium: { ttl: 60000, limit: 10 } }) to payment initiation endpoints: POST /payments/initialize, POST /credits/purchase
Apply @Throttle({ long: { ttl: 60000, limit: 30 } }) to booking creation: POST /bookings
Confirm that the feedback named throttler bucket (defined in AppModule) is actually wired to a route decorator — if orphaned, either wire it or remove it
Overview
The
ThrottlerModuleis configured inAppModulewith named buckets (short/medium/long) but@Throttle()decorators are only applied to newsletter and contact endpoints. All auth, booking, and payment routes are effectively unprotected against brute-force and API abuse attacks.Context
ThrottlerModuleconfig:backend/src/app.module.ts(short=3/s, medium=20/10s, long=100/min)ThrottlerGuardregistered as globalAPP_GUARD— verify it is active and workingbackend/src/newsletter/newsletter.controller.ts,backend/src/contact/contact.controller.ts@Throttle()from@nestjs/throttler— apply per controller or per route handlerTasks
ThrottlerGuardAPP_GUARDis correctly rejecting over-limit requests with HTTP429 Too Many Requests; write a quick smoke test or manual test to confirm@Throttle({ short: { ttl: 1000, limit: 3 } })to all auth endpoints:POST /auth/login,POST /auth/register,POST /auth/forgot-passwordPOST /auth/verify-otp,POST /auth/2fa/verify,POST /auth/2fa/sms/send-code,POST /auth/2fa/sms/verify@Throttle({ medium: { ttl: 60000, limit: 10 } })to payment initiation endpoints:POST /payments/initialize,POST /credits/purchase@Throttle({ long: { ttl: 60000, limit: 30 } })to booking creation:POST /bookingsfeedbacknamed throttler bucket (defined inAppModule) is actually wired to a route decorator — if orphaned, either wire it or remove itFiles to Modify / Create
backend/src/auth/auth.controller.tsbackend/src/payments/payments.controller.tsbackend/src/bookings/bookings.controller.ts