Skip to content

Fix for bug #3214 which had noted there was no request rate limit to - WIP - #3261

Merged
briri merged 5 commits into
developmentfrom
bug-3214-vulnerability_no_rate_limit_on_reset_password_link
Mar 24, 2023
Merged

Fix for bug #3214 which had noted there was no request rate limit to - WIP#3261
briri merged 5 commits into
developmentfrom
bug-3214-vulnerability_no_rate_limit_on_reset_password_link

Conversation

@johnpinto1

@johnpinto1johnpinto1 commented Dec 8, 2022

Copy link
Copy Markdown
Contributor

resetting the password.

DO NOT MERGE: PR CREATED FOR DISCUSSION

The Rack-Attack middleware for blocking & throttling abusive requests is being used.
https://github.com/rack/rack-attack/blob/6-stable/README.md

Fixes#3214

Changes:

  • Added rack-attack version 6.6.1 gem. https://rubygems.org/gems/rack-attack/versions/6.6.1
  • Added config/initializers/rack_attack.rb:
    • The rack-attack functionality is enabled with
      Rack::Attack.enabled = true
      but may be switched off
      Rack::Attack.enabled = false.
    • Password reset requests are currently throttled from an IP address for POSTs to path /users/passwords and is limited 2 requests every 30 seconds.
    • Login requests are throttled from an IP address for POSTs to path /users/sign_in and is limited 4 requests every 30 seconds.
    • A new html page public/429.html with title "Too Many Request" is added.

Selection_036

@johnpinto1
johnpinto1force-pushed the bug-3214-vulnerability_no_rate_limit_on_reset_password_link branch from 8497198 to cbff267CompareDecember 8, 2022 13:32
@johnpinto1
johnpinto1force-pushed the bug-3214-vulnerability_no_rate_limit_on_reset_password_link branch 2 times, most recently from 94ef895 to d809377CompareDecember 19, 2022 12:24
resetting the password.
The Rack-Attack middleware for blocking & throttling abusive requests is
being used.
https://github.com/rack/rack-attack/blob/6-stable/README.md
Changes:
- Added rack-attack version 6.6.1 gem. https://rubygems.org/gems/rack-attack/versions/6.6.1
- Added config/initializers/rack_attack.rb:
- The rack-attack functionality is enabled with
Rack::Attack.enabled = true
but may be switched off
Rack::Attack.enabled = false.
- Password reset requests are currently throttled from from an IP address
for POSTs to path /users/passwords and is limited 2 requests every 30 seconds.
ess
- Login requests are throttled from an IP address
for POSTs to path /users/sign_in and is limited 4 requests every 30 seconds. - A new html page public/429.html with title "Too Many Request" is added.
@johnpinto1
johnpinto1force-pushed the bug-3214-vulnerability_no_rate_limit_on_reset_password_link branch from d809377 to 71c9e55CompareJanuary 10, 2023 15:01
@briribriri changed the title Fix for bug #3214 which had noted there was no request rate limit toFix for bug #3214 which had noted there was no request rate limit to - WIPJan 23, 2023
@briri

Copy link
Copy Markdown
Contributor

@johnpinto1 I have rebased this against the latest development branch (which is now on Ruby 3.0.4).

Did you want to make any further changes to this before it gets merged in?

@johnpinto1

Copy link
Copy Markdown
ContributorAuthor

@johnpinto1 I have rebased this against the latest development branch (which is now on Ruby 3.0.4).

Did you want to make any further changes to this before it gets merged in?

@briri go ahead and merge.
@martaribeiro & @gjacob24 we can use the commit to patch our Ruby 2.7 our repo.

@briri
briri merged commit 5ac38d3 into developmentMar 24, 2023
@briri
briri deleted the bug-3214-vulnerability_no_rate_limit_on_reset_password_link branch March 24, 2023 16:12
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@johnpinto1@briri@dsisu@martaribeiro@benjaminfaure@pengyin-shan@gjacob24