From 7bf860cde5b343567b1b5402681b3f6c1455655f Mon Sep 17 00:00:00 2001 From: Ersun Warncke Date: Fri, 21 Dec 2018 08:06:00 -0400 Subject: [PATCH] Merge pull request #1312 from sharelatex/ja-add-rate-limits Add rate limits to adding emails and changing password GitOrigin-RevId: e73c17985cc9c74d60f8856b3b47b28fecd0d489 --- services/web/app/coffee/router.coffee | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/services/web/app/coffee/router.coffee b/services/web/app/coffee/router.coffee index 8e45788281..f864535706 100644 --- a/services/web/app/coffee/router.coffee +++ b/services/web/app/coffee/router.coffee @@ -127,9 +127,19 @@ module.exports = class Router if Features.hasFeature 'affiliations' webRouter.post '/user/emails', AuthenticationController.requireLogin(), + RateLimiterMiddlewear.rateLimit({ + endpointName: 'add-email', + maxRequests: 10 + timeInterval: 60 + }), UserEmailsController.add webRouter.post '/user/emails/delete', AuthenticationController.requireLogin(), + RateLimiterMiddlewear.rateLimit({ + endpointName: 'delete-email', + maxRequests: 10 + timeInterval: 60 + }), UserEmailsController.remove webRouter.post '/user/emails/default', AuthenticationController.requireLogin(),