Repository navigation
Tags
Tags
fix(security): prevent NoSQL operator injection in /api/activate (GHS… …A-c686-3wqx-x82h) - Enforce strict string type and format validation on `userId`, `token`, and `password` in `userController.activate` before querying the database - Cast `userId` to `mongoose.Types.ObjectId` and `token` to `String` explicitly, and consume tokens atomically via `Token.findOneAndDelete` to prevent replay attacks - Add rate limiting to `/api/activate` and protect `DELETE /api/delete-tokens/:userId` with `authJwt.verifyToken` and ownership/admin checks - Prevent unauthenticated `user.active = false` account lockouts in `userController.resend` - Add Jest + Supertest security regression tests in `backend/__tests__/activate.test.ts`
PreviousNext