CVE-2026-31219

Published May 12, 2026 CVSS 3.1 · 8.8 High EPSS < 1% KEV · Not listed
Description
The _load_model() function in the neural_magic_training.py script of the optimate project in commit a6d302f912b481c94370811af6b11402f51d377f (2024-07-21) is vulnerable to insecure deserialization (CWE-502). When a user provides a single model file path (e.g., .pt or .pth) via the --model command-line argument, the function loads the file using torch.load() without enabling the weights_only=True security parameter. This allows the deserialization of arbitrary Python objects through the Pickle module. A remote attacker can exploit this by providing a maliciously crafted model file, leading to arbitrary code execution during deserialization on the victim's system.

Analysis

AI-generated

Technical impact

The load_model function in optimate's neural_magic_training.py dereferences torch.load without the weights_only=True security parameter, enabling deserialization of arbitrary Python objects through the Pickle module. An attacker providing a malicious .pt or .pth file via the --model command-line argument can coerce the program to execute arbitrary code on the victim's machine. This is a classic CWE‑502 insecure deserialization flaw and results in complete compromise of the host running optimate.

Affected Systems

The flaw is present in the optimate project maintained by nebuly‑ai, specifically in commit a6d302f912b481c94370811af6b11402f51d377f dated 2024‑07‑21. Any installation that uses the neural_magic_training.py script and invokes the --model option to load user‑specified model files without specifying weights_only is affected. Earlier builds released before this commit or those that enforce the security parameter are not vulnerable.

Risk and Exploitability

The risk is extremely high, as arbitrary code execution gives an attacker full control over the system that runs optimate. The CVSS score is 8.8, and the EPSS score is less than 1%, indicating a high severity but low probability of exploitation. The vulnerability can be exercised locally by anyone able to run optimate with a crafted model file, meaning that users must be careful with file provenance. The lack of a KEV listing indicates that there are currently no known public exploits, yet the attack surface remains open for any adversary capable of supplying a malicious model.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Update optimate to a release where the load_model function uses torch.load with weights_only=True or a similar safeguard.
  • Verify that the --model argument points only to trusted, validated model files and avoid using it with untrusted or user‑supplied paths.
  • Where possible, run optimate inside a sandbox or container with limited file system access to contain the impact of a potential deserialization attack.

Generated by OpenCVE AI on May 15, 2026 at 15:54 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
First Time appeared Nebuly-ai
Nebuly-ai optimate
Vendors & Products Nebuly-ai
Nebuly-ai optimate
Type Values Removed Values Added
Title Insecure Deserialization in Optimate Allows Arbitrary Code Execution
Type Values Removed Values Added
Metrics cvssV3_1

{'score': 8.8, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H'}

ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
Title Insecure Deserialization in Optimate Allows Arbitrary Code Execution
Weaknesses CWE-502
Type Values Removed Values Added
Description The _load_model() function in the neural_magic_training.py script of the optimate project in commit a6d302f912b481c94370811af6b11402f51d377f (2024-07-21) is vulnerable to insecure deserialization (CWE-502). When a user provides a single model file path (e.g., .pt or .pth) via the --model command-line argument, the function loads the file using torch.load() without enabling the weights_only=True security parameter. This allows the deserialization of arbitrary Python objects through the Pickle module. A remote attacker can exploit this by providing a maliciously crafted model file, leading to arbitrary code execution during deserialization on the victim's system.
References
Weaknesses
  • CWE-502

    Deserialization of Untrusted Data

Sources

Status
PUBLISHED
Assigner
mitre
Published
Updated
May 15, 2026, 2:01 PM
Reserved
Mar 9, 2026, 12:00 AM
Status
Deferred
Published
May 12, 2026, 4:16 PM
Modified
Jun 17, 2026, 10:33 AM