botman / botman/studio

Crititcal Telegram Driver webhook security vulnerability

Open
#99 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
PHP
Stars
332
Forks
91
PR merge metrics
No merged PRs in 30d

Description

Hello.

Here is a security issue I've already addressed to @mpociot but I can't start working on it yet, community awareness is needed.
As we all know by default Botman Studio set all bot webhooks to route: `example.com/botman`
The thing is Telegram by default doesn't send any auth details to your webhook, you can't check and be sure requests are coming from them.

All of Botman Studio apps with Telegram Driver affected, anyone who knows a server running with Botman Studio and Telegram driver could send a custom update request to `example.com/botman` **without authorization whatsoever**.

This issue is not purely Telegram Driver's, here are suggested solutions:
1. Passing optional `secret_token` at the webhook setup console command (for example, the Bot token itself) with the `setWebhook` and making a middleware to check every update authenticity.
2. Webhook separation (from default `/botman`) and hardening
`example.com/botman/telegramBotToken12345`
3. Checking request origin IP with Telegram servers list (which can change over time)

Read more: https://core.telegram.org/bots/api#setwebhook

PRs are welcome.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.