CVE-2026-31218: n/a
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 loading a model state dictionary from a state_dict.pt file via torch.load(), the function does not enable 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 state_dict.pt file within a directory specified via the --model argument, leading to arbitrary code execution during the deserialization process on the victim's system.
AI Analysis
Technical Summary
CVE-2026-31218 describes an insecure deserialization vulnerability in the _load_model() function of the optimate project. The function loads a model state dictionary from a state_dict.pt file using torch.load() but does not enable the weights_only=True parameter, which is intended to restrict deserialization to tensor weights only. Because torch.load() uses Python's Pickle module internally, this omission allows an attacker to craft a malicious state_dict.pt file that can execute arbitrary Python code during deserialization. The attack vector involves specifying a directory containing the malicious file via the --model argument, leading to code execution on the victim's system.
Potential Impact
Successful exploitation results in arbitrary code execution on the victim's system during model loading. This can lead to full system compromise depending on the privileges of the process running the script. There are no known exploits in the wild at this time.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until a fix is available, users should avoid loading untrusted or unauthenticated state_dict.pt files. Applying the weights_only=True parameter in torch.load() calls is recommended to mitigate this vulnerability once a patch or update is released.
CVE-2026-31218: n/a
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 loading a model state dictionary from a state_dict.pt file via torch.load(), the function does not enable 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 state_dict.pt file within a directory specified via the --model argument, leading to arbitrary code execution during the deserialization process on the victim's system.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
CVE-2026-31218 describes an insecure deserialization vulnerability in the _load_model() function of the optimate project. The function loads a model state dictionary from a state_dict.pt file using torch.load() but does not enable the weights_only=True parameter, which is intended to restrict deserialization to tensor weights only. Because torch.load() uses Python's Pickle module internally, this omission allows an attacker to craft a malicious state_dict.pt file that can execute arbitrary Python code during deserialization. The attack vector involves specifying a directory containing the malicious file via the --model argument, leading to code execution on the victim's system.
Potential Impact
Successful exploitation results in arbitrary code execution on the victim's system during model loading. This can lead to full system compromise depending on the privileges of the process running the script. There are no known exploits in the wild at this time.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until a fix is available, users should avoid loading untrusted or unauthenticated state_dict.pt files. Applying the weights_only=True parameter in torch.load() calls is recommended to mitigate this vulnerability once a patch or update is released.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- mitre
- Date Reserved
- 2026-03-09T00:00:00.000Z
- Cvss Version
- null
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a034c84cbff5d8610fe99da
Added to database: 5/12/2026, 3:51:32 PM
Last enriched: 5/12/2026, 4:08:11 PM
Last updated: 5/13/2026, 4:57:57 AM
Views: 3
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.