Optimate Insecure Deserialization Vulnerability in Neural Magic Training Script Allowing Arbitrary Code Execution

Vulnerability

A vulnerability exists in the Optimate project, specifically in the neural_magic_training.py script, within commit a6d302f912b481c94370811af6b11402f51d377f. The issue arises in the _load_model() function, which is susceptible to insecure deserialization. When the function loads a model state dictionary from a state_dict.pt file using torch.load(), it fails to activate the weights_only=True security parameter. This oversight permits the deserialization of arbitrary Python objects via the Pickle module. A remote attacker could exploit this vulnerability by supplying a maliciously crafted state_dict.pt file in a directory specified with the --model argument, leading to arbitrary code execution during the deserialization process on the victim's system.

Impact

Exploitation of this vulnerability allows for arbitrary code execution on the victim's system during the deserialization process.

Added: May 12, 2026, 4:29 PM
Updated: May 12, 2026, 4:29 PM

Vulnerability Rating

Custom Algorithm
spread
0.0
impact
7.5
exploitability
4.3
remediation
0.0
relevance
8.1
threat
3.2
urgency
2.9
incentive
0.0

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.