Fix security vulnerability Issue 707 by implementing rate limiting on… - #720
Closed
Shubham-Gotawade wants to merge 10 commits into
Closed
Fix security vulnerability Issue 707 by implementing rate limiting on…#720Shubham-Gotawade wants to merge 10 commits into
Shubham-Gotawade wants to merge 10 commits into
Conversation
…ighted recommendations
|
@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. |
komalharshita
requested changes
Jun 4, 2026
komalharshita
left a comment
Owner
There was a problem hiding this comment.
Thank you for the contribution.
Adding rate limiting to the recommendation endpoint is a useful security improvement and the overall approach using Flask-Limiter is reasonable.
However, I cannot approve the PR in its current state for the following reasons:
- The PR introduces a new dependency and changes API behavior but does not include tests validating the rate limiting functionality.
- The rate limit value (
5 per minute) is hardcoded and no justification is provided for this threshold. A configurable value would be more maintainable. - The selected limit may be overly restrictive for legitimate users, testing, or demonstrations.
- The PR currently contains merge conflicts and must be rebased against the latest main branch before review can continue.
Please address the above points and update the PR for another review.
Requested changes.
Shubham-Gotawade
marked this pull request as draft
June 4, 2026 08:05
…ward compatibility
… proficiency configurations
…ss validation tests
Shubham-Gotawade
force-pushed
the
security/rate-limiting
branch
from
June 4, 2026 08:34
4a19172 to
4109417
Compare
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.