Skip to main content

Tencent TFace CVE-2025-13709

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 checkpoint
  2. Exploit
    Lure user to load the file
  3. Execution
    torch.load pickle deserialization triggers
  4. Impact
    Execute arbitrary code 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-controlled model checkpoint through the vulnerable restore_checkpoint path, where torch.load() is invoked without weights_only=True (confirmed by the fix diff across solver.py, main.py, vqgan.py, sample.py, eval.py and related training/eval scripts). The concrete prerequisite is that the user opens or resumes from a malicious .ckpt/.pth file (e.g. an untrusted 'pretrained' model or one passed via a --resume/checkpoint path). This works against default configurations because historic torch.load defaulted to weights_only=False. Limiting factors: it is NOT remotely exploitable over a network service - it needs local delivery of a file plus explicit user interaction (UI:R) to load it, which constrains realistic exploitation to supply-chain / social-engineering scenarios against TFace operators.

Impact

This is a classic PyTorch pickle-deserialization (CWE-502) remote code execution flaw: the fix diff confirms the root cause is torch.load(...) called without weights_only=True, meaning a malicious checkpoint file executes embedded pickle payloads during load. The CVSS 3.0 vector (AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H = 7.8 HIGH) is internally consistent with the description: the attack vector is LOCAL (AV:L) and requires user interaction (UI:R), because the victim must be induced to load an attacker-supplied model file - this is NOT a remotely-triggerable network service flaw despite the 'Remote Code Execution' label in the title. The signals are mostly aligned and point to MODERATE real-world priority: EPSS is low (0.51%, 42nd percentile), there is no CISA KEV listing and no public exploit identified, so there is no evidence of active or imminent mass exploitation. The main aggravating factor is that code runs in the context of root per the description, so successful exploitation yields full host compromise. Note a wording tension to verify: the description calls this 'Remote' RCE, but the CVSS vector is AV:L with UI:R, indicating the realistic path is social-engineering a user into loading a malicious checkpoint rather than network exploitation - treat it as a supply-chain / untrusted-model-file risk, not an internet-facing exposure.

Exploit ScenarioDerived

An attacker publishes or sends a weaponized model checkpoint (e.g. a .ckpt/.pth file) and convinces a TFace user - a researcher or ML engineer - to load it, for example via a training/eval/resume workflow or by downloading a 'pretrained' model from an untrusted repository. When restore_checkpoint calls torch.load() without weights_only=True, the embedded pickle payload executes and runs arbitrary code as root. No public exploit is identified at time of analysis, but the technique (malicious PyTorch pickle) is well-known and trivially reproducible.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 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

PyTorch checkpoint loading in Tencent TFace (restore_checkpoint and related model-loading paths) deserializes untrusted data, letting an attacker who supplies a malicious .ckpt/.pth file execute arbitrary code in the context of the user running TFace - typically root in the reference ZDI finding. The flaw is local and requires user interaction (CVSS 7.8, AV:L/AC:L/PR:N/UI:R): the victim must explicitly point the toolkit at an attacker-controlled checkpoint, for example via a --resume path or a downloaded 'pretrained' model, so realistic abuse is a supply-chain or social-engineering play against TFace operators rather than remote exploitation of a network service. The upstream project has published a fix commit that adds weights_only=True to every torch.load() call; EPSS is low (0.51%, ~42nd percentile), there is no CISA KEV listing, and no public exploit code was identified at time of analysis.

RemediationAI

Patch available per vendor advisory: apply upstream fix commit 7b2eed297d43dcdd1e3d45bfdfc950478e3af5d9 (https://github.com/Tencent/TFace/commit/7b2eed297d43dcdd1e3d45bfdfc950478e3af5d9), which adds weights_only=True to every torch.load() call; no tagged release number is confirmed in the available data, so pin to a repository revision at or after that commit and reference ZDI-25-1036. If you cannot patch immediately, the highest-value compensating control is to add weights_only=True manually at each torch.load() call site listed in the diff - the side effect is that legacy checkpoints holding non-tensor objects will raise errors and must be re-exported as pure state dicts. Operationally, treat checkpoint files as executable code: only load .ckpt/.pth files you produced or that carry a verified checksum/signature from a trusted source, and quarantine any 'pretrained' model delivered by a third party or fetched over an untrusted channel; this blocks the attack but breaks legitimate workflows that rely on untrusted community weights. Run TFace training, evaluation, and ONNX export as an unprivileged, containerized user rather than root so a successful pickle payload does not yield host-level control - the trade-off is possible friction with GPU device, dataset, and shared-cache permissions. If checkpoint provenance cannot be guaranteed, pre-scan files in a sandboxed process before loading them in production. Restricting who can write to the --resume/checkpoint paths and disabling auto-resume from user-supplied locations further reduces exposure.

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

The root cause is CWE-502 (Deserialization of Untrusted Data) in the PyTorch model-loading layer. torch.load() historically defaults to weights_only=False, which means the file is processed by Python's pickle machinery; a crafted checkpoint can embed a __reduce__ payload that runs arbitrary commands the moment the file is loaded, before any weight tensors are inspected. Tencent TFace's restore_checkpoint logic and numerous sibling loaders - attribute/M3DFEL/solver.py, generation/uiface/main.py (save/restore of model.ckpt and optimization.ckpt), generation/uiface/models/autoencoder/vqgan.py, generation/uiface/sample.py, quality/eval.py, quality/generate_pseudo_labels/extract_embedding/extract_feats.py, quality/train.py, recognition/deploy/converter/export_onnx.py, recognition/tasks/duetface/base_task.py and train.py - all called torch.load() without weights_only=True, so any of these entry points could be used to trigger deserialization. The single-component CPE (cpe:2.3:a:tencent:tface:*:*:*:*:*:*:*:*) indicates the entire toolkit, not a particular submodule, is treated as affected. The upstream remediation uniformly adds weights_only=True so the loader restricts unpickling to tensors and primitive containers; the trade-off is that legacy checkpoints containing non-tensor Python objects will now fail to load until re-exported. Severity is capped by the local, interaction-required delivery model, but integrity and confidentiality impact are both high once a payload runs, because code inherits the privileges of the training/eval process.

Know when Tface 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 checkpoint file; PR:N since no prior auth is needed, and C/I/A:H as code runs 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:A/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 TFace restore_checkpoint Deserialization of Untrusted Data Remote Code Execution Vulnerability. This vulnerability allows remote attackers to execute arbitrary code on affected installations of Tencent TFace. 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 restore_checkpoint 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-27185.

Executive ViewAI

Why It Matters

Tencent TFace, an open-source PyTorch-based face analysis toolkit used in ML research and biometric pipelines, loads model checkpoints in a way that lets a tampered .ckpt or .pth file run arbitrary code under the account executing the tool - which in the vendor's reference configuration is root. The attack is local and depends on an operator being persuaded to load an attacker-supplied checkpoint, so the realistic exposure is supply-chain or social-engineering driven rather than remote, and leadership should care because teams commonly download 'pretrained' models from unvetted sources and often run training jobs with elevated privileges. Exploitation likelihood is currently low (no CISA KEV listing, EPSS ~0.5%, no public exploit code identified), but a successful hit yields full host compromise and potential theft or poisoning of proprietary model assets.

Business Impact: Medium
Compensating Controls

Apply vendor patch. Until it is deployed, load only checkpoints from trusted, checksum-verified sources, run TFace under an unprivileged account rather than root, and process untrusted model files in an isolated sandbox or disposable container.

Threat Intelligence Overview

EPSS Score
0.5%
Top 58% exploitable
Prevalence
Low
open-source face-recognition research toolkit, niche ML/academic 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 Yes
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.

Affected Products (CPE)CVE.org

cpe:2.3:a:tencent:tface:*:*:*:*:*:*:*:*

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