Skip to content

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

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

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

@egilewski egilewski left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommendation: request changes

I reviewed this in security mode against current GitHub main f9c8d95e43662d754eb296551695e0be554bc58e, PR base 64145a1996554e4e81b694e9737421f34f44e212, and PR head 3bfe5b8b038c51e34dc514024f092149d0968691.

Validation:

  • gh api repos/NousResearch/hermes-agent/pulls/23800: GitHub currently reports mergeable=false and mergeable_state=dirty.
  • git fetch --no-write-fetch-head --no-tags upstream main:refs/remotes/upstream/main +pull/23800/head:refs/remotes/upstream/pr/23800: fetched current main and the PR head.
  • git rev-list --left-right --count refs/remotes/upstream/main...refs/remotes/upstream/pr/23800: the branch is 3472 1 relative to current main.
  • git merge-tree --write-tree refs/remotes/upstream/main refs/remotes/upstream/pr/23800: fails with a content conflict in gateway/run.py.
  • gh pr checks 23800 --repo NousResearch/hermes-agent: shows stale PR-head failures from May 11, 2026, while current main check runs are successful; the merge conflict is the first decisive blocker.

Finding:
This PR cannot be reviewed or merged as-is because it no longer applies cleanly to current main. Please rebase or otherwise port the gateway auto-resume authorization change onto current main, then rerun focused gateway authorization coverage for the resumed-session path.

Signed: GPT-5.5-xhigh in Codex

@ygd58

ygd58 commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

Opened #47761 as a clean rebase onto current main, fixing the merge conflict noted in review. Same fix — validate user authorization before auto-resuming restart-interrupted sessions.

@ygd58 ygd58 closed this Jun 17, 2026
teknium1 pushed a commit that referenced this pull request Jul 1, 2026
Auto-resume of restart-interrupted sessions bypassed auth checks.
The session owner was never validated against TELEGRAM_ALLOWED_USERS
(or equivalent) 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 (issue #23778).

Clean rebase of #23800 onto current main (egilewski flagged a merge
conflict in gateway/run.py on the old branch).

Fix: check _is_user_authorized() for the session owner before
scheduling auto-resume. Unauthorized sessions are skipped with a
warning log instead of silently resuming.

Fixes #23778 (partial - auto-resume auth bypass)
waefrebeorn pushed a commit to waefrebeorn/slermes that referenced this pull request Jul 2, 2026
Auto-resume of restart-interrupted sessions bypassed auth checks.
The session owner was never validated against TELEGRAM_ALLOWED_USERS
(or equivalent) 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 (issue NousResearch#23778).

Clean rebase of NousResearch#23800 onto current main (egilewski flagged a merge
conflict in gateway/run.py on the old branch).

Fix: check _is_user_authorized() for the session owner before
scheduling auto-resume. Unauthorized sessions are skipped with a
warning log instead of silently resuming.

Fixes NousResearch#23778 (partial - auto-resume auth bypass)
Jasper6439 pushed a commit to Jasper6439/hermes-agent that referenced this pull request Jul 5, 2026
Auto-resume of restart-interrupted sessions bypassed auth checks.
The session owner was never validated against TELEGRAM_ALLOWED_USERS
(or equivalent) 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 (issue NousResearch#23778).

Clean rebase of NousResearch#23800 onto current main (egilewski flagged a merge
conflict in gateway/run.py on the old branch).

Fix: check _is_user_authorized() for the session owner before
scheduling auto-resume. Unauthorized sessions are skipped with a
warning log instead of silently resuming.

Fixes NousResearch#23778 (partial - auto-resume auth bypass)
habarmc1223-sudo pushed a commit to habarmc1223-sudo/hermes-agent-fluxmem that referenced this pull request Jul 8, 2026
Auto-resume of restart-interrupted sessions bypassed auth checks.
The session owner was never validated against TELEGRAM_ALLOWED_USERS
(or equivalent) 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 (issue NousResearch#23778).

Clean rebase of NousResearch#23800 onto current main (egilewski flagged a merge
conflict in gateway/run.py on the old branch).

Fix: check _is_user_authorized() for the session owner before
scheduling auto-resume. Unauthorized sessions are skipped with a
warning log instead of silently resuming.

Fixes NousResearch#23778 (partial - auto-resume auth bypass)
santhreal pushed a commit to santhreal/hermes-agent that referenced this pull request Jul 13, 2026
Auto-resume of restart-interrupted sessions bypassed auth checks.
The session owner was never validated against TELEGRAM_ALLOWED_USERS
(or equivalent) 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 (issue NousResearch#23778).

Clean rebase of NousResearch#23800 onto current main (egilewski flagged a merge
conflict in gateway/run.py on the old branch).

Fix: check _is_user_authorized() for the session owner before
scheduling auto-resume. Unauthorized sessions are skipped with a
warning log instead of silently resuming.

Fixes NousResearch#23778 (partial - auto-resume auth bypass)
Gravezzz pushed a commit to Gravezzz/hermes-agent that referenced this pull request Jul 21, 2026
Auto-resume of restart-interrupted sessions bypassed auth checks.
The session owner was never validated against TELEGRAM_ALLOWED_USERS
(or equivalent) 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 (issue NousResearch#23778).

Clean rebase of NousResearch#23800 onto current main (egilewski flagged a merge
conflict in gateway/run.py on the old branch).

Fix: check _is_user_authorized() for the session owner before
scheduling auto-resume. Unauthorized sessions are skipped with a
warning log instead of silently resuming.

Fixes NousResearch#23778 (partial - auto-resume auth bypass)
leewenjie pushed a commit to leewenjie/hermes-agent that referenced this pull request Aug 7, 2026
Auto-resume of restart-interrupted sessions bypassed auth checks.
The session owner was never validated against TELEGRAM_ALLOWED_USERS
(or equivalent) 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 (issue NousResearch#23778).

Clean rebase of NousResearch#23800 onto current main (egilewski flagged a merge
conflict in gateway/run.py on the old branch).

Fix: check _is_user_authorized() for the session owner before
scheduling auto-resume. Unauthorized sessions are skipped with a
warning log instead of silently resuming.

Fixes NousResearch#23778 (partial - auto-resume auth bypass)
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

3 participants