You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried this adapter in webhook mode. I noticed in the current version, when it sets up the webhook, it does not have a secret_token (defined in https://core.telegram.org/bots/api#setwebhook) field in it. It neither checks if the request is from one of the Telegram servers (defined in https://core.telegram.org/bots/webhooks). Therefore, it is possible for an attacker to forge a request from Telegram server, and the bot is vulnerable to it, unless the user has their custom routing to limit the connection from Telegram servers.
My suggestion it to randomly generate a secret_token when a user sets up the bot in webhook mode, and checks whether a request has a matching X-Telegram-Bot-Api-Secret-Token header when it receives an update. This change should be transparent to existing users, and save users without a custom routing rule from forged updates.
The text was updated successfully, but these errors were encountered:
I tried this adapter in webhook mode. I noticed in the current version, when it sets up the webhook, it does not have a
secret_token
(defined in https://core.telegram.org/bots/api#setwebhook) field in it. It neither checks if the request is from one of the Telegram servers (defined in https://core.telegram.org/bots/webhooks). Therefore, it is possible for an attacker to forge a request from Telegram server, and the bot is vulnerable to it, unless the user has their custom routing to limit the connection from Telegram servers.My suggestion it to randomly generate a
secret_token
when a user sets up the bot in webhook mode, and checks whether a request has a matchingX-Telegram-Bot-Api-Secret-Token
header when it receives an update. This change should be transparent to existing users, and save users without a custom routing rule from forged updates.The text was updated successfully, but these errors were encountered: