security(v2.12): require authenticated Telegram webhooks and reject HTTP updates for polling bots #130

Open
opened 2026-09-09 14:58:54 +00:00 by nsaspy · 0 comments
Owner

Upstream

Agent Zero v2.12 security fix: https://github.com/agent0ai/agent-zero/releases/tag/v2.12

Confirmed gap on main

plugins/_telegram_integration/api/webhook.py currently verifies X-Telegram-Bot-Api-Secret-Token only when instance.webhook_secret is configured. The default config describes webhook_secret as optional. v2.12 changes this boundary: polling bots must reject HTTP updates and webhook bots must require a matching non-empty secret.

Required work

  • Reject webhook HTTP updates when the selected bot instance is configured for polling.
  • Require webhook mode for the HTTP endpoint.
  • Require a non-empty configured webhook secret for webhook mode.
  • Require a non-empty request secret header matching the configured value using an appropriate constant-time comparison.
  • Fail closed on missing/blank/mismatched secrets.
  • Update config validation/UI/docs so webhook mode cannot be saved/started without a secret.
  • Preserve existing Telegram allowed-user/group authorization after transport authentication.

Acceptance

  • Polling bot + HTTP webhook request => rejected before update dispatch.
  • Webhook bot + blank configured secret => startup/config validation failure or request rejection; never accepted.
  • Missing/blank/wrong header => rejected.
  • Matching secret + webhook mode => normal update processing.
  • Regression tests cover every combination above plus multiple bot instances.
## Upstream Agent Zero v2.12 security fix: https://github.com/agent0ai/agent-zero/releases/tag/v2.12 ## Confirmed gap on main `plugins/_telegram_integration/api/webhook.py` currently verifies `X-Telegram-Bot-Api-Secret-Token` only when `instance.webhook_secret` is configured. The default config describes `webhook_secret` as optional. v2.12 changes this boundary: polling bots must reject HTTP updates and webhook bots must require a matching non-empty secret. ## Required work - Reject webhook HTTP updates when the selected bot instance is configured for polling. - Require webhook mode for the HTTP endpoint. - Require a non-empty configured webhook secret for webhook mode. - Require a non-empty request secret header matching the configured value using an appropriate constant-time comparison. - Fail closed on missing/blank/mismatched secrets. - Update config validation/UI/docs so webhook mode cannot be saved/started without a secret. - Preserve existing Telegram allowed-user/group authorization after transport authentication. ## Acceptance - Polling bot + HTTP webhook request => rejected before update dispatch. - Webhook bot + blank configured secret => startup/config validation failure or request rejection; never accepted. - Missing/blank/wrong header => rejected. - Matching secret + webhook mode => normal update processing. - Regression tests cover every combination above plus multiple bot instances.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nsaspy/a0-symbolics#130
No description provided.