T05 · Unauthorized Access and Privilege Escalation
- Location
references/setup.md:48- Finding
Unauthenticated Full Telegram Account-Control API Exposed on All Host Interfaces
- Content
View full analysis
Vulnerability Details
File Location:
references/setup.md, lines 48-56
Vulnerability Type: Missing authentication and unsafe network exposure
Risk Level: CriticalVulnerable Code
bash docker run -d --name telethon-plus \ -p 8080:8080 \ -e TELETHON_API_ID=123456 \ -e TELETHON_API_HASH=your-api-hash \ -e TELETHON_SESSION='1Aa...long-string-from-login...' \ -v $HOME/telethon-cache:/cache \ --restart unless-stopped \ psyb0t/telethon-plusThe documented Compose example similarly publishes the service while leaving authentication commented out:
yaml services: telethon-plus: image: psyb0t/telethon-plus ports: - "8080:8080" environment: TELETHON_API_ID: "123456" TELETHON_API_HASH: "your-api-hash" TELETHON_SESSION: "1Aa...long-string-from-login..." # TELETHON_AUTH_KEY: "a-strong-random-secret"Technical Analysis
Docker's
-p 8080:8080syntax publishes the container port on all host interfaces by default. At the same time,TELETHON_AUTH_KEYis not configured in the primary installation example. The documentation states that an empty authentication key leaves all API and MCP routes, except for the intentionally public status routes, accessible without authentication.This service controls a real Telegram user account rather than a restricted bot account. Its API includes reading private conversations, sending and modifying messages, downloading attachments, deleting messages and chats, joining groups, and performing administrative actions. Consequently, exposing this API without authentication crosses a critical access-control boundary.
Although the documentation contains warnings recommending loopback binding and authentication, the copy-and-paste installation commands establish the unsafe configuration directly.
Attack Path
- An operator follows the documented Quick Install command.
- Docker ...[truncated 1177 chars]
- Remediation
View remediation
Remediation Suggestions
-
Change the default Docker publication to loopback-only:
bash -p 127.0.0.1:8080:8080 -
Require a cryptographically strong
TELETHON_AUTH_KEYin every installation example. -
Make the server refuse to start when authentication is disabled on a non-loopback listener.
-
Use TLS through a correctly configured reverse proxy for all remote access.
-
Apply firewall rules that restrict access to explicitly authorized management hosts.
-
Prefer a deny-by-default deployment profile, with remote exposure requiring an explicit opt-in.
-
Consider splitting read, write, and administrative privileges into separate scopes instead of giving every bearer token complete account control.
-
Keep destructive and administrative endpoints disabled unless they are explicitly needed.
-
