
Pre-trained AI models are now considered part of critical infrastructure across industries, powering copilots, analytics engines, fraud detection systems, and autonomous workflows.
But beneath their convenience lies a rapidly expanding attack surface.
Recent investigations have uncovered a growing number of malicious AI models distributed through public repositories such as Hugging Face and PyPI. What appears to be harmless model weights may in fact contain embedded executable payloads that trigger automatically when the model is loaded, before any inference begins.
This month’s campaign explores how attackers are weaponizing machine learning model files, why the ecosystem is particularly vulnerable, and what defenders must do to secure the AI supply chain.
The root of this risk lies in how many popular ML frameworks serialize models.
Nearly half of the widely used public models still rely on Python’s pickle format. Pickle is not just a data storage format; it implements a stack-based virtual machine capable of executing arbitrary code during deserialization. When a developer runs torch.load() on a downloaded .pth file, that call internally triggers pickle.load(), executing any embedded opcodes automatically.
This collapses the trust boundary between “model data” and executable code.
In practice, this means:
Because model loading is considered routine developer activity, these attacks often evade suspicion.
The AI model ecosystem has exploded in size and adoption. According to the HiddenLayer 2025 AI Threat Landscape Report:
Threat actors have taken notice. Documented campaigns include:
The progression from academic proof-of-concept to active exploitation by advanced threat actors demonstrates a clear and accelerating trajectory.
The attack chain unfolds in four deliberate stages, transforming a seemingly harmless model download into full system compromise:
This campaign breaks down the technical mechanics behind malware hidden in AI models and equips defenders with the insight needed to detect, prevent, and respond to this emerging supply chain threat.
Here’s what you’ll learn:
Access this campaign and several hands-on labs for free and put theory into practice!