Skip to content

Study session IDs are sequential integers, enabling unauthorized room enumeration #1872

Description

@anshul23102

Bug Description

Study session join links use auto-incrementing numeric IDs (e.g., /session/42). An attacker can enumerate all sessions by iterating integers, joining private sessions without an invitation.

Steps to Reproduce

  1. Create a private session and note its ID (e.g., 15).
  2. Try accessing /session/14, /session/13, etc.
  3. Observe: other users' private sessions are accessible.

Root Cause

The sessions table uses SERIAL or BIGSERIAL as the primary key and exposes that integer directly in the join URL.

Impact

Unauthorized access to private peer-learning sessions; exposure of session content to uninvited participants.

Proposed Fix

ALTER TABLE sessions ADD COLUMN public_id UUID
  DEFAULT gen_random_uuid() NOT NULL UNIQUE;

Use public_id (UUID) in all join URLs and API routes instead of the integer primary key.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions