Tencent MedicalNet CVE-2025-13714
HIGHAttack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessCraft malicious PyTorch .pth checkpoint
-
DeliveryDeliver via model hub or social engineering
-
ExploitVictim sets it as pretrain_path
-
Executiontorch.load deserializes pickle payload
-
ImpactArbitrary code executes as root
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A08:2025 - Software or Data Integrity Failures
ASVS 5.0
V1 - Encoding and Sanitization Safe deserialization, type allowlists
MITRE ATT&CK
2 techniques across 2 tactics: Execution, Initial Access 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 victim to load an attacker-supplied pretrained model file: the generate_model function must be invoked with opt.pretrain_path pointing to a malicious PyTorch checkpoint (.pth), which torch.load deserializes via unsafe pickle. The limiting factor is mandatory user interaction (UI:R) - a human must choose to open or load the malicious file - and the LOCAL attack vector (AV:L) means there is no network-exposed service; the attacker cannot reach the code without the victim's file-loading action. This is not reachable against a default/idle installation; it triggers only along the pretrained-model loading code path. Vulnerable builds are those before commit 1679f7c that call torch.load without weights_only=True. |
| Impact | This is a classic Python/PyTorch pickle deserialization flaw (CWE-502): the generate_model function in model.py calls torch.load(opt.pretrain_path) without weights_only, so loading an attacker-controlled pretrained model file executes arbitrary pickle reduce payloads. The CVSS 3.0 vector (AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H, base 7.8) is internally consistent with the description: it is LOCAL vector plus REQUIRED user interaction, NOT a remotely-reachable network service - ZDI's 'remote attacker' phrasing refers to social-engineering delivery of a malicious .pth file, not an unauthenticated network RCE, which is an important distinction defenders should not misread. Exploitation signals are modest: EPSS is 0.51% (42nd percentile), there is NO CISA KEV listing and no public exploit was identified in the provided data, so this is no public exploit identified at time of analysis. The high CVSS is driven by the root-level code execution impact (C:H/I:H/A:H), not by ease or likelihood of real-world attack. Net: a genuinely high-impact bug but a low-urgency one in practice - it requires a victim to be tricked into loading a malicious model file into a niche research codebase, which is targeted/opportunistic rather than mass-exploitable. The torch.load source evidence corroborates the deserialization root cause and the fix (weights_only=True plus a safe_globals allowlist). |
| Exploit ScenarioDerived | An attacker publishes or sends a malicious 'pretrained' PyTorch model (.pth) file - e.g. on a model hub, in a repo, or by email - and persuades a researcher to use it as opt.pretrain_path. When generate_model calls torch.load on the file, the embedded pickle payload executes and runs arbitrary code in the context of root. No public exploit code was identified in the provided data, but the technique (malicious pickle in a torch checkpoint) is well understood and trivially weaponizable. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 19, 2026
Arbitrary code execution in Tencent MedicalNet occurs when the generate_model function in model.py loads a pretrained model via torch.load(opt.pretrain_path) without weights_only=True, allowing a malicious PyTorch checkpoint (.pth) to execute pickle reduce payloads in the context of the user running the training pipeline (typically root in containerized or GPU-server deployments). The attack vector is local (AV:L) with mandatory user interaction (UI:R): a victim must point opt.pretrain_path at, or open, an attacker-supplied model file - there is no network-reachable service and no exploit path against an idle/default installation. No public exploit code or confirmed active exploitation (CISA KEV) was identified at time of analysis, and EPSS is low at 0.51% (42nd percentile), consistent with a tool that is not internet-exposed.
RemediationAI
Upstream fix available (PR/commit); released patched version not independently confirmed - apply commit 1679f7ced8fd3e9ce1acc3b86cd840b5abdaa836 (https://github.com/Tencent/MedicalNet/commit/1679f7ced8fd3e9ce1acc3b86cd840b5abdaa836), which changes generate_model to call torch.load(opt.pretrain_path, weights_only=True, map_location='cpu') inside a torch.serialization.safe_globals([__name__]) block limited to models.resnet; note that weights_only=True will reject legitimate checkpoints containing non-allowlisted custom classes, so validate the SAFE_GLOBALS list against your own model definitions and expect load failures until it is extended. Where patching is not immediately possible, only load .pth files from trusted, checksum-verified sources (publish and verify SHA-256 hashes for pretrained weights) and treat any externally supplied or downloaded checkpoint as executable code; run training in a least-privileged container rather than as root, since exploitation yields code execution at the caller's privilege level; and scan or convert untrusted checkpoints to safetensors or state_dict-only formats before loading. Restricting filesystem write access to the directory holding pretrained weights removes the attacker's ability to drop a malicious .pth in place. These are compensating controls only - none eliminate the unsafe deserialization primitive. See ZDI-25-1031 (https://www.zerodayinitiative.com/advisories/ZDI-25-1031/) for the original disclosure.
Affected ProductsAI
All Tencent MedicalNet builds whose model.py generate_model function calls torch.load on opt.pretrain_path without weights_only=True, i.e. revisions prior to upstream commit 1679f7ced8fd3e9ce1acc3b86cd840b5abdaa836. This corresponds to the CPE-identified MedicalNet Python package/checkout rather than a versioned PyPI release, so version pinning is not meaningful - determination of exposure requires inspecting the deployed model.py. The flaw is in the pretrained-model loading code path (generate_model in model.py) and triggers only when a caller supplies a pretrained checkpoint path. Details are documented in the ZDI advisory ZDI-25-1031 (https://www.zerodayinitiative.com/advisories/ZDI-25-1031/) and the fixing commit is at https://github.com/Tencent/MedicalNet/commit/1679f7ced8fd3e9ce1acc3b86cd840b5abdaa836.
Affects your stack
Find out whether the stacks and servers you run are on an affected version.
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
MedicalNet is a Tencent medical-imaging 3D ResNet project; its training entry point calls generate_model(opt) in model.py, which historically performed pretrain = torch.load(opt.pretrain_path) with default arguments. PyTorch's legacy torch.load deserializes checkpoints through Python's pickle machinery, so any object graph referencing __reduce__ is reconstructed during unpickling - the classic CWE-502 (Deserialization of Untrusted Data) root cause. An attacker who can supply the .pth file therefore controls code execution at load time, before any model math runs. The upstream fix hardens the call site by importing torch.serialization, restricting allowed globals to the models.resnet module via SAFE_GLOBALS, and invoking torch.load(..., weights_only=True, map_location='cpu') inside a torch.serialization.safe_globals context, with explicit error handling for missing files, unsafe global rejections, and generic load failures. The assessed CVSS:3.1 vector (AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H) confirms the constraint set: no privileges required beyond the victim's own load action, but local reachability and human interaction gate exploitation.
Know when Pytorch 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:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
AV:L and UI:R because the victim must load an attacker-supplied model file locally; PR:N as no prior auth is needed; C/I/A:H since pickle execution runs arbitrary code as root.
Primary rating from Vendor (trendmicro).
CVSS VectorVendor: trendmicro
DescriptionCVE.org
Tencent MedicalNet generate_model Deserialization of Untrusted Data Remote Code Execution Vulnerability. This vulnerability allows remote attackers to execute arbitrary code on affected installations of Tencent MedicalNet. User interaction is required to exploit this vulnerability in that the target must visit a malicious page or open a malicious file.
The specific flaw exists within the generate_model function. The issue results from the lack of proper validation of user-supplied data, which can result in deserialization of untrusted data. An attacker can leverage this vulnerability to execute code in the context of root. Was ZDI-CAN-27192.
Executive ViewAI
Tencent MedicalNet, an open-source medical imaging model toolkit used by research and data-science teams, contains a code-execution weakness that is triggered only when a user loads a malicious pretrained model file (.pth) through its generate_model training path. Because the tool is commonly run with elevated privileges in containerized or shared GPU-server environments, a single unsafe third-party checkpoint could allow an attacker to take control of that host and reach connected research data and systems. No vendor patch is available and no public exploit was identified at time of analysis, so exposure is confined to teams that routinely import external model files.
No vendor-released patch identified at time of analysis; interim mitigations include loading only checksum-verified checkpoints from a trusted internal repository, invoking torch.load with weights_only=True, running training pipelines as a non-root user with least privilege, isolating MedicalNet workloads in restricted containers without host mounts or broad network access, and blocking or scanning untrusted .pth files before they reach shared GPU servers.
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
Insecure deserialization occurs when an application converts serialized data (a stream of bytes representing an object's state) back into a living object without proper validation.
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
TorchServe is a tool for serving and scaling PyTorch models in production. Rated critical severity (CVSS 9.8), this vuln
In PyTorch <=2.4.1, the RemoteModule has Deserialization RCE. Rated critical severity (CVSS 9.8), this vulnerability is
PickleScan before 0.0.23 can be bypassed by flipping specific ZIP file header flag bits, allowing malicious pickle files
In PyTorch before trunk/89695, torch.jit.annotations.parse_type_line can cause arbitrary code execution because eval is
PyTorch is a Python package that provides tensor computation. [CVSS 8.8 HIGH]
A vulnerability in lightning-ai/pytorch-lightning version 2.3.2 allows an attacker to cause a denial of service by sendi
Out-of-bounds heap read in PyTorch torchvision's native GIF decoder (versions through 0.28.0) lets attackers who supply
picklescan before 0.0.23 is vulnerable to a ZIP archive manipulation attack that causes it to crash when attempting to e
TorchServe is a flexible and easy-to-use tool for serving and scaling PyTorch models in production. Rated critical sever
PyTorch is a Python package that provides tensor computation with strong GPU acceleration and deep neural networks built
NVIDIA APEX for Linux contains a deserialization of untrusted data vulnerability that affects environments using PyTorch
A vulnerability, which was classified as problematic, has been found in PyTorch 2.6.0+cu124. Rated medium severity (CVSS
NVD
CVE.org
EPSS
GitHub
Exploit-DB