Skip to content

fix(gateway): validate user authorization before auto-resume#23800

Open
ygd58 wants to merge 1 commit into
NousResearch:mainfrom
ygd58:fix/telegram-auto-resume-auth
Open

fix(gateway): validate user authorization before auto-resume#23800
ygd58 wants to merge 1 commit into
NousResearch:mainfrom
ygd58:fix/telegram-auto-resume-auth

Conversation

@ygd58

@ygd58 ygd58 commented May 11, 2026

Copy link
Copy Markdown
Contributor

Problem

Auto-resume of restart-interrupted sessions bypassed auth checks. The session owner was never validated against TELEGRAM_ALLOWED_USERS before the synthetic resume event was dispatched. An attacker with an active session before the allowlist was configured could receive a full agent response on gateway restart.

Fix

Check _is_callback_user_authorized() for the session owner before scheduling auto-resume. Unauthorized sessions are skipped with a warning log.

Follows up on #23795 (inbound message auth bypass).

Fixes #23778 (partial - auto-resume auth bypass)

Auto-resume of restart-interrupted sessions bypassed auth checks —
the session owner's user_id was never validated against TELEGRAM_ALLOWED_USERS
before the synthetic resume event was dispatched. An attacker who had
an active session before TELEGRAM_ALLOWED_USERS was configured could
receive a full agent response on gateway restart (issue NousResearch#23778).

Fix: check _is_callback_user_authorized() for the session owner before
scheduling auto-resume. Sessions whose owner is no longer in the
allowlist are skipped with a warning log.

Fixes NousResearch#23778 (partial - auto-resume auth bypass)
@alt-glitch alt-glitch added type/security Security vulnerability or hardening comp/gateway Gateway runner, session dispatch, delivery area/auth Authentication, OAuth, credential pools P1 High — major feature broken, no workaround labels May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/auth Authentication, OAuth, credential pools comp/gateway Gateway runner, session dispatch, delivery P1 High — major feature broken, no workaround type/security Security vulnerability or hardening

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Gateway auth bypass — unauthorized user messages processed despite "Unauthorized" log

2 participants