Skip to content

Calendar feed tokens are guessable and keep working after a user loses access #436

Closed

Description

@caseysoftware

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').

Blocks #458.

Fix before Phase 0 of the Identity Layer proposal (#435).

Activity

  1. added 2 commits that reference this issue on Oct 24, 2026
    5ad84c8
    c5f5a1d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions