{
  "affected": [
    {
      "ranges": [
        {
          "database_specific": {
            "cpe": [
              "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:*:*:*:*:*:*"
            ],
            "extracted_events": [
              {
                "introduced": "0"
              },
              {
                "fixed": "5.0.0"
              },
              {
                "introduced": "5.0.0-rc0"
              },
              {
                "last_affected": "5.0.0-rc0"
              },
              {
                "introduced": "5.0.0-rc1"
              },
              {
                "last_affected": "5.0.0-rc1"
              },
              {
                "introduced": "5.0.0-rc2"
              },
              {
                "last_affected": "5.0.0-rc2"
              }
            ],
            "source": [
              "CPE_RANGE",
              "CPE_STRING",
              "REFERENCES"
            ]
          },
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "08810b1e278938278c50153ee1edfd7a20a759da"
            },
            {
              "introduced": "cbc6716945cff1d8e124d344ba0150e6e27f8b6e"
            },
            {
              "fixed": "03c8082ba4594c9b8d6fe190ca9bed0e5f8ca396"
            }
          ],
          "repo": "https://github.com/huggingface/transformers",
          "type": "GIT"
        }
      ],
      "versions": [
        "5.0.0-rc0",
        "5.0.0-rc1",
        "5.0.0-rc2"
      ]
    }
  ],
  "database_specific": {
    "cna_assigner": "@huntr_ai",
    "cwe_ids": [
      "CWE-502"
    ],
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/1xxx/CVE-2026-1839.json"
  },
  "details": "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.",
  "id": "CVE-2026-1839",
  "modified": "2026-07-15T01:49:09.277072785Z",
  "published": "2026-04-07T05:22:00.959Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://huntr.com/bounties/3c77bb97-e493-493d-9a88-c57f5c536485"
    },
    {
      "type": "ADVISORY",
      "url": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/1xxx/CVE-2026-1839.json"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-1839"
    },
    {
      "type": "FIX",
      "url": "https://github.com/huggingface/transformers/commit/03c8082ba4594c9b8d6fe190ca9bed0e5f8ca396"
    }
  ],
  "schema_version": "1.8.0",
  "severity": [
    {
      "score": "CVSS:3.0/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:L/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Arbitrary Code Execution via Unsafe torch.load() in Trainer Checkpoint Loading in huggingface/transformers"
}