Skip to main content

Tencent FaceDetection-DSFD CVE-2025-13715

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 model file
  2. Exploit
    Deliver via page/file to victim
  3. Execution
    torch.load() deserializes untrusted pickle
  4. 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-controlled model file through the resnet code path, where torch.load() (self.model_path) deserializes a Python pickle without validation (CWE-502). The concrete prerequisite is that the application loads a PyTorch .pth/weights file whose origin the attacker controls. Limiting factors that reduce real-world risk: user interaction is mandatory (UI:R - the target must actively open the malicious file or visit the delivering page), the vector is local rather than network (AV:L), and the affected product is a niche open-source research project, so there is no default network-exposed service to attack. There is no authentication barrier for the attacker (PR:N), but the social-engineering/interaction gate is the practical constraint.

Impact

Signals point to a serious-but-constrained issue rather than a widespread emergency. The CVSS 3.0 base score of 7.8 (HIGH) is driven by total impact (C:H/I:H/A:H) and code execution as root, but the vector is LOCAL (AV:L) and requires user interaction (UI:R) - the victim must open or load an attacker-supplied PyTorch model file. This is the classic CWE-502 pickle-deserialization flaw in torch.load(), confirmed by the source diff touching model/resnet.py. EPSS is low at 0.43% (36th percentile), there is no CISA KEV listing, and no public exploit was identified, so automated mass-exploitation is unlikely; SSVC-style reading is exploitation=none, automatable=no (interaction-gated), technical impact=total. CONFLICT TO VERIFY: the description calls these 'remote attackers' who 'visit a malicious page or open a malicious file', yet the CVSS vector is AV:L (local) - this is ZDI's standard framing for file/model-delivered RCE and should be read as local-with-user-interaction, not network-remote. Additional caveat: the linked 'fix' commit only adds map_location to torch.load() and does NOT actually remediate the pickle deserialization, so the referenced patch may be incomplete - verify with the vendor before treating it as fixed. Net: real and high-impact for anyone running this research code, but low urgency given the niche footprint and interaction requirement.

Exploit ScenarioDerived

An attacker crafts a malicious PyTorch model (.pth) file containing a pickle payload and tricks a user into loading it through the resnet model path (e.g., hosting it on a page or sending it as a 'pretrained weights' file). When the victim runs the DSFD resnet code, torch.load() deserializes the untrusted data and executes the attacker's code as root. No public exploit was identified at time of analysis, though the technique (pickle RCE via torch.load) is well understood.

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

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

Alert me

AnalysisAIv1 – Oct 19, 2026

Deserialization of untrusted data in Tencent FaceDetection-DSFD's resnet model loader (model/resnet.py) allows an attacker to execute arbitrary code at root privilege on installations where a victim loads an attacker-supplied PyTorch weights file. The flaw is CWE-502: self.model_path is passed directly to torch.load(), which deserializes a Python pickle without validation. Exploitation requires user interaction (the target must open or be delivered the malicious model file) and the vector is local (AV:L) and unauthenticated (PR:N); EPSS is low at 0.43% (36th percentile), no public exploit code was identified at time of analysis, and the project is a niche open-source research codebase with no default network-exposed service, so risk is serious but constrained rather than a widespread emergency.

RemediationAI

Apply the upstream commit a941d089d8ae2df5292a904e79d88649cb58a440 (https://github.com/Tencent/FaceDetection-DSFD/commit/a941d089d8ae2df5292a904e79d88649cb58a440); note this is an upstream fix commit rather than a confirmed tagged release, and its map_location change alone does not close the pickle path - treat it as a minimum and additionally harden the loader. Concretely: change the call to torch.load(self.model_path, map_location=..., weights_only=True) so only tensors are unpickled, or migrate checkpoints to the safetensors format; the trade-off is that legacy checkpoints containing custom classes will fail to load and must be re-serialized. Enforce integrity on model artifacts (hash allowlist of known-good .pth files) and never accept a model_path from untrusted input, upload endpoints, or downloaded archives - this blocks the social-engineering delivery vector that the UI:R requirement implies. Run inference as a non-root, low-privilege user or inside a container/VM so that a successful deserialization does not yield root-level code execution, accepting the operational overhead of permission and device-access plumbing. For triage reference, consult ZDI-25-1183 (https://www.zerodayinitiative.com/advisories/ZDI-25-1183/). No patch version was identified in the provided data beyond the referenced commit, and no exploitation has been confirmed in the wild.

Affected ProductsAI

Affected is Tencent FaceDetection-DSFD, the open-source DSFD face detection project (GitHub Tencent/FaceDetection-DSFD), specifically the ResNet code path in model/resnet.py that loads checkpoint weights via torch.load(self.model_path). No CPE identifiers or explicit tagged version numbers were provided in the intelligence data; the practical boundary is the state of the repository prior to the fix commit a941d089d8ae2df5292a904e79d88649cb58a440 (referenced from NVD). Any deployment - research reproduction, demo pipeline, or downstream fork - that loads externally supplied .pth/weights files through this loader is in scope. Vendor detail is documented in the Zero Day Initiative advisory ZDI-25-1183 (https://www.zerodayinitiative.com/advisories/ZDI-25-1183/), with the upstream change at https://github.com/Tencent/FaceDetection-DSFD/commit/a941d089d8ae2df5292a904e79d88649cb58a440.

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

FaceDetection-DSFD is Tencent's open-source Dual Shot Face Detector research implementation, and the affected component is the ResNet backbone wrapper in model/resnet.py whose _init_modules() routine restores pretrained weights. The root cause is CWE-502: PyTorch's torch.load() uses Python pickle deserialization by default, so any file reachable through self.model_path can embed a __reduce__ payload that executes arbitrary Python (and therefore shell) commands during model loading. Because the loader runs in the same process context as the inference application - frequently launched as root in research/demo setups - code executes with those privileges. Note that the referenced upstream commit a941d089d8ae2df5292a904e79d88649cb58a440 only adds a map_location lambda to torch.load; storage remapping does not disable pickle execution, so the underlying untrusted-deserialization path persists unless weights_only=True (or a non-pickle format such as safetensors) is used. No CPE strings were supplied, and the CVSS vector is 3.0/AV:L/AC:L/PR:N/UI:R with the independent assessment normalizing to CVSS:3.1 on the same metrics.

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

File/model-delivered pickle RCE is local (AV:L) and interaction-gated (UI:R); attacker needs no privileges (PR:N) and code runs as root for total C/I/A impact.

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 FaceDetection-DSFD resnet Deserialization of Untrusted Data Remote Code Execution Vulnerability. This vulnerability allows remote attackers to execute arbitrary code on affected installations of Tencent FaceDetection-DSFD. 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 resnet endpoint. 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-27197.

Executive ViewAI

Why It Matters

Tencent's FaceDetection-DSFD research codebase contains a high-severity deserialization flaw (CVE-2025-13715, CVSS 7.8) that lets a malicious PyTorch weights file execute arbitrary code at root when loaded. The exposure is concentrated in data science and ML engineering teams that ingest third-party model files into this niche open-source framework rather than in customer-facing network services. Leadership should treat this as a supply-chain and developer-workstation risk requiring controls on model artifact provenance, not as a broad internet-facing emergency, since exploitation requires a victim to load an attacker-supplied file and no public exploit has been identified.

Business Impact: Medium
Compensating Controls

No vendor-released patch identified at time of analysis; interim mitigations are to block loading of untrusted PyTorch weights files, run the framework in a sandboxed container or VM under a non-root account, verify model artifact provenance and hashes, prefer safe serialization formats such as safetensors, and apply endpoint detection for suspicious process behavior from Python ML workloads.

Threat Intelligence Overview

EPSS Score
0.4%
Top 64% exploitable
Prevalence
Low
open-source research face-detection repo, no broad production deployment
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.4%
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

39
Low Medium High Critical
KEV: 0
EPSS: 0
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