CVE-2026-24747: PyTorch Vulnerable to Remote Code Execution via Untrusted Checkpoint Files

Published Jan 27, 2026
·
Updated

Summary

A vulnerability in PyTorch's weightsonly unpickler allows an attacker to craft a malicious checkpoint file (.pth) that, when loaded with torch.load(..., weightsonly=True), can corrupt memory and potentially lead to arbitrary code execution.

Vulnerability Details

The weightsonly=True unpickler failed to properly validate pickle opcodes and storage metadata, allowing:

1. Heap memory corruption via SETITEM/SETITEMS opcodes applied to non-dictionary types 2. Storage size mismatch between declared element count and actual data in the archive

Impact

An attacker who can convince a user to load a malicious checkpoint file may achieve arbitrary code execution in the context of the victim's process.

Credit Ji'an Zhou

Other sources

PyTorch is a Python package that provides tensor computation. Prior to version 2.10.0, a vulnerability in PyTorch's weightsonly unpickler allows an attacker to craft a malicious checkpoint file (.pth) that, when loaded with torch.load(..., weightsonly=True), can corrupt memory and potentially lead to arbitrary code execution. Version 2.10.0 fixes the issue.

MITRE

Affected Software

2 affected componentsFixes available
pip/pytorch<2.10.0
2.10.0
linuxfoundation Pytorch Python<2.10.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/pytorch to a version that resolves this vulnerability.

    Fixed in 2.10.0
  2. Upgrade

    Upgrade PyTorch to a version that resolves this vulnerability.

    Fixed in 2.10.0

Event History

Jan 27, 2026
Advisory Published
via GitHub·08:10 PM
Data Sourced
via GitHub·08:10 PM
DescriptionSeverityWeaknessAffected Software
CVE Published
via MITRE·09:13 PM
Data Sourced
via MITRE·09:13 PM
DescriptionSeverityWeakness
Data Sourced
via Red Hat·10:02 PM
DescriptionSeverityAffected Software
Data Sourced
via NVD·10:15 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2026-24747?

CVE-2026-24747 has a high severity due to its potential for remote code execution.

2

How do I fix CVE-2026-24747?

To mitigate CVE-2026-24747, update to a patched version of PyTorch that addresses this vulnerability.

3

What versions of PyTorch are affected by CVE-2026-24747?

CVE-2026-24747 affects versions of PyTorch prior to 2.10.0.

4

What type of attacks can CVE-2026-24747 enable?

CVE-2026-24747 can enable remote code execution through malicious checkpoint files.

5

Is CVE-2026-24747 related to any specific functionality in PyTorch?

Yes, CVE-2026-24747 is specifically related to the `weights_only` unpickler function in PyTorch.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203