-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ip ratelimiting when using a proxy like cloudflare #55
Comments
I've answered this probably half a dozen times: this is too deployment-specific to do securely in a general solution. It's too big a footgun, and ratelimit is the wrong place for it. There are reasons and suggestions here: https://django-ratelimit.readthedocs.org/en/latest/security.html#client-ip-address |
Ah, my brain must have skipped right over the "Note" on the keys page. Seems reasonable enough. Thanks. |
Not sure if this is relevant but what if you did this? Typical behavior: https://support.cloudflare.com/hc/en-us/articles/201897700-Allowing-Cloudflare-IP-addresses |
Hi @9mido, please see the previous comment and documentation about client IP address. |
If you are using the 'ip' ratelimitnig key and a proxy like cloudflare, then it will always return the same ipaddress, which could be disastrous.
A simple cloudflare solution would be for users of this library to create their own callable for the key as such:
However, I wonder if there's a more general solution for using
X-FORWARDED-FOR
or if that's too easily spoofed? A change inutils.py
like:Does anyone know what risks there could be in using x-forwarded-for?
The text was updated successfully, but these errors were encountered: