fast-mcp-telegram

CVE-2026-52830

CVE-2026-52830 is a critical-severity path traversal vulnerability in fast-mcp-telegram (pip), affecting versions <= 0.19.0. It is fixed in 0.19.1.

Key facts
CVSS score
9.4
Critical
Attack vector
Network
Issuing authority
GitHub Advisory Database
Affected package
fast-mcp-telegram
Fixed in
0.19.1
Disclosed
2026

Summary

Summary fast-mcp-telegram validates HTTP Bearer tokens by joining the raw token string into a session-file path. The verifier rejects the exact reserved token telegram, but it does not reject path separators or normalize the path before checking whether the session file exists. A remote HTTP client can therefore authenticate as the default legacy session with a token such as ../fast-mcp-telegram/telegram when the documented default session file ~/.config/fast-mcp-telegram/telegram.session exists. This bypasses the reserved session name control that is intended to prevent HTTP multi-user sessions from colliding with the default stdio or legacy account. With account-prefixed MCP tools enabled, the attacker still sees and calls the prefixed tools for the default account, so the prefix middleware does not stop the session selection bypass. Impact An unauthenticated network client can access the Telegram account represented by the default telegram.session file without knowing a generated bearer token, if that legacy or default session file is present on a server running HTTP auth. The attacker can then call Telegram MCP tools as that account, including message reading, message sending, MTProto API calls, and attachment-producing tool surfaces available to the session. Technical details SessionFileTokenVerifier.verifytoken() strips whitespace and rejects exact reserved names: It then appends .session to the raw token and checks the resulting path: No check rejects /, \\, .., absolute paths, or resolved paths outside the configured session directory. The session client path is built the same way in src/client/connection.py: With the default session directory, the token ../fast-mcp-telegram/telegram resolves as follows: The exact token telegram is denied, but the traversal alias reaches the same file and is accepted. This is especially important because telegram is the documented default sessionname, and the security documentation says reserved names are blocked to prevent conflicts with stdio and HTTP no-auth sessions. The vulnerable code is present on current master commit 167ab705f1cd09b21e85c370570471fe75a4f8c9 and in release tag 0.19.0 commit 77bdf6d7e5c6a84d87acc423db613e6c6ba30094. Reproduction The following proof uses stub session files and stub Telegram clients, so it does not need real Telegram credentials. It validates the auth decision and the eventual session path used by the client builder. Run on current master: The local proof script created for validation is attached below for reference: Key controls from the current-master run: Interpretation: Denied control: the exact reserved token telegram is rejected. Allowed control: a normal random session token is accepted when its matching session file exists. Denied control: a traversal token pointing to a missing file is rejected. Bypass: ../fast-mcp-telegram/telegram authenticates and the client builder receives the resolved default session path. Prefix control: once authenticated through the traversal token, account-prefixed tools are listed and a prefixed tools/call reaches the internal sendmessage handler. An unprefixed call is rejected when the prefix resolves, so the confirmed bug is the session selection and authentication bypass, not a missing-prefix execution bypass. Why this crosses the auth boundary A production HTTP auth deployment is expected to require high-entropy per-session bearer tokens. Reserved names are explicitly blocked because common names such as telegram can collide with the default session. The traversal alias turns the public token namespace back into a filesystem namespace and bypasses that reserved-name policy. The account-prefix middleware is downstream of authentication. It labels tools based on the resolved Telegram account for the token that was accepted. Because the traversal token is accepted as a valid FastMCP AccessToken, the middleware correctly exposes the default account's prefixed tools to the attacker. It cannot recover the lost authentication boundary. Remediation Reject bearer tokens that are not strict opaque token identifiers before using them in file paths. Recommended checks: Accept only a safe token alphabet, for example ^[A-Za-z0-9-]{32,128}$, matching generated URL-safe base64 tokens. Reject /, \\, ., .., empty segments, and absolute paths for both header auth and URL auth. Resolve the final session path and require it to remain directly under the configured session directory: Apply the same validation in SessionFileTokenVerifier, URL auth middleware, setup flows, cleanup code, and any code that opens session files by token. Add regression tests for exact reserved names, traversal aliases such as ../fast-mcp-telegram/telegram, absolute paths, URL-encoded traversal if any route decodes path components, Windows separators, and normal generated tokens.

Impact

What is path traversal?

Input manipulates file paths to reach files outside the intended directory, such as configuration or credential files. Typical impact: unauthorized file read or write outside the intended directory.

Severity and exposure

CVE-2026-52830 has a CVSS score of 9.4 (Critical). The vector is network-reachable, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment.

A fixed version is available (0.19.1). Upgrading removes the vulnerable code path.

Affected versions

pip

  • fast-mcp-telegram (<= 0.19.0)

Security releases

  • fast-mcp-telegram → 0.19.1 (pip)
Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter instead of chasing every advisory.

Kodem's runtime-powered SCA identifies whether CVE-2026-52830 is reachable in your applications. Explore AI application security for your team.

See if CVE-2026-52830 is reachable in your applications. Get a demo

Already deployed Kodem? See CVE-2026-52830 in your environment

Remediation advice

Upgrade fast-mcp-telegram to 0.19.1 or later to resolve this vulnerability.

Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.

Frequently asked questions about CVE-2026-52830

What is CVE-2026-52830?

CVE-2026-52830 is a critical-severity path traversal vulnerability in fast-mcp-telegram (pip), affecting versions <= 0.19.0. It is fixed in 0.19.1. Input manipulates file paths to reach files outside the intended directory, such as configuration or credential files.

How severe is CVE-2026-52830?

CVE-2026-52830 has a CVSS score of 9.4 (Critical). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.

Which versions of fast-mcp-telegram are affected by CVE-2026-52830?

fast-mcp-telegram (pip) versions <= 0.19.0 is affected.

Is there a fix for CVE-2026-52830?

Yes. CVE-2026-52830 is fixed in 0.19.1. Upgrade to this version or later.

Is CVE-2026-52830 exploitable, and should I be worried?

Whether CVE-2026-52830 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo

What actually determines whether CVE-2026-52830 is exploitable, and how bad it is?

Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.

How do I fix CVE-2026-52830?

Upgrade fast-mcp-telegram to 0.19.1 or later.

Stop the waste.
Protect your environment with Kodem.