{
  "id": "CVE-2026-1839",
  "url": "https://poc.griffinguard.io/cve/CVE-2026-1839",
  "published_at": "2026-04-07T05:22:00.959Z",
  "title": "Arbitrary Code Execution via Unsafe torch.load() in Trainer Checkpoint Loading in huggingface/transformers",
  "vendor": "huggingface",
  "product": "huggingface/transformers",
  "cvss": {
    "score": 7.8,
    "source": "nvd",
    "vector": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
  },
  "kev": {
    "in_kev": false,
    "added_at": null,
    "days_after_publication": null
  },
  "first_poc": null,
  "poc_repo_count": 0,
  "exploit_count": 0,
  "suspicious_repo_count": 0,
  "edge_device": null,
  "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\u003e=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.",
  "cwe": "CWE-502",
  "cpes": [
    "cpe:2.3:a:huggingface:transformers:*:*:*:*:*:*:*:*",
    "cpe:2.3:a:huggingface:transformers:5.0.0:rc0:*:*:*:*:*:*",
    "cpe:2.3:a:huggingface:transformers:5.0.0:rc1:*:*:*:*:*:*",
    "cpe:2.3:a:huggingface:transformers:5.0.0:rc2:*:*:*:*:*:*"
  ],
  "cvss_by_source": {
    "cna": 6.5,
    "nvd": 7.8
  },
  "repos": [],
  "remediation": {
    "affected": [
      {
        "vendor": "huggingface",
        "product": "huggingface/transformers",
        "ranges": [
          "\u003e= unspecified, \u003c v5.0.0rc3"
        ],
        "fixed_in": [
          "v5.0.0rc3"
        ]
      }
    ],
    "upgrade": [
      "Upgrade huggingface/transformers to v5.0.0rc3 or later."
    ],
    "references": [
      {
        "kind": "Patch",
        "url": "https://github.com/huggingface/transformers/commit/03c8082ba4594c9b8d6fe190ca9bed0e5f8ca396"
      }
    ]
  },
  "exploit_refs": [],
  "hunt_profile": [],
  "rules": []
}
