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

Implement rate limiting #699

Merged
merged 11 commits into from
Sep 21, 2017
Merged

Implement rate limiting #699

merged 11 commits into from
Sep 21, 2017

Conversation

Changaco
Copy link
Member

This branch implements half of #658 and half of #61, closes #478, and also closes #495.

The proposed rate limits are:

  • for verification emails (when a new account is created or an email address is added to an existing account): 5 per day per user, 2 per day per email address
  • for email logins: 10 per day per user, 2 per day per unverified email address
  • for password logins: 3 per hour per user
  • for account creations: 5 per hour per IP address, 15 per 15 minutes per IP network (/16 for IPv4, /32 for IPv6), 15 per 15 minutes per IP version (IPv4 or IPv6)

The hardest part for the account creation rate limits was actually determining the IP address of the request in a reliable way. I ended up implementing the logic in the python app (could be moved upstream to Pando).

Ping @EdOverflow since this is about protecting Liberapay from DoS attacks (and other people from email spam).

Remaining TODO:

@Changaco
Copy link
Member Author

I've created an issue about moving stuff upstream into Pando: AspenWeb/pando.py#581.

@EdOverflow
Copy link
Member

@Changaco: I am currently reviewing this PR. Are you able to access Gratipay's HackerOne inbox?

@Changaco
Copy link
Member Author

@EdOverflow No. I remember proposing to help with Gratipay's HackerOne a while back, but I wasn't given access.

@Changaco
Copy link
Member Author

If there is no concrete feedback I'm going to merge this soon.

@Changaco
Copy link
Member Author

Rebased on master. Will merge once Travis is green.

@Changaco Changaco merged commit 29c90ac into master Sep 21, 2017
@Changaco Changaco deleted the rate-limiting branch September 21, 2017 16:23
@Changaco
Copy link
Member Author

This is now deployed.

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

Successfully merging this pull request may close these issues.

Authentication attempts aren't rate-limited Sign-ups aren't throttled
2 participants