- Home
- Skills
- APIs & Backend
- Telegram Bot Safety Check
More screenshots
Works with the AI Agents you already use
Telegram Bot Safety Check
On the Mini App side, a server that reads the user id from initData without checking its signature lets one shopper act as another.
$5
Telegram Bot Safety Check
Example session with this skill installed
Check this project with telegram-bot-safety-check.
- Read your context and instructions
- Compiled the telegram bot safety
$ python3 scripts/check_telegram.py examples/risky
BLOCK bot/main.py:8 T01 BOT_TOKEN_IN_CODE
BOT_TOKEN = "<redacted>"
Why: A Telegram bot token is written in the code or in a committed file (a literal such as 7123456789:AA..., an api.telegram.org/bot... URL with the token in it, an .env.example or a config file), or it sits in a front-end variable (VITE_, NEXT_PUBLIC_, REACT_APP_, EXPO_PUBLIC_) that ships in the browser bundle. The token is the bot's only credential: whoever has it can read the bot's updates, message all its users and move its webhook.
Safer: Load the token at run time from the environment or a secret manager (BOT_TOKEN in a git-ignored .env file), keep it on the server only, and revoke the exposed token in @BotFather (/revoke).
BLOCK bot/main.py:21 T04 CODE_OR_SHELL_FROM_MESSAGE
BLOCK bot/main.py:47 T02 WEBHOOK_NOT_VERIFIED
BLOCK miniapp/.env.production:2 T01 BOT_TOKEN_IN_CODE
BLOCK miniapp/server.js:9 T03 MINI_APP_INIT_DATA_NOT_VALIDATED
REVIEW api/auth.py:12 T17 INIT_DATA_AGE_NOT_CHECKED
REVIEW bot/main.py:10 T13 BOT_TOKEN_IN_LOGS
REVIEW bot/main.py:16 T12 USER_TEXT_IN_FORMATTED_MESSAGE
REVIEW bot/main.py:32 T13 BOT_TOKEN_IN_LOGS
REVIEW bot/main.py:33 T15 FILE_PATH_FROM_USER_INPUT
REVIEW bot/main.py:37 T14 PAYMENT_APPROVED_WITHOUT_CHECK
REVIEW bot/main.py:44 T11 ADMIN_COMMAND_WITHOUT_USER_CHECK
REVIEW miniapp/src/checkout.js:9 T16 CLIENT_SENDS_UNVERIFIED_USER
(Each finding also has Why and Safer lines, as in the first one.)
Verdict: BLOCK. Checked 5 files, 5 with Telegram bot content.
This is a static check of file text. NOT FLAGGED is not a guarantee.
Connects securely to your tools. The creator never sees your data.
About this skill
One BOT_TOKEN = "..." in a public repository hands your bot to a stranger, and a webhook set without secret_token lets anyone who finds the URL post a fake update that claims to come from your admin. On the Mini App side, a server that reads the user id from initData without checking its signature lets one shopper act as another. This skill finds those and the other Telegram bot and Mini App mistakes below before you deploy, and tells you how to fix each one.
Your agent runs a scanner on your bot and Mini App code (python-telegram-bot, aiogram, pyTelegramBotAPI, Telegraf, grammY, node-telegram-bot-api and PHP bots, plus Express, FastAPI and similar Mini App backends), .env files and JSON, YAML and TOML config. It skips comments, follows chat text through simple assignments, knows each library's webhook defaults (Telegraf's secret path, node-telegram-bot-api's token path) and the usual guards (a compared secret header, secret paths, verify middleware, filters.User, F.from_user.id, getChatMember, html.escape, safe_parse_webapp_init_data), gives credit for an nginx allow list of Telegram's networks in the project, and checks test folders for tokens only. It never runs the bot or contacts Telegram. It returns BLOCK, REVIEW, or NOT FLAGGED, with the file, line, reason, and a safer approach. Tokens are never printed.
What it checks
BLOCK
- T01: bot tokens in code, config files, .env.example files, api.telegram.org URLs or VITE_ and NEXT_PUBLIC_ variables that ship to the browser
- T02: webhooks set or served without a secret token: setWebhook without secret_token, run_webhook, start_webhook, SimpleRequestHandler or webhookCallback without one, or routes that never check the X-Telegram-Bot-Api-Secret-Token header
- T03: Mini App initData parsed on the server without a signature check that uses it, or initDataUnsafe read from a request
- T04: message text, command arguments or callback data passed to eval, exec or a shell
REVIEW
- T11: admin commands (/ban, /broadcast, /restart, /sql and similar) without a user check
- T12: user names and message text sent as HTML or Markdown without escaping
- T13: bot tokens in logs: printed tokens, file links, and python-telegram-bot logging httpx request URLs
- T14: pre-checkout queries approved without looking at the order
- T15: download or file paths built from the sender's file name or message text
- T16: Mini App front ends that send initDataUnsafe user ids to the API
- T17: Mini App init data accepted at any age (no auth_date check)
What's included
- The scanner (Python 3.9+, standard library only)
- A rules guide with the reason, safer approach and official source for each rule
- A risky and a safe example project (bot, Mini App front end and backend), and the real report the scanner produces on the risky one
Limits It reads each file as written: checks that live in another file (a middleware that verifies the webhook header or init data, an admin filter added elsewhere), reverse-proxy rules other than an nginx allow list in the project, BotFather settings and values built across modules are not followed. NOT FLAGGED is not a guarantee.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for APIs & Backend.
Static check of bot and Mini App source text. Guards in other files, proxy rules and BotFather settings are not seen. NOT FLAGGED is not a guarantee.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 4 days ago
Permissions
Runs one local Python script in the terminal. It reads your project's files, writes nothing, and makes no network calls. The example project includes clearly fake, inert bot tokens (NOTREAL, EXAMPLE) for the scanner to find. Nothing is run.