fix IDOR vulnerability, increase userId entropy, and add rate limiting (Fixes #29)#30
Open
ArshVermaGit wants to merge 1 commit into
Open
fix IDOR vulnerability, increase userId entropy, and add rate limiting (Fixes #29)#30ArshVermaGit wants to merge 1 commit into
ArshVermaGit wants to merge 1 commit into
Conversation
Contributor
|
@ArshVermaGit is attempting to deploy a commit to the coderzs' projects Team on Vercel. A member of the Team first needs to authorize it. |
ArshVermaGit
commented
May 25, 2026
ArshVermaGit
left a comment
Author
There was a problem hiding this comment.
Hi @coder-zs-cse ! Issue #29 has been resolved. Please review the PR and merge it under GSSoC. Thanks!
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.
Description
This PR resolves the critical security vulnerabilities outlined in Issue #29.
Previously, the application implicitly trusted an easily guessable 8-character
userIdheader, allowing malicious actors to manipulate other players' game progress (IDOR) and spam the API without restriction.This PR hardens the authentication and API layer by introducing UUIDs, JSON Web Tokens (JWT), and Edge Middleware rate limiting.
Key Changes
/api/new-userendpoint now generates and signs a JWT containing the user's UUID usingjose. The frontend securely stores this and attaches it as a Bearer token.userIdinto downstream requests, completely blocking IDOR attacks.Verification & Proof
1. Secure Tokens
The application now securely issues a strong UUID and a signed JWT to the client upon creation.

2. IDOR / Auth Bypass Blocked
Requests missing a valid cryptographic signature are now actively rejected by the middleware with a

401 Unauthorized, preventing anyone from spoofing IDs.3. Rate Limiting Active
Automated scripts attempting to abuse the API are successfully blocked. The screenshot below demonstrates a spam script being halted with a

429 Too Many Requestsafter the 60th attempt.Closes #29