Fix security vulnerability Issue 707 by implementing rate limiting on…#720
Open
Shubham-Gotawade wants to merge 1 commit into
Open
Fix security vulnerability Issue 707 by implementing rate limiting on…#720Shubham-Gotawade wants to merge 1 commit into
Shubham-Gotawade wants to merge 1 commit into
Conversation
… recommend endpoint
|
@Shubham-Gotawade is attempting to deploy a commit to the komalsony234-1530's projects Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements defensive middleware throttling on the project matching engine endpoint. Previously, the
/api/recommendroute had no request limits, leaving the backend highly vulnerable to automated script abuse, computational bottlenecking, and resource exhaustion. This update adds individual client IP rate limiting alongside a graceful JSON fallback payload handler.Related Issue [required]
Closes #707
Type of Change
data/projects.jsonWhat Was Changed
requirements.txtFlask-Limiter==3.7.0dependency tracking.routes/main_routes.pyget_remote_address), added a native429error intercept handler, and attached the 5 requests/min limit decorator.app.pyHow to Test This PR
git checkout security/rate-limitingpip install -r requirements.txtpython app.py{"status": 429, "error": "Too Many Requests"}instead of crashing.Test Results
Manual middleware integration verification passed successfully. Throttling triggers exactly on limit saturation parameters and handles client error responses safely.
Self-Review Checklist
feat/,fix/,docs/,data/,style/,test/Notes for Reviewer
None. The middleware isolates client requests natively inside blueprint scopes to avoid cross-route state leaking.