Skip to content
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

Is it safe to expose the Telegram Bot API to public network? #701

Closed
hacker-hackman opened this issue Jan 21, 2025 · 2 comments
Closed

Is it safe to expose the Telegram Bot API to public network? #701

hacker-hackman opened this issue Jan 21, 2025 · 2 comments

Comments

@hacker-hackman
Copy link

hacker-hackman commented Jan 21, 2025

I'm a lamer in networking at the moment. If I deploy this Telegram Bot API image with the port 8081 exposed to the public internet would I face security and performance issues. Or is it safe to do so?

@NiXTheDev
Copy link

NiXTheDev commented Jan 21, 2025

I think the only ones at risk would be the ones trying to use it, since their bot token will be logged and even will get it's own folder/directory named after the token(in full!) to store the binary representation of pending updates for the bot

Otherwise the bot API server doesn't do much aside from serving bot API requests, try deploying it on your local network and navigate to it's IP:port at the root level and see for yourself

What you shouldn't expose to the internet without at least basic auth is the stats port(usually 8082 in aiogram's image)

Edit: just a clarification on the last line here since i realized that i hadn't explained what the 8082 stats port does

What you shouldn't expose to the internet without at least basic auth is the stats port(usually 8082 in aiogram's image)

Because it lists each and every single one of the bot tokens that have been used to make requests to this particular telegram-bot-api server, so yes, exposing that port to internet without auth is a surefire way to get your bots hacked and possibly banned, which you will be the one to blame, since telegram doesn't track who uses a token, but who created the bot with that token

@hacker-hackman
Copy link
Author

Understood :). thanks for reply

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants