You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR fixes a security issue where the track-user API route bypasses rate limiting when getClientIp() returns "unknown". Previously, requests with an undetermined IP were not subjected to any rate-limit checks, allowing unlimited requests and potential abuse.
The fix ensures that even when the client IP cannot be resolved, the request is still rate-limited using a fallback key instead of skipping the limiter entirely.
Changes
Introduced a fallback rate-limit key for "unknown" IP values
Ensured all requests are subject to rate limiting regardless of IP resolution
Prevented bypass of trackUserRateLimiter.check() in edge cases
Maintained special handling for localhost (127.0.0.1)
Pillar
🎨 Pillar 1 — New Theme Design
📐 Pillar 2 — Geometric SVG Improvement
🕐 Pillar 3 — Timezone Logic Optimization
🛠️ Other (Bug fix, refactoring, docs)
Visual Preview
N/A (Backend API / Security fix)
Checklist before requesting a review:
I have read the CONTRIBUTING.md file.
I have tested these changes locally (localhost:3000/api/streak?user=YOUR_USERNAME).
I have run npm run format and npm run lint locally and resolved all errors (CI will fail otherwise).
My commits follow the Conventional Commits format (e.g., feat(themes): ..., fix(calculate): ...).
I have updated README.md if I added a new theme or URL parameter.
I have started the repo.
I have made sure that i have only one commit to merge in this PR.
The SVG output matches the CommitPulse "premium quality" aesthetic standard (no raw elements, smooth animations, correct fonts).
(Recommended) I joined the CommitPulse Discord community for contributor discussions, mentorship, and faster PR support.
JhaSourav07
added
level:beginner
Small changes Usually isolated fixes or simple UI/text updates.
quality:exceptional
Outstanding contribution with exceptional implementation quality, testing.
gssoc:approved
PR has been reviewed and accepted for valid contribution points
and removed
level:advanced
Complex contributions involving architecture, optimization, or significant feature work
quality:clean
PR follows clean coding practices, proper formatting, documentation, and maintainability standards.
labels
Jun 3, 2026
🎉 Congratulations @mohdsubhan1756! Your PR has been successfully merged. 🚀
Thank you for contributing to CommitPulse. Your work helps us build a better tool for the community.
⚠️Important for GSSoC Contributors:
You are strictly advised to join our Discord Server as it is mandatory for all GSSoC participants. All important announcements, point claims, and community discussions happen there.
Keep building! 💻✨
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
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.
Description
Fixes #3354
This PR fixes a security issue where the
track-userAPI route bypasses rate limiting whengetClientIp()returns"unknown". Previously, requests with an undetermined IP were not subjected to any rate-limit checks, allowing unlimited requests and potential abuse.The fix ensures that even when the client IP cannot be resolved, the request is still rate-limited using a fallback key instead of skipping the limiter entirely.
Changes
"unknown"IP valuestrackUserRateLimiter.check()in edge cases127.0.0.1)Pillar
Visual Preview
N/A (Backend API / Security fix)
Checklist before requesting a review:
CONTRIBUTING.mdfile.localhost:3000/api/streak?user=YOUR_USERNAME).npm run formatandnpm run lintlocally and resolved all errors (CI will fail otherwise).feat(themes): ...,fix(calculate): ...).README.mdif I added a new theme or URL parameter.