fix(telegram): enforce allowlist policy on /start, /help, /status commands#978
Open
snemesh wants to merge 1 commit intoanthropics:mainfrom
Open
fix(telegram): enforce allowlist policy on /start, /help, /status commands#978snemesh wants to merge 1 commit intoanthropics:mainfrom
snemesh wants to merge 1 commit intoanthropics:mainfrom
Conversation
…mands The /start, /help, and /status bot commands bypass the access gate. When dmPolicy is "allowlist", non-allowlisted users can still probe the bot via these commands — confirming it's active, seeing help text, and in the case of /status, enumerating pending pairing codes. Now: - /help and /status silently drop non-allowlisted users - /start allows unknown users only in pairing mode (expected flow) - /status only responds to allowlisted users (no pending code leak) This matches the gate() behavior documented in ACCESS.md: allowlist mode should "drop silently, no reply." Fixes anthropics#854
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
/start,/help, and/statusbot commands bypass thegate()access check. WhendmPolicyis"allowlist", non-allowlisted users can:/start— get a response confirming the bot is active and see pairing instructions/help— get help text (no policy check at all)/status— enumerate pending pairing codes for other users, and confirm the bot existsPer ACCESS.md,
allowlistmode should "Drop silently. No reply."Security impact
/statusshows pending codes to any DM sender, even when they shouldn't have accessFix
/startdisabled)pairingmode (expected flow for new users to learn how to pair)/help/statusNo behavior change when
dmPolicyis"pairing"— unknown users can still/startto learn how pairing works (same as before).Changes
external_plugins/telegram/server.ts— 16 insertions, 19 deletionsTest plan
bun buildpassesTest output (22/22 passed)
Fixes #854