Flask: throttle initiation requests per me/ip
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 40
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the Flask login endpoint and trace how the me parameter and originating address are currently obtained. Review the proposed expiringdict timeout state and configurable initial timeout and multiplier, then define completion around throttling both identities without creating an easy lockout vector.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- flask, python
- Domain
- authentication, backend, security
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100