Skip to content

Commit

Permalink
fix bypass in rate limiting
Browse files Browse the repository at this point in the history
thanks to whokilleddb for the report
  • Loading branch information
pushcx committed Jul 20, 2022
1 parent d75dcbf commit 190ce7c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions config/initializers/rack_attack.rb
Expand Up @@ -18,8 +18,10 @@
end
# at some point they'll proceed to testing credentials
Rack::Attack.throttle("login", limit: 4, period: 60) do |request|
request.ip if request.post? &&
(request.path == '/login' || request.path == '/login/set_new_password')
request.ip if request.post? && (
request.path.start_with?('/login') ||
request.path.start_with?('/login/set_new_password')
)
end

Rack::Attack.throttle("log4j probe", limit: 1, period: 1.week.to_i) do |request|
Expand Down

0 comments on commit 190ce7c

Please sign in to comment.