rack-attack Gem for Ruby missing normalization before request path processing

Metadata

unknown
unknown
rack-attack
github.com
2015-12-18
2017-04-01 19:10
2017-01-05 20:14

Description

When using rack-attack with a rails app, developers expect the request
path to be normalized. In particular, trailing slashes are stripped so
a request path "/login/" becomes "/login" by the time you're in
ActionController.

Since Rack::Attack runs before ActionDispatch, the request path is not
yet normalized. This can cause throttles and blacklists to not work as
expected.

E.g., a throttle:

`throttle('logins', ...) {|req| req.path == "/login" }`

would not match a request to '/login/', though Rails would route
'/login/' to the same '/login' action.

Am I vulnerable?

The constraints below list the versions that this vulnerability is patched in, and versions that are unaffected. If a patch is ready but unrealeased, then it is pending.

Or, you can just let us figure it out for you! Appcanary continously monitor your installed packages, and tell you if any of them are vulnerable.

Sign up for monitoring

Affected package information

Package Patched in Unaffected in
rack-attack >= 4.3.1 None