p5.js version
No response
What is your operating system?
None
Web browser and version
No response
Actual Behavior
duplicateUserCheck uses req.query.check_type as both the key to read the value (req.query[checkType]) and as valueType for findByEmailOrUsername, with no validation. Sending check_type=__proto__ or constructor can lead to prototype pollution or unexpected behavior.
Location: server/controllers/user.controller/signup.ts lines 98–100
Expected Behavior
check_type should be validated to be exactly 'email' or 'username'. Any other value should return 400 with a clear error.
Steps to reproduce
Steps:
- Call
GET /editor/signup/duplicate_check?check_type=__proto__ (or check_type=constructor).
- Observe server uses that value as query key and as
valueType; no validation error.
- Compare with valid call:
GET /editor/signup/duplicate_check?check_type=email&email=test@example.com.
Snippet:
// signup.ts - duplicateUserCheck
const checkType = req.query.check_type;
const value = req.query[checkType]; // no whitelist
const options = { caseInsensitive: true, valueType: checkType };
const user = await User.findByEmailOrUsername(value!, options);