fix(security): require explicit opt-in for Telegram bridge open chat access#699
fix(security): require explicit opt-in for Telegram bridge open chat access#699
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
…access When ALLOWED_CHAT_IDS is unset, the bridge now refuses to start unless ALLOW_ALL_CHATS=true is explicitly set. This changes the default from open-access to fail-closed, preventing arbitrary Telegram users from driving the sandboxed agent without operator intent. Addresses NVBUG 6007062.
b25e151 to
87fdc5f
Compare
|
Noticed this is still in draft — flagging a few things for when you pick it back up.
|
|
Closing — superseded by #1081, which removes the host-side Telegram bridge entirely ( |
Summary
Draft — seeking feedback on approach before finalizing.
The Telegram bridge silently accepts messages from ALL chats when
ALLOWED_CHAT_IDSis unset. This PR adds a visible warning and logs new chat IDs so users can build their allowlist, without breaking existing deployments.Behavior:
ALLOWED_CHAT_IDS, noALLOW_ALL_CHATS: Bridge starts with a loud warning; logs each new chat ID + username so the user can copy-paste intoALLOWED_CHAT_IDSALLOW_ALL_CHATS=true: Brief warning, no per-message logging (explicit opt-in)ALLOWED_CHAT_IDSset: Existing filtering, no warnings, no changeOpen question
Should we hard-fail instead of warn? Current approach is non-breaking but the bridge still accepts all messages. The alternative (exit with error) is more secure but breaks every existing Telegram bridge deployment that doesn't have
ALLOWED_CHAT_IDSset.Test plan
ALLOWED_CHAT_IDSandALLOW_ALL_CHATSALLOW_ALL_CHATS=true→ verify brief warning onlyALLOWED_CHAT_IDS→ verify no warnings