Skip to content
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

Flask: throttle initiation requests per me/ip #25

Open
fluffy-critter opened this issue Jul 18, 2019 · 1 comment
Open

Flask: throttle initiation requests per me/ip #25

fluffy-critter opened this issue Jul 18, 2019 · 1 comment

Comments

@fluffy-critter
Copy link
Contributor

fluffy-critter commented Jul 18, 2019

To prevent a site from being used in an amplification attack or part of an email bomb or whatever, the login endpoint should throttle requests made based on both the me parameter and on the originating IP address (as determined by eg flask.request.headers.get(“x-forwarded-for”,flask.request.remote_addr) or whatever the correct invocation is). The timeout should probably be stored in an expiringdict with the next timeout computed by adding the delta between the current timeout and the current time multiplied by some constant, with the initial timeout and constant being configurable.

Care should be taken to not accidentally make this a vector for maliciously locking people out, though.

@fluffy-critter
Copy link
Contributor Author

Might not really be necessary/useful though. #18 handles the email bomb case, and fixed OAuth-based handlers only produce a forwarding URL for the user to follow. Discovery-based handlers (mastodon/indieauth) should be caching the discovered endpoint/credentials already.

So this feels like a low priority but it’s something to keep in mind for any future auth mechanisms which come along.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant