Horizon Alert
Summary of the vulnerability and why it matters
A vulnerability in the ml-engineering project's `torch-checkpoint-shrink.py` script allows for arbitrary code execution when processing PyTorch checkpoint files. This occurs because the script deserializes untrusted data from these files without proper security controls, potentially enabling an attacker to run malicious code on the system.
- Remote attackers can exploit this.
- Leads to arbitrary code execution.
- Affects users processing checkpoint files.
Attack Path
How an attacker could exploit the issue
An attacker can exploit this vulnerability by crafting a malicious PyTorch checkpoint file. When a user or an automated system loads this file using the vulnerable `torch.load()` function without security restrictions, arbitrary code can be executed on the system. This could lead to a full compromise of the machine processing the checkpoint.
- Requires attacker-controlled file.
- Targets script loading checkpoint files.
- No authentication needed.
Live Threat
Current exploitation, exposure, and threat context
Attackers are less likely to weaponize this deserialization vulnerability because it affects a specific utility script for handling ML model checkpoints. Exploitation requires an attacker to first trick a victim into executing the script with a crafted checkpoint file, rather than targeting a directly accessible service.
- Affects internal utility script.
- Requires user interaction.
- Not a common attack vector.
Priority actions
Operational Fix
Recommended remediation, mitigation, and detection steps
Prioritize isolating services that process untrusted PyTorch checkpoint files using `torch.load` without `weights_only=True`. Given the critical severity and potential for arbitrary code execution, immediate containment is crucial if affected scripts are exposed to external input.
- Inspect code for `torch.load` without `weights_only=True`.
- Isolate or disable affected checkpoint processing scripts.
- Monitor execution environments for suspicious activity.