Skip to content

Security model

For session keys, backups and account migration, see Session Security. Protect each process that can read a session database or handle its decrypted credentials.

Inbound transport/encrypted-message validation fails closed rather than treating malformed data as a normal reconnect. Request replay is conservative because an interrupted write may already have reached Telegram. Bounded pending RPCs, bounded update queues, transport payload limits and byte-bounded media permits protect local resource use but do not replace application-level admission control.
The authorization handshake accepts a one-to-eight-byte pq, selects a trusted RSA fingerprint before factorization and runs the bounded factor search outside the event loop. Both factorization backends allow sixteen attempts of at most 100,000 iterations each. Cancellation releases the handshake caller, an already-started thread can finish its finite work budget.
Gzip decoding separately limits compressed input, output, members and nesting. One received message tree shares its cumulative expansion allowance, including intermediate wrappers. Containers reserve their descendants before decoding, with at most 1,024 descendant entries and depth 16. These limits bound protocol work and retained expansion, they are not an exact process-memory ceiling. Generic TL vectors of zero-width true elements are rejected even when empty, ordinary Bool vectors remain supported.
An https:// proxy URL verifies TLS to the proxy before sending CONNECT or proxy credentials, using the system trust configuration and port 443 by default. An http:// proxy continues to use plain TCP. Authentication failures invalidate only the rejected key’s DC and origin/CDN domain, with an atomic comparison that preserves replacement credentials. A custom sender without optional key/DC provenance is dropped without erasing stored login state.

Native and fallback implementations apply the same validation and secret-handling rules. AES and Scrypt use a cryptography fallback where available. Windows ARM64 and Intel macOS rely on the bundled Rust backend for those operations. Verify wheel provenance and runtime capability in the environment you deploy.

miniproto does not authorize any Telegram activity. You are responsible for Telegram’s Terms of Service and API rules, account consent and the lawful handling of user data. Do not place secrets or proof-of-concept exploit details in public issues. For an actual vulnerability, follow the repository’s security and reporting guidance, which points to the canonical policy rather than duplicating it here.