This is a bounty to fix a critical security vulnerability in a user registration process. Currently, a new user can self-assign the 'admin' role during public registration, gaining unauthorized privileges. The fix involves restricting registration to only 'client' and 'freelancer' roles, rejecting 'admin' if present in the request body.
A starter prompt for Claude Code, what you'll need, and how to reach them.
You are an expert full-stack developer. The goal is to fix a critical security vulnerability in the user registration process of a GitHub project at `SecureBananaLabs/bug-bounty`. The existing system allows new users to self-assign the 'admin' role during public registration by submitting `role: "admin"` in the request body. Your task is to implement a server-side validation that restricts new user registration to only 'client' and 'freelancer' roles, rejecting any attempt to register with 'admin'. Focus on a Node.js/Express backend, assuming standard API routes for user registration. Implement the fix, write a corresponding unit test to verify that 'admin' role assignment is prevented, and ensure legitimate 'client' and 'freelancer' registrations still function. Deliver the solution as a clear pull request to the forked repository. Provide the specific code changes for the validation logic and the new unit test. Prioritize clarity and security best practices.
Standard for any GitHub-based project.
Bounty (amount on the issue). Same as #1426, registration role restriction. Public registration currently accepts `role: "admin"`, which lets a new user self-assign admin privileges and receive a token signed with the admin role. Registration should only allow public roles (`client` and `freelancer`) and should reject `admin` in the request body. --- This issue is limited only to the creator of this issue. This means that only the issue author can attempt to solve this issue. If you would like to work on it, please create another issue with the same contents and refer to issue #743 for more information. Refs #743.
Operator's core competency.
Standard security knowledge for web apps.
Standard development tool.
Create a new GitHub issue on the `SecureBananaLabs/bug-bounty` repository with the exact contents of issue #2832, referencing #743, and ask for permission to work on it as per the issue description.
“I've identified the solution for the self-assignment admin role vulnerability described in issue #2832 and #1426. Per the instructions, I've created a duplicate issue [link to your new issue] and would like to propose a fix. I can deliver a tested PR quickly.”
Open the original ↗