UPDATED 08:00 EDT / JUNE 04 2026

SECURITY

Critical Hugging Face Transformers flaw ran attacker code on a routine model load

Pluto Security Inc. today disclosed a critical remote code execution vulnerability in Hugging Face Inc.’s Transformers library that allowed attacker-controlled artificial intelligence models to run arbitrary code on a victim’s machine.

The flaw fired through a standard model-loading command, even for organizations that followed Hugging Face’s recommended security guidance. Tracked as CVE-2026-4372, the flaw defeated trust_remote_code=False, the setting organizations toggle off to safely vet models pulled from Hugging Face Hub.

An attacker only had to slip a malicious payload into a model’s configuration file. Loading that model with from_pretrained() ran the code. No warning appeared.

Transformers is one of the most heavily used AI packages anywhere. It has been downloaded more than 2.2 billion times, pulls roughly 146 million downloads a month and carries over 157,000 GitHub stars and Hugging Face Hub hosts more than one million models. Pluto estimates the vulnerable versions alone were downloaded 232 million times in the six months the flaw was live.

The bug reached versions 4.56.0 through 5.2.x on systems with the kernels package installed. It first appeared in 4.56.0, released Aug. 29 and Pluto says every release after that carried it until the patch.

What set the flaw apart was that it required no warnings, prompts or unsafe settings. Earlier attacks on the AI ecosystem typically depended on tricking users into manually running suspicious scripts or loaders. This one could be triggered through a routine download with nothing out of the ordinary on screen.

“Organizations have spent years building policies around the idea that keeping trust_remote_code disabled makes model loading safe,” said Yotam Perkal, director of security research at Pluto Security. “This vulnerability showed that assumption could be broken. A single malicious configuration field could turn a standard model download into a silent system compromise.”

Successful exploitation could let attackers steal cloud credentials, application programming interface keys, SSH keys, Kubernetes configurations, database credentials, source code and proprietary datasets. Enterprise AI platforms, automated model evaluation pipelines and GPU-enabled environments were among the most exposed targets.

Pluto reported the issue to Hugging Face in February. Hugging Face fixed it in Transformers version 5.3.0, released March 4, by blocking attacker-controlled configuration values from reaching the vulnerable code path and requiring explicit user consent before loading untrusted external kernels.

The company recommends upgrading to version 5.3.0 or later immediately, auditing cached model configurations and treating model loading as a code execution surface. The presence of _attn_implementation_internal in any cached or downloaded config.json file is a red flag, according to the firm.

“The AI industry has made downloading models from the internet feel as routine as installing software packages,” said Shahar Bahat, Pluto’s co-founder and chief executive. “As these ecosystems continue to grow, organizations need to recognize that model loading is increasingly a security boundary and treat it accordingly.”

Image: SiliconANGLE/Ideogram

A message from John Furrier, co-founder of SiliconANGLE:

Support our mission to keep content open and free by engaging with theCUBE community. Join theCUBE’s Alumni Trust Network, where technology leaders connect, share intelligence and create opportunities.

  • 15M+ viewers of theCUBE videos, powering conversations across AI, cloud, cybersecurity and more
  • 11.4k+ theCUBE alumni — Connect with more than 11,400 tech and business leaders shaping the future through a unique trusted-based network.

Are you AWS customer?  Support SiliconANGLE Financially by buying your AWS services from our Marketplace portal page and links.  

About SiliconANGLE Media
SiliconANGLE Media is a recognized leader in digital media innovation, uniting breakthrough technology, strategic insights and real-time audience engagement. As the parent company of SiliconANGLE, theCUBE Network, theCUBE Research, CUBE365, theCUBE AI and theCUBE SuperStudios — with flagship locations in Silicon Valley and the New York Stock Exchange — SiliconANGLE Media operates at the intersection of media, technology and AI.

Founded by tech visionaries John Furrier and Dave Vellante, SiliconANGLE Media has built a dynamic ecosystem of industry-leading digital media brands that reach 15+ million elite tech professionals. Our new proprietary theCUBE AI Video Cloud is breaking ground in audience interaction, leveraging theCUBEai.com neural network to help technology companies make data-driven decisions and stay at the forefront of industry conversations.