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
session: stop reusing pruned session ids so a stalled caller cannot reach a new session #413
After #317, session prune removes a destroyed session's .<id>.input-closed and .<id>.takeover-identity markers one day after its teardown. Until then they reserve the id. After that, createSession can draw the same random 32-bit id again.
A caller that read the old session record and then stalled for more than a day (for example a stopped process) re-checks the session by id when it resumes. If a new session drew the same id in the meantime, the stale call can pass the checks against the new record. Desktop input also needs the new session to run on the same display number, because the owned display check re-reads the record. Two concurrent prunes have a similar gap: one can unlink a marker that a reused id created after the other checked it.
Each case needs a new session to draw one specific freed id, about 2^-32 per creation, so this is hardening, not an active bug.
Plan change
The generation binding below was dropped after council review. Every check-then-mutate path (update, destroy, stop input) and every first read outside a caller scope still raced a reuse, so it narrowed the window without closing it. The fix removes reuse instead: new ids carry 8 random bytes, so a new session draws one specific freed id with a chance of 2^-64 per creation.
New session ids carry 64 random bits (16 hex characters)
Sessions with 8-hex ids from before the change still read, update and destroy
Test the id length for every session type and an old 8-hex record
changed the title [-]session: bind late callers to a session generation so a reused id refuses stale input[/-][+]session: stop reusing pruned session ids so a stalled caller cannot reach a new session[/+]on Oct 29, 2026
Activity
[-]session: bind late callers to a session generation so a reused id refuses stale input[/-][+]session: stop reusing pruned session ids so a stalled caller cannot reach a new session[/+]