Skip to content

Predictable, low-entropy room-name generation allows joining other users' screen-sharing sessions #255

Open

Description

@carfeii

Affected versions: confirmed on commit 4ae5f443190be0ffa192a950531cf0aef646162b (master).

Summary

The room name returned by /config and used as the access token for joining an active screen-sharing room (ws.Join) is generated by util.NewRoomName, drawing from a math/rand.Rand seeded with time.Now().Unix() in ws.NewRooms. This is a non-cryptographic, one-second-resolution, publicly-observable seed, and math/rand is fully deterministic given it. An attacker who can bound the server's start time to a window of a few minutes (easily obtainable from uptime/health data, deploy timing, or container start time) can brute-force the exact seed offline and predict every room name the server will generate, past and future. Independent of that, the generator's keyspace is only about 135,000 combinations (53 adjectives x 51 colors x 50 animals), small enough to brute-force directly against the join flow.

Details

Affected code:

  • ws/rooms.go: r: rand.New(rand.NewSource(time.Now().Unix()))
  • util/sillyname.go: NewRoomName drawing from three small wordlists (adjectives/colors/animals)
  • ws/event_join.go: Join.Execute performs no AuthMode check and sets up a full WebRTC signaling session (room.newSession) with any client that supplies a room ID matching an existing room, whether or not that client is logged in

Room creation (ws/event_create.go) does check AuthMode for who may create a room, but any client (authenticated or not, depending on SCREEGO_AUTH_MODE) may join an existing room purely by knowing its ID, and that ID is suggested to users from the weak generator above.

Steps To Reproduce

(available upon request)

Impact

Under the default SCREEGO_AUTH_MODE=turn and under none, any attacker who predicts or brute-forces an active room's name can join that room's screen-sharing session with no login step, receiving a live WebRTC connection to the host's shared screen. Even under all mode, joining an already-created room still requires no credential, only room-ID knowledge, so the same exposure applies to any room the attacker can predict or guess.

Suggested fix: generate room IDs from a cryptographically secure random source (crypto/rand) with sufficient entropy (e.g., a UUID or a securely-generated token of adequate length) rather than math/rand seeded from wall-clock time, and/or require authentication to join a room (not just to create one) when SCREEGO_AUTH_MODE is anything other than none.

Activity

  1. jmattheis commented on Oct 25, 2026

    @jmattheis
    Member

    I'd say this is by design or at least the aren't any promises made that the room name is unique or secure. If you need a truly unique name, generate it yourself or guard screego with forward auth or deploy it in an internal network.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions