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.
Published: 2026-05-12
Score: n/a
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

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. No EPSS or CVSS metrics are provided, but the absence of defensive measures suggests a base score in the 9‑10 range. 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.

Generated by OpenCVE AI on May 12, 2026 at 17:46 UTC.

Remediation

No vendor fix or workaround currently provided.

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 12, 2026 at 17:46 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Tue, 12 May 2026 18:15:00 +0000

Type Values Removed Values Added
Title Insecure Deserialization in Optimate Allows Arbitrary Code Execution
Weaknesses CWE-502

Tue, 12 May 2026 16:00:00 +0000

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

Subscriptions

No data.

cve-icon MITRE

Status: PUBLISHED

Assigner: mitre

Published:

Updated: 2026-05-12T15:08:04.913Z

Reserved: 2026-03-09T00:00:00.000Z

Link: CVE-2026-31219

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-05-12T16:16:13.813

Modified: 2026-05-12T16:16:13.813

Link: CVE-2026-31219

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-05-12T18:00:12Z

Weaknesses