You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Calendar feed tokens are guessable and keep working after a user loses access #436
CUser::generateToken() (modules/users/users.class.php L287) builds the feed token as md5(time() . $userId . $token . time()). The user id is small and the time is roughly known, so a token can be guessed by trying the seconds around the moment it was created.
calendar.php (L14–35) then serves the calendar of whichever user the token maps to. It never checks that the user can still log in, so a user whose roles were all removed keeps a working feed.
Fix:
Generate the token with bin2hex(random_bytes(20)) (the column is VARCHAR(255)).
In getIdByToken()/calendar.php, return nothing unless the user passes isActive() (and, from Phase 0, user_status = 'active').
Activity
Calendar feeds: random tokens, and none for users who can't log in
Contacts: make the self-update key random