Store invite tokens hashed at rest #41
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Finding (security review — Low)
InviteRepository(src/Auth/InviteRepository.php) stores and looks up raw invite tokens. The token is generated well (wp_generate_password(32, false)is CSPRNG-backed) and pending invites expire after 14 days, but anyone with read access to the database (backup leak, SQL injection in an unrelated plugin) can redeem pending invites and mint student accounts.Fix
hash('sha256', $token)instead of the raw token; hash the incoming token before lookup in the registration flow.