Skip to main content

Tencent MedicalNet CVE-2025-13714

HIGH
Deserialization of Untrusted Data (CWE-502)
2025-12-23 zdi-disclosures@trendmicro.com
7.8
CVSS 3.0 · Vendor: trendmicro
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Craft malicious PyTorch .pth checkpoint
  2. Delivery
    Deliver via model hub or social engineering
  3. Exploit
    Victim sets it as pretrain_path
  4. Execution
    torch.load deserializes pickle payload
  5. Impact
    Arbitrary 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.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
No patch listed yet 0.5% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

Vendor (trendmicro) PRIMARY 7.8 HIGH
AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
vuln.today AI 7.8 HIGH

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.

3.1 AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
4.0 AV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (trendmicro).

CVSS VectorVendor: trendmicro

Attack Vector
Local
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

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

Why It Matters

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.

Business Impact: Medium
Compensating Controls

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

EPSS Score
0.5%
Top 58% exploitable
Prevalence
Low
Tencent research/academic PyTorch codebase, minimal production deployment footprint
Data Quality
4 sources
Confidence: Medium

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.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.5%
Patch available No
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Defer
Exploitation· derived
None
System Exposure· derived
Small
Automatable· derived
No
Human Impact
Medium

Priority Score

40
Low Medium High Critical
KEV: 0
EPSS: +1
CVSS: +39
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

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.

CVE-2023-43654 CRITICAL POC
9.8 Sep 28

TorchServe is a tool for serving and scaling PyTorch models in production. Rated critical severity (CVSS 9.8), this vuln

CVE-2024-48063 CRITICAL POC
9.8 Oct 29

In PyTorch <=2.4.1, the RemoteModule has Deserialization RCE. Rated critical severity (CVSS 9.8), this vulnerability is

CVE-2025-1945 CRITICAL POC
9.8 Mar 10

PickleScan before 0.0.23 can be bypassed by flipping specific ZIP file header flag bits, allowing malicious pickle files

CVE-2022-45907 CRITICAL POC
9.8 Nov 26

In PyTorch before trunk/89695, torch.jit.annotations.parse_type_line can cause arbitrary code execution because eval is

CVE-2026-24747 HIGH POC
8.8 Jan 27

PyTorch is a Python package that provides tensor computation. [CVSS 8.8 HIGH]

CVE-2024-8020 HIGH POC
7.5 Mar 20

A vulnerability in lightning-ai/pytorch-lightning version 2.3.2 allows an attacker to cause a denial of service by sendi

CVE-2026-65918 HIGH POC
7.1 Jul 23

Out-of-bounds heap read in PyTorch torchvision's native GIF decoder (versions through 0.28.0) lets attackers who supply

CVE-2025-1944 MEDIUM POC
6.5 Mar 10

picklescan before 0.0.23 is vulnerable to a ZIP archive manipulation attack that causes it to crash when attempting to e

CVE-2024-35198 CRITICAL
9.8 Jul 19

TorchServe is a flexible and easy-to-use tool for serving and scaling PyTorch models in production. Rated critical sever

CVE-2025-32434 CRITICAL POC
9.3 Apr 18

PyTorch is a Python package that provides tensor computation with strong GPU acceleration and deep neural networks built

CVE-2025-33244 CRITICAL
9.0 Mar 24

NVIDIA APEX for Linux contains a deserialization of untrusted data vulnerability that affects environments using PyTorch

CVE-2025-2953 MEDIUM POC
4.8 Mar 30

A vulnerability, which was classified as problematic, has been found in PyTorch 2.6.0+cu124. Rated medium severity (CVSS

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy