Pyrofork CVE-2025-67720
MEDIUMAttack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSend crafted Telegram document with traversal filename
-
DeliveryVictim app calls download_media default usage
-
ExploitAttacker file_name bypasses isabs check
-
Executionos.path.join builds path outside directory
-
ImpactWrite file to arbitrary filesystem location
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 that the victim runs Pyrofork <=2.3.68 and calls download_media() either with no filename argument or with only a directory (e.g. download_media(message) or download_media(message, "downloads/")) - the common/default usage, where os.path.split yields an empty filename and the code falls back to the attacker-controlled media file_name from Telegram's DocumentAttributeFilename. The attacker must be able to deliver a message/document to the victim account or bot and set a filename containing ../ relative traversal sequences or an absolute path (the existing os.path.isabs check does not stop relative traversal, and os.path.join honors absolute paths). Limiting factors: requires the victim application to actually trigger the media download (UI:R); if the developer passes an explicit custom filename the fallback is never reached; impact is arbitrary file write (integrity) only, with no direct confidentiality or availability impact; and only versions <=2.3.68 are affected (patched in 2.3.69). |
| Impact | Signals are internally consistent and point to a genuine but moderate-priority issue. The CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N, base 6.5) describes a network-reachable, low-complexity, unauthenticated flaw whose impact is limited to integrity (arbitrary file write) with no confidentiality or availability loss, and which is gated by required user/application interaction (UI:R) - the victim must actually invoke download_media on an attacker's message. EPSS is low (0.32%, 23rd percentile) and the CVE is NOT on CISA KEV, so there is no evidence of active or widespread exploitation. A proof-of-concept logic-simulation script is published in the vendor GHSA advisory, so publicly available exploit code exists, but POC availability must not be conflated with in-the-wild exploitation. The realistic risk is that an exploit is trivially constructed (anyone can send a Telegram document with a ../ or absolute-path filename) yet exploitation depends entirely on a victim application running Pyrofork <=2.3.68 and calling download_media in its default/common form; this narrows real-world impact. Net: a legitimately exploitable path-traversal file-write that warrants prompt patching for affected deployments, but not an emergency given low EPSS, no KEV, bounded (integrity-only) impact, and the interaction requirement. |
| Exploit ScenarioDerived | An attacker sends a crafted Telegram document to a bot or user-client built on Pyrofork <=2.3.68, setting the message's DocumentAttributeFilename to a value containing path traversal sequences (e.g. ../../etc/...) or an absolute path. When the victim application calls download_media without a custom filename (the common default, or with only a directory such as download_media(message, "downloads/")), the attacker-controlled file_name flows into os.path.join path construction and the file is written outside the intended download directory to an arbitrary location. A proof-of-concept script simulating this exact logic is included in the vendor GHSA advisory. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 08, 2026
Arbitrary file write in the Pyrofork async MTProto/Telegram framework (versions 2.3.68 and earlier) lets a message sender control the filename used by download_media(), so a crafted document name containing '../' sequences or an absolute path causes files to be written outside the intended download directory. Affected applications are those that call download_media(message) or download_media(message, "downloads/") without an explicit filename, which is the documented default usage; the issue is rated CVSS 6.5 with integrity-only impact (C:N/I:H/A:N) and requires the victim application to actually perform the download (UI:R), while the network attack vector is unauthenticated (PR:N). The vendor addressed the flaw in version 2.3.69, and the GHSA advisory (GHSA-6h2f-wjhf-4wjx) ships a proof-of-concept that mirrors the vulnerable code path, though there is no CISA KEV listing or other confirmation of active exploitation and EPSS remains low at 0.32% (23rd percentile).
RemediationAI
Upgrade to Pyrofork 2.3.69 or later (pip install --upgrade "pyrofork>=2.3.69"), which is the vendor-released patch containing the os.path.basename()/null-byte sanitization from commit 2f2d515575cc9c360bd74340a61a1d2b1e1f1f95; refer to GHSA-6h2f-wjhf-4wjx for the official advisory. If upgrading is not immediately possible, the most effective compensating control is to always pass an explicit, developer-controlled filename to download_media(message, "downloads/your_name.ext") so the attacker-controlled media.file_name fallback is never reached - the trade-off is that callers lose automatic naming and must generate safe names themselves, and any code path that still omits the filename stays vulnerable. You can additionally pre-sanitize names by applying os.path.basename() and rejecting values containing '..', '/' or null bytes before use, or accept the download and then verify with os.path.realpath() that the resulting path is inside the intended download directory. Because the write is driven by an inbound Telegram message, restricting which accounts or channels may send documents to the bot (or disabling auto-download for untrusted peers) reduces exposure but degrades functionality for legitimate users, and running the bot under a low-privilege service account with a containerized or read-only-restricted filesystem limits where the arbitrary write can land without blocking the traversal itself. Note that, per available data, there is no CISA KEV entry or confirmed active exploitation, so these measures are risk reduction rather than emergency containment.
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
Pyrofork is a pure-Python asynchronous implementation of the Telegram MTProto client API, so it routinely processes attacker-influenced metadata embedded in Telegram messages. The relevant field is DocumentAttributeFilename, the Telegram document attribute that carries a user-supplied display name; Pyrofork surfaces it as media.file_name. In download_media(), the developer-supplied path argument is passed through os.path.split(), and the resulting empty filename triggers a fallback to media.file_name. The existing guard checks only os.path.isabs(file_name), which does not block relative traversal such as '../../' and which is bypassed for absolute names because the subsequent os.path.join(directory, file_name) discards the directory prefix when the second component is absolute. The joined path is then converted with os.path.abspath() and suffixed with '.temp' in client.py before the file is created, meaning the write lands on the resolved attacker-chosen location. This is classic CWE-22 path traversal arising from missing input normalization - the string is trusted as a safe path component. The upstream commit 2f2d515575cc9c360bd74340a61a1d2b1e1f1f95 fixes it by running os.path.basename() over the name, stripping null bytes, and blanking values that reduce to '', '.' or '..', thereby forcing the downloaded file to stay within the caller's directory. No CPE identifiers were supplied with the source data; the package is tracked by ecosystem coordinates as pip/pyrofork.
Know when the next one hits your stack
- 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:R/S:U/C:N/I:H/A:N
Any sender can deliver a malicious filename over the network without authentication (PR:N) but the victim must invoke download_media (UI:R); impact is arbitrary file write, so I:H with C:N/A:N.
Primary rating from Vendor (github).
CVSS VectorVendor: github
DescriptionCVE.org
Pyrofork is a modern, asynchronous MTProto API framework. Versions 2.3.68 and earlier do not properly sanitize filenames received from Telegram messages in the download_media method before using them in file path construction. When downloading media, if the user does not specify a custom filename (which is the common/default usage), the method falls back to using the file_name attribute from the media object. The attribute originates from Telegram's DocumentAttributeFilename and is controlled by the message sender. This issue is fixed in version 2.3.69.
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
Path traversal exploits occur when applications use user-controlled input to construct file system paths without proper validation.
NVD
CVE.org
EPSS
GitHub
Exploit-DB