Security is a paramount concern for the Cuhi Bot team. Since this bot is designed to handle user authentication cookies for social media platforms (Instagram, TikTok, Facebook, Twitter/X) and process private media files, it is engineered with strict privacy and security guardrails.
This document outlines our security practices, how to report vulnerabilities, and best practices for securely running your own instance of Cuhi Bot.
DO NOT report security vulnerabilities via public GitHub issues.
If you discover a security vulnerability in Cuhi Bot, please report it immediately via private email so that we can patch it before it is exploited in the wild.
mintdmca@gmail.comPlease include the following information in your report:
Cuhi Bot is built on the following core security principles:
fcntl on Unix, msvcrt on Windows) to prevent race conditions and file corruption when multiple users access the JSON data stores simultaneously.gallery-dl, yt-dlp).When deploying Cuhi Bot, administrators are highly encouraged to utilize the built-in security features to harden their instance:
Cuhi Bot is NOT a public bot by default. You should configure the ALLOWED_USERS environment variable with a comma-separated list of Telegram User IDs. If a user is not on this list, the bot will silently ignore all their messages and block their access to the Mini App dashboard.
The /admin panel is restricted via the ADMIN_IDS environment variable. Only these users can globally restart the bot, view system metrics, or manage global configurations.
The Mini App backend (server.py) does not trust client-side data. All API requests from the Mini App must include the initData payload from Telegram. The server cryptographically verifies this payload against your BOT_TOKEN using HMAC-SHA256 to ensure the request genuinely originated from the authenticated Telegram user.
To protect the server from Out-Of-Memory (OOM) crashes and the Telegram API from rate limits, Cuhi Bot automatically skips individual files larger than 50MB and groups uploads into maximum batches of 10 items.
While we secure the codebase, the security of the host environment is your responsibility:
BOT_TOKEN or cookies.txt files to a public repository. If your token leaks, anyone can control your bot. Revoke it immediately via @BotFather if compromised.cookies.txt, they have full access to your social media accounts. Ensure the directory where cookies are stored (/app/data/cookies) has restrictive file permissions.gallery-dl, yt-dlp, python-telegram-bot, FastAPI). Keep your instance up to date to ensure you are protected against upstream vulnerabilities.Stay safe and keep your archives secure.