-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make telegram bot Webhook secret #10
Comments
So the TELEGRAM_TOKEN can be more easily compromised, for example, in logs. |
hm, agreed. In this case I'd add a random string generation as a part of webhook endpoint. |
Can't we just:
|
Hey guys, telegram will encrypt requests. the only way for this getting exposed is by server compromise and hacker having access to the tokens in logs. But if that happens, the attacker won't need the token anymore cause he has the whole server... Tokens over url are low severity |
With django often uses web+bot in one instance and if junior, for example, decides to fix something on prod and turn on DEBAG mode, then django will very colorfully provide all paths and tokens on page 404 |
I disagree. If they have the token discovered from a 3rd party logging service or a poorly secured S3 bucket, they OWN your bot and can set the webhook URL to whatever they want it to be. I'm worried that Telegram might have poor log file control but I can't control what they use as the endpoint. I don't have to get your server to read your logs, I just need to get to where you store the log files...... The article you quote doesn't even agree with your premise. |
Right now everyone can POST event to TelegramBotWebhookView and fake Telegram events. This is a security issue so it is better to change Webhook url to contain secret value like TELEGRAM_TOKEN.
Current Webhook POST endpoint:
Let's change it to:
The text was updated successfully, but these errors were encountered: