Skip to content

CVE-2026-1839 Arbitrary Code Execution via Unsafe torch.load() in Trainer Checkpoint Loading in huggingface/transformers

HighCVSS 7.8 EPSS 0.39%
Published
Updated
Exploit status
No public exploit known
CISA SSVC
Proof of concept public · automatable: no · technical impact: total
Technology
Red Hat

Description

A vulnerability in the HuggingFace Transformers library, specifically in the Trainer class, allows for arbitrary code execution. The _load_rng_state() method in src/transformers/trainer.py at line 3059 calls torch.load() without the weights_only=True parameter. This issue affects all versions of the library supporting torch>=2.2 when used with PyTorch versions below 2.6, as the safe_globals() context manager provides no protection in these versions. An attacker can exploit this vulnerability by supplying a malicious checkpoint file, such as rng_state.pth, which can execute arbitrary code when loaded. The issue is resolved in version v5.0.0rc3.

Upgrade path

56 packages: 3 fixed, 53 with no fix yet.

PackageAffectedFixed inStatus
redhat/ansible-automation-platform-25/lightspeed-chatbot-rhel8(Red Hat ansible_automation_platform 2) All versions No fix listed No fix yet
redhat/openshift-lightspeed-tech-preview/lightspeed-rag-tool-rhel9(Red Hat lightspeed_core) All versions No fix listed No fix yet
redhat/openshift-lightspeed/lightspeed-ocp-rag-rhel9(Red Hat openshift_lightspeed 1) All versions No fix listed No fix yet
redhat/openshift-lightspeed/lightspeed-service-api-rhel9(Red Hat openshift_lightspeed 1) All versions No fix listed No fix yet
redhat/redhat-user-workloads/bootc-cuda-aws-3-3(Red Hat enterprise_linux_ai 3) All versions No fix listed No fix yet
redhat/redhat-user-workloads/bootc-cuda-azure-3-3(Red Hat enterprise_linux_ai 3) All versions No fix listed No fix yet
redhat/redhat-user-workloads/bootc-cuda-gcp-3-3(Red Hat enterprise_linux_ai 3) All versions No fix listed No fix yet
redhat/redhat-user-workloads/bootc-rocm-azure-3-3(Red Hat enterprise_linux_ai 3) All versions No fix listed No fix yet
redhat/redhat-user-workloads/lightspeed-chatbot-rhel9(Red Hat ansible_automation_platform 2) All versions No fix listed No fix yet
redhat/redhat-user-workloads/lightspeed-rag-tool(Red Hat openshift_lightspeed 1) All versions No fix listed No fix yet
redhat/redhat-user-workloads/lightspeed-stack(Red Hat lightspeed_core) All versions No fix listed No fix yet
redhat/redhat-user-workloads/rhaiis-cpu-ubi9-3-3(Red Hat ai_inference_server 3) All versions No fix listed No fix yet
redhat/redhat-user-workloads/rhaiis-cuda-ubi9-3-2-2(Red Hat ai_inference_server 3) All versions No fix listed No fix yet
redhat/redhat-user-workloads/rhaiis-cuda-ubi9-3-3(Red Hat ai_inference_server 3) All versions No fix listed No fix yet
redhat/redhat-user-workloads/rhaiis-model-opt-cuda-ubi9-3-2-2(Red Hat ai_inference_server 3) All versions No fix listed No fix yet
redhat/redhat-user-workloads/rhaiis-model-opt-cuda-ubi9-3-3(Red Hat ai_inference_server 3) All versions No fix listed No fix yet
redhat/redhat-user-workloads/rhaiis-neuron-ubi9-3-3(Red Hat ai_inference_server 3) All versions No fix listed No fix yet
redhat/redhat-user-workloads/rhaiis-rocm-ubi9-3-2-2(Red Hat ai_inference_server 3) All versions No fix listed No fix yet
redhat/redhat-user-workloads/rhaiis-rocm-ubi9-3-3(Red Hat ai_inference_server 3) All versions No fix listed No fix yet
redhat/redhat-user-workloads/rhaiis-spyre-ubi9(Red Hat ai_inference_server 3) All versions No fix listed No fix yet
redhat/redhat-user-workloads/rhaiis-spyre-ubi9-3-3(Red Hat ai_inference_server 3) All versions No fix listed No fix yet
redhat/redhat-user-workloads/rhaiis-tpu-ubi9(Red Hat ai_inference_server 3) All versions No fix listed No fix yet
redhat/redhat-user-workloads/rhaiis-tpu-ubi9-3-3(Red Hat ai_inference_server 3) All versions No fix listed No fix yet
redhat/rhelai3/bootc-cuda-rhel9(Red Hat enterprise_linux_ai 3) All versions No fix listed No fix yet
redhat/rhelai3/bootc-rocm-rhel9(Red Hat enterprise_linux_ai 3) All versions No fix listed No fix yet
redhat/rhelai3/disk-image-cuda-rhel9(Red Hat enterprise_linux_ai 3) All versions No fix listed No fix yet
redhat/rhoai/odh-built-in-detector-rhel9(Red Hat openshift_ai) All versions No fix listed No fix yet
redhat/rhoai/odh-caikit-nlp-rhel9(Red Hat openshift_ai) All versions No fix listed No fix yet
redhat/rhoai/odh-caikit-tgis-serving-rhel9(Red Hat openshift_ai) All versions No fix listed No fix yet
redhat/rhoai/odh-guardrails-detector-huggingface-runtime-rhel9(Red Hat openshift_ai) All versions No fix listed No fix yet

… and 26 more packages.

Affected products

ProductAffected versionsFixed in
pypi transformers(PyPI) < 5.0.0rc3 5.0.0rc3
pypi transformers(PyPI) = 0.1 No fix listed
pypi transformers(PyPI) = 2.0.0 No fix listed
pypi transformers(PyPI) = 2.1.0 No fix listed
pypi transformers(PyPI) = 2.1.1 No fix listed
pypi transformers(PyPI) = 2.10.0 No fix listed
pypi transformers(PyPI) = 2.11.0 No fix listed
pypi transformers(PyPI) = 2.2.0 No fix listed
pypi transformers(PyPI) = 2.2.1 No fix listed
pypi transformers(PyPI) = 2.2.2 No fix listed
pypi transformers(PyPI) = 2.3.0 No fix listed
pypi transformers(PyPI) = 2.4.0 No fix listed
pypi transformers(PyPI) = 2.4.1 No fix listed
pypi transformers(PyPI) = 2.5.0 No fix listed
pypi transformers(PyPI) = 2.5.1 No fix listed
pypi transformers(PyPI) = 2.6.0 No fix listed
pypi transformers(PyPI) = 2.7.0 No fix listed
pypi transformers(PyPI) = 2.8.0 No fix listed
pypi transformers(PyPI) = 2.9.0 No fix listed
pypi transformers(PyPI) = 2.9.1 No fix listed
pypi transformers(PyPI) = 3.0.0 No fix listed
pypi transformers(PyPI) = 3.0.1 No fix listed
pypi transformers(PyPI) = 3.0.2 No fix listed
pypi transformers(PyPI) = 3.1.0 No fix listed
pypi transformers(PyPI) = 3.2.0 No fix listed
Show 175 more
ProductAffected versionsFixed in
pypi transformers(PyPI) = 3.3.0 No fix listed
pypi transformers(PyPI) = 3.3.1 No fix listed
pypi transformers(PyPI) = 3.4.0 No fix listed
pypi transformers(PyPI) = 3.5.0 No fix listed
pypi transformers(PyPI) = 3.5.1 No fix listed
pypi transformers(PyPI) = 4.0.0 No fix listed
pypi transformers(PyPI) = 4.0.0rc1 No fix listed
pypi transformers(PyPI) = 4.0.1 No fix listed
pypi transformers(PyPI) = 4.1.0 No fix listed
pypi transformers(PyPI) = 4.1.1 No fix listed
pypi transformers(PyPI) = 4.10.0 No fix listed
pypi transformers(PyPI) = 4.10.1 No fix listed
pypi transformers(PyPI) = 4.10.2 No fix listed
pypi transformers(PyPI) = 4.10.3 No fix listed
pypi transformers(PyPI) = 4.11.0 No fix listed
pypi transformers(PyPI) = 4.11.1 No fix listed
pypi transformers(PyPI) = 4.11.2 No fix listed
pypi transformers(PyPI) = 4.11.3 No fix listed
pypi transformers(PyPI) = 4.12.0 No fix listed
pypi transformers(PyPI) = 4.12.1 No fix listed
pypi transformers(PyPI) = 4.12.2 No fix listed
pypi transformers(PyPI) = 4.12.3 No fix listed
pypi transformers(PyPI) = 4.12.4 No fix listed
pypi transformers(PyPI) = 4.12.5 No fix listed
pypi transformers(PyPI) = 4.13.0 No fix listed
pypi transformers(PyPI) = 4.14.0 No fix listed
pypi transformers(PyPI) = 4.14.1 No fix listed
pypi transformers(PyPI) = 4.15.0 No fix listed
pypi transformers(PyPI) = 4.16.0 No fix listed
pypi transformers(PyPI) = 4.16.1 No fix listed
pypi transformers(PyPI) = 4.16.2 No fix listed
pypi transformers(PyPI) = 4.17.0 No fix listed
pypi transformers(PyPI) = 4.18.0 No fix listed
pypi transformers(PyPI) = 4.19.0 No fix listed
pypi transformers(PyPI) = 4.19.1 No fix listed
pypi transformers(PyPI) = 4.19.2 No fix listed
pypi transformers(PyPI) = 4.19.3 No fix listed
pypi transformers(PyPI) = 4.19.4 No fix listed
pypi transformers(PyPI) = 4.2.0 No fix listed
pypi transformers(PyPI) = 4.2.1 No fix listed
pypi transformers(PyPI) = 4.2.2 No fix listed
pypi transformers(PyPI) = 4.20.0 No fix listed
pypi transformers(PyPI) = 4.20.1 No fix listed
pypi transformers(PyPI) = 4.21.0 No fix listed
pypi transformers(PyPI) = 4.21.1 No fix listed
pypi transformers(PyPI) = 4.21.2 No fix listed
pypi transformers(PyPI) = 4.21.3 No fix listed
pypi transformers(PyPI) = 4.22.0 No fix listed
pypi transformers(PyPI) = 4.22.1 No fix listed
pypi transformers(PyPI) = 4.22.2 No fix listed
pypi transformers(PyPI) = 4.23.0 No fix listed
pypi transformers(PyPI) = 4.23.1 No fix listed
pypi transformers(PyPI) = 4.24.0 No fix listed
pypi transformers(PyPI) = 4.25.0 No fix listed
pypi transformers(PyPI) = 4.25.1 No fix listed
pypi transformers(PyPI) = 4.26.0 No fix listed
pypi transformers(PyPI) = 4.26.1 No fix listed
pypi transformers(PyPI) = 4.27.0 No fix listed
pypi transformers(PyPI) = 4.27.1 No fix listed
pypi transformers(PyPI) = 4.27.2 No fix listed
pypi transformers(PyPI) = 4.27.3 No fix listed
pypi transformers(PyPI) = 4.27.4 No fix listed
pypi transformers(PyPI) = 4.28.0 No fix listed
pypi transformers(PyPI) = 4.28.1 No fix listed
pypi transformers(PyPI) = 4.29.0 No fix listed
pypi transformers(PyPI) = 4.29.1 No fix listed
pypi transformers(PyPI) = 4.29.2 No fix listed
pypi transformers(PyPI) = 4.3.0 No fix listed
pypi transformers(PyPI) = 4.3.0rc1 No fix listed
pypi transformers(PyPI) = 4.3.1 No fix listed
pypi transformers(PyPI) = 4.3.2 No fix listed
pypi transformers(PyPI) = 4.3.3 No fix listed
pypi transformers(PyPI) = 4.30.0 No fix listed
pypi transformers(PyPI) = 4.30.1 No fix listed
pypi transformers(PyPI) = 4.30.2 No fix listed
pypi transformers(PyPI) = 4.31.0 No fix listed
pypi transformers(PyPI) = 4.32.0 No fix listed
pypi transformers(PyPI) = 4.32.1 No fix listed
pypi transformers(PyPI) = 4.33.0 No fix listed
pypi transformers(PyPI) = 4.33.1 No fix listed
pypi transformers(PyPI) = 4.33.2 No fix listed
pypi transformers(PyPI) = 4.33.3 No fix listed
pypi transformers(PyPI) = 4.34.0 No fix listed
pypi transformers(PyPI) = 4.34.1 No fix listed
pypi transformers(PyPI) = 4.35.0 No fix listed
pypi transformers(PyPI) = 4.35.1 No fix listed
pypi transformers(PyPI) = 4.35.2 No fix listed
pypi transformers(PyPI) = 4.36.0 No fix listed
pypi transformers(PyPI) = 4.36.1 No fix listed
pypi transformers(PyPI) = 4.36.2 No fix listed
pypi transformers(PyPI) = 4.37.0 No fix listed
pypi transformers(PyPI) = 4.37.1 No fix listed
pypi transformers(PyPI) = 4.37.2 No fix listed
pypi transformers(PyPI) = 4.38.0 No fix listed
pypi transformers(PyPI) = 4.38.1 No fix listed
pypi transformers(PyPI) = 4.38.2 No fix listed
pypi transformers(PyPI) = 4.39.0 No fix listed
pypi transformers(PyPI) = 4.39.1 No fix listed
pypi transformers(PyPI) = 4.39.2 No fix listed
pypi transformers(PyPI) = 4.39.3 No fix listed
pypi transformers(PyPI) = 4.4.0 No fix listed
pypi transformers(PyPI) = 4.4.1 No fix listed
pypi transformers(PyPI) = 4.4.2 No fix listed
pypi transformers(PyPI) = 4.40.0 No fix listed
pypi transformers(PyPI) = 4.40.1 No fix listed
pypi transformers(PyPI) = 4.40.2 No fix listed
pypi transformers(PyPI) = 4.41.0 No fix listed
pypi transformers(PyPI) = 4.41.1 No fix listed
pypi transformers(PyPI) = 4.41.2 No fix listed
pypi transformers(PyPI) = 4.42.0 No fix listed
pypi transformers(PyPI) = 4.42.1 No fix listed
pypi transformers(PyPI) = 4.42.2 No fix listed
pypi transformers(PyPI) = 4.42.3 No fix listed
pypi transformers(PyPI) = 4.42.4 No fix listed
pypi transformers(PyPI) = 4.43.0 No fix listed
pypi transformers(PyPI) = 4.43.1 No fix listed
pypi transformers(PyPI) = 4.43.2 No fix listed
pypi transformers(PyPI) = 4.43.3 No fix listed
pypi transformers(PyPI) = 4.43.4 No fix listed
pypi transformers(PyPI) = 4.44.0 No fix listed
pypi transformers(PyPI) = 4.44.1 No fix listed
pypi transformers(PyPI) = 4.44.2 No fix listed
pypi transformers(PyPI) = 4.45.0 No fix listed
pypi transformers(PyPI) = 4.45.1 No fix listed
pypi transformers(PyPI) = 4.45.2 No fix listed
pypi transformers(PyPI) = 4.46.0 No fix listed
pypi transformers(PyPI) = 4.46.1 No fix listed
pypi transformers(PyPI) = 4.46.2 No fix listed
pypi transformers(PyPI) = 4.46.3 No fix listed
pypi transformers(PyPI) = 4.47.0 No fix listed
pypi transformers(PyPI) = 4.47.1 No fix listed
pypi transformers(PyPI) = 4.48.0 No fix listed
pypi transformers(PyPI) = 4.48.1 No fix listed
pypi transformers(PyPI) = 4.48.2 No fix listed
pypi transformers(PyPI) = 4.48.3 No fix listed
pypi transformers(PyPI) = 4.49.0 No fix listed
pypi transformers(PyPI) = 4.5.0 No fix listed
pypi transformers(PyPI) = 4.5.1 No fix listed
pypi transformers(PyPI) = 4.50.0 No fix listed
pypi transformers(PyPI) = 4.50.1 No fix listed
pypi transformers(PyPI) = 4.50.2 No fix listed
pypi transformers(PyPI) = 4.50.3 No fix listed
pypi transformers(PyPI) = 4.51.0 No fix listed
pypi transformers(PyPI) = 4.51.1 No fix listed
pypi transformers(PyPI) = 4.51.2 No fix listed
pypi transformers(PyPI) = 4.51.3 No fix listed
pypi transformers(PyPI) = 4.52.0 No fix listed
pypi transformers(PyPI) = 4.52.1 No fix listed
pypi transformers(PyPI) = 4.52.2 No fix listed
pypi transformers(PyPI) = 4.52.3 No fix listed
pypi transformers(PyPI) = 4.52.4 No fix listed
pypi transformers(PyPI) = 4.53.0 No fix listed
pypi transformers(PyPI) = 4.53.1 No fix listed
pypi transformers(PyPI) = 4.53.2 No fix listed
pypi transformers(PyPI) = 4.53.3 No fix listed
pypi transformers(PyPI) = 4.54.0 No fix listed
pypi transformers(PyPI) = 4.54.1 No fix listed
pypi transformers(PyPI) = 4.55.0 No fix listed
pypi transformers(PyPI) = 4.55.1 No fix listed
pypi transformers(PyPI) = 4.55.2 No fix listed
pypi transformers(PyPI) = 4.55.3 No fix listed
pypi transformers(PyPI) = 4.55.4 No fix listed
pypi transformers(PyPI) = 4.56.0 No fix listed
pypi transformers(PyPI) = 4.56.1 No fix listed
pypi transformers(PyPI) = 4.56.2 No fix listed
pypi transformers(PyPI) = 4.57.0 No fix listed
pypi transformers(PyPI) = 4.57.1 No fix listed
pypi transformers(PyPI) = 4.57.2 No fix listed
pypi transformers(PyPI) = 4.57.3 No fix listed
pypi transformers(PyPI) = 4.57.4 No fix listed
pypi transformers(PyPI) = 4.57.5 No fix listed
pypi transformers(PyPI) = 4.57.6 No fix listed
pypi transformers(PyPI) = 4.6.0 No fix listed
pypi transformers(PyPI) = 4.6.1 No fix listed
pypi transformers(PyPI) = 4.7.0 No fix listed

References