{
  "id": 14965250,
  "title": "The config key that runs code: catching the CVE-2026-58659 class_path/_instantiator vector statically",
  "url": "https://urgent.news/2026/10/16/the-config-key-that-runs-code-catching-the-cve-2026-58659-class-path",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-10-16T13:41:49.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/munimv2/the-config-key-that-runs-code-catching-the-cve-2026-58659-classpathinstantiator-vector-5c81"
  },
  "original_language": "en",
  "account": "The CVE-2026-58659 vulnerability in PyTorch Lightning allows for arbitrary code execution during model loading. This occurs because the config key that runs code, _instantiator, can be manipulated to trigger an import-and-call during the loading process, bypassing the weights_only=True security measure. The vulnerability affects PyTorch Lightning versions up to 2.6.5, but was fixed in version 2.6.6. The jsonargparse library, used by PyTorch Lightning, also addressed the issue with its own fix in version 5.0.0. The vulnerability stems from the config file containing a _class_path string, which is passed to jsonargparse's import_object function, causing an import side effect that can fire even when the resulting class would later be rejected. A scanner has been developed to detect this pattern before anything loads, and it is designed to flag the pattern (JAC001, JAC002, and JAC003) in config files, exiting with a non-zero status if the issue is found. It is important to note that this scanner is not a zero-day and only flags the pattern, leaving the final decision to the user. The recommended solution is to upgrade both PyTorch Lightning and jsonargparse to their respective fixed versions.",
  "summary": "Safetensors solved the \"the weights file runs code\" problem. But a model ships with more than weights — it ships a config . And on the PyTorch-Lightning stack, two keys in that config could, until recently, pick which Python class gets imported and called when a checkpoint loads. This post is a plain walk through CVE-2026-58659 , why weights_only=True did not stop it, and a small, free static…",
  "key_points": [
    "CVE-2026-58659 vulnerability allows arbitrary code execution during PyTorch Lightning model loading",
    "instantiator config key manipulated to trigger import-and-call bypassing weightsonly=True",
    "Fixed in PyTorch Lightning 2.6.6 and jsonargparse 5.0.0"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}