Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessLocate exposed HTTP MCP endpoint
-
DeliverySend request with bearer token '../fast-mcp-telegram/telegram'
-
ExploitPath traversal resolves to default telegram.session
-
ExecutionVerifier accepts as valid AccessToken
-
PersistCall account-prefixed Telegram MCP tools
-
ImpactRead/send messages and MTProto calls as victim account
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V5 - File Handling Path canonicalization, traversal prevention
MITRE ATT&CK
2 techniques across 2 tactics: Discovery, Collection The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires the server to be deployed in HTTP authentication mode (SessionFileTokenVerifier active) AND the default/legacy session file ~/.config/fast-mcp-telegram/telegram.session to exist in the configured session directory - the traversal token '../fast-mcp-telegram/telegram' only succeeds because it resolves to that specific existing file. No valid bearer token, credentials, or user interaction are needed (CVSS PR:N/UI:N), and account-prefixed tools do not limit the bypass since the prefix middleware runs after authentication. The key limiting factors are: if the telegram.session file is absent the attack fails (missing-file tokens are rejected), the endpoint must be network-reachable to the attacker, and the server must not already enforce a strict token alphabet. Attackers must also know or guess the traversal path back to the documented default session name, which is public in the project's own security documentation. |
| Impact | The signals are largely consistent toward high severity but the real-world footprint is small. The supplied CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:L, base 9.4) reflects unauthenticated remote exploitation with full read/write access to a Telegram account, and a working validation PoC is included in the advisory, so exploitability is concrete rather than theoretical. However, exploitation is gated by two deployment facts the CVSS network vector understates: the server must be running in HTTP auth mode AND the legacy/default telegram.session file must physically exist in the configured session directory - if that file is absent, the traversal alias resolves to a missing file and is correctly rejected. No EPSS score, no CISA KEV entry, and no evidence of active exploitation were provided, so this should be treated as a genuine high-priority patch item for anyone running this server publicly, but its aggregate risk is bounded by the niche deployment base rather than being a mass-exploitation threat. The A:L impact is arguably generous - full account takeover is primarily a confidentiality/integrity event - but does not change the overall high rating. |
| Exploit ScenarioDerived | An attacker discovers an internet-reachable fast-mcp-telegram HTTP endpoint that requires bearer-token auth and, without knowing any generated token, sends a request with the bearer token '../fast-mcp-telegram/telegram'; the verifier normalizes this back to the default telegram.session file, which exists on the host, and accepts the request as a valid session. The attacker then calls account-prefixed MCP tools (e.g. defaultalice_send_message) to read and send Telegram messages and issue MTProto API calls as the victim account. A validation PoC demonstrating this exact auth decision and resolved session path is published with the advisory. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jul 02, 2026
Authentication bypass via path traversal in the fast-mcp-telegram MCP server (Python, PyPI package fast-mcp-telegram, master through release 0.19.0) lets a remote client hijack the default Telegram account without a valid bearer token. The SessionFileTokenVerifier blocks the exact reserved token 'telegram' but fails to normalize path separators, so a token like '../fast-mcp-telegram/telegram' resolves back to the default ~/.config/fast-mcp-telegram/telegram.session file and is accepted. A validation proof-of-concept is published in the advisory (publicly available exploit code exists), though there is no public exploit identified in the wild and no CISA KEV listing.
RemediationAI
No vendor-released fixed version was identified in the provided data (the advisory GHSA-rxw2-pc8j-vxwm describes the flaw and recommended code fix but no tagged patched release is confirmed here), so treat the fix as an upstream code remediation to apply or verify against a patched build before deploying. The vendor-recommended fix is to reject any bearer token that is not a strict opaque identifier before it touches a file path: accept only a safe alphabet such as ^[A-Za-z0-9_-]{32,128}$, explicitly reject '/', '\\', '.', '..', empty segments, and absolute paths, and after building the path call .resolve() and require session_path.parent to equal the resolved session directory, applying that same check in SessionFileTokenVerifier, the URL auth middleware, setup, and cleanup code. As immediate compensating controls until a patched build is confirmed, remove or relocate the default telegram.session file so the traversal alias resolves to nothing (side effect: breaks any legitimate use of that default/legacy account over HTTP), restrict network exposure of the HTTP endpoint to trusted hosts or place it behind a reverse proxy that rejects '..' and encoded traversal in the auth token, or disable HTTP auth mode in favor of stdio where feasible (side effect: loses remote multi-user access). See the advisory at https://github.com/leshchenko1979/fast-mcp-telegram/security/advisories/GHSA-rxw2-pc8j-vxwm for the authoritative fix guidance.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in pypi
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
fast-mcp-telegram is a Model Context Protocol (MCP) server that bridges LLM tooling to a Telegram account over MTProto, using Telethon-style .session files for account state. In its HTTP authentication mode each session is meant to be selected by a high-entropy opaque bearer token, which the server maps to a session file by string interpolation: session_path = self._session_directory / f"{token}.session". The root cause is CWE-22 (Improper Limitation of a Pathname to a Restricted Directory): the verifier lowercases and whitespace-strips the token and rejects RESERVED_SESSION_NAMES like 'telegram', but never rejects '/', '\\', '..', absolute paths, or resolved paths that escape the session directory before performing the is_file() existence check. Because the same unsafe construction is duplicated in src/client/connection.py (_build_telegram_client_for_token), the traversal token flows all the way through to the actual Telegram client build, and the downstream account-prefix middleware (which merely labels tools by resolved account) sits after authentication and cannot restore the broken boundary.
Know when Python gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:L
Remote unauthenticated token bypass (AV:N/PR:N/UI:N); AC:L since the traversal token is deterministic against the documented default session; full account read/write gives C:H/I:H with limited availability impact.
Primary rating from Vendor (https://github.com/leshchenko1979/fast-mcp-telegram).
CVSS VectorVendor: https://github.com/leshchenko1979/fast-mcp-telegram
Lifecycle Timeline
2DescriptionCVE.org
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.verify_token() strips whitespace and rejects exact reserved names:
if token.lower() in RESERVED_SESSION_NAMES:
return NoneIt then appends .session to the raw token and checks the resulting path:
session_path = self._session_directory / f"{token}.session"
if not session_path.is_file():
return NoneNo 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:
session_path = SESSION_DIR / f"{token}.session"
client = await _build_telegram_client_for_token(session_path, token)With the default session directory, the token ../fast-mcp-telegram/telegram resolves as follows:
~/.config/fast-mcp-telegram/../fast-mcp-telegram/telegram.session
= ~/.config/fast-mcp-telegram/telegram.sessionThe 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 session_name, 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:
git clone https://github.com/leshchenko1979/fast-mcp-telegram.git
cd fast-mcp-telegram
python validation_token_traversal.pyThe local proof script created for validation is attached below for reference:
# High-level proof outline
# 1. Create a temporary session directory containing telegram.session and a random token session.
# 2. Instantiate SessionFileTokenVerifier with that directory.
# 3. Verify denied controls: token `telegram` is rejected, and a traversal token to a missing file is rejected.
# 4. Verify allowed control: a normal random token with a matching session file is accepted.
# 5. Verify bypass: token `../fast-mcp-telegram/telegram` is accepted and the client builder receives the default telegram.session path.
# 6. Verify prefix behavior: account-prefixed tools are listed for the traversal-authenticated default account, a prefixed call reaches send_message, and an unprefixed call is still denied.Key controls from the current-master run:
{
"reserved_default_token_denied": true,
"normal_random_token_allowed": true,
"missing_traversal_token_denied": true,
"traversal_alias_to_reserved_default_allowed": true,
"traversal_access_token_value": "../fast-mcp-telegram/telegram",
"client_builder_used_default_session_file": true,
"prefixed_tool_listed_for_traversal_token": "defaultalice_send_message",
"prefixed_tool_call_reached_handler_as": "send_message",
"unprefixed_tool_call_denied_when_prefix_resolved": true
}Interpretation:
- Denied control: the exact reserved token
telegramis 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/telegramauthenticates 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/callreaches the internalsend_messagehandler. 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:
session_dir = self._session_directory.resolve()
session_path = (session_dir / f"{token}.session").resolve()
if session_path.parent != session_dir:
return None- 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.
Articles & Coverage 1
Executive ViewAI
The fast-mcp-telegram Model Context Protocol server (PyPI versions ≤0.19.0) contains a critical authentication bypass enabling remote, unauthenticated attackers to hijack Telegram accounts integrated with automated systems. Any deployment of this package accessible over the network can be compromised to impersonate organizational Telegram communications. Organizations using this package face immediate risk of credential theft and unauthorized message transmission.
No vendor-released patch identified at time of analysis. Interim mitigations: (1) Uninstall the package if Telegram automation is not critical to operations; (2) Implement firewall rules restricting MCP server access to localhost or VPN-only; (3) Delete or restrict file permissions on the default session file (~/.config/fast-mcp-telegram/telegram.session); (4) Immediately rotate Telegram account credentials; (5) Enable audit logging on Telegram account to detect unauthorized access attempts.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Authentication bypass attacks exploit flaws in the verification mechanisms that control access to systems and applications.
Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.
Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t
BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser
pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi
The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python
BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica
OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph
pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.
Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301
In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse
Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to
Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/
pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne
EUVD-2026-41438
GHSA-rxw2-pc8j-vxwm
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB