Hugging Face Transformers Flaw Let Malicious Models Bypass `trust_remote_code`
A critical remote code execution flaw in Hugging Face's transformers library allowed attacker-controlled model repositories to run arbitrary code during the standard from_pretrained() loading process, even when trust_remote_code=False was set. The issue was tied to unsafe handling of untrusted model configuration data, including nested configuration resolution in the LightGlue loading path, where values from config.json could override the intended safety setting and trigger execution of attacker-supplied Python modules during model initialization.
Reports said the vulnerability affected transformers versions 4.56.0 through 5.2.x in environments where the kernels package was installed, with version 5.2.0 specifically cited in LightGlue-related exploitation scenarios. Exposed targets included inference servers, research notebooks, CI/CD pipelines, and automated model evaluation systems, where successful compromise could enable theft of cloud credentials, API keys, SSH keys, proprietary datasets, lateral movement, persistence, and backdoor deployment. Hugging Face released a fix in transformers 5.3.0 and urged organizations to upgrade and treat model loading as a code execution surface.

Get ahead of threats like this
Mallory correlates global threat intelligence with your attack surface — know if you’re exposed before adversaries strike.
How this story unfolded
2 events from the most recent confirmed update back to the earliest known activity.
Hugging Face releases Transformers 5.3.0 to fix the flaw
Hugging Face released a fix for the vulnerability in Transformers version 5.3.0 and urged organizations to upgrade immediately. The advisory also warned users to treat model loading as a code execution surface.
Hugging Face discloses Transformers RCE vulnerability
A critical remote code execution flaw in Hugging Face Transformers was disclosed, showing that attacker-controlled model configuration data could bypass the intended protection of setting trust_remote_code=False during model loading. The issue was reported as affecting model-loading workflows and enabling arbitrary code execution from malicious model repositories.
Related entities
Vulnerabilities, threat actors, malware, products, organizations, and breaches Mallory has linked to this story.
Sources
4 references tracked. Mallory keeps watching after this page renders.
Critical Hugging Face Transformers Vulnerability Enables Remote Code Execution Attacks
cybersecuritynews.com
Open sourceCritical vulnerability in Hugging Face Transformers library allowed arbitrary code execution | brief | SC Media
scworld.com
Open sourceHugging Face Transformers RCE flaw enables stealthy compromise via AI model configs | CSO Online
csoonline.com
Open sourceCVE-2026-5241 - Policy Bypass in LightGlue Nested Config Resolution in huggingface/transformers
cvefeed.io
Open sourceSee the full picture, correlated to your attack surface.
Map indicators from this story to your assets and identify affected systems in minutes.
Every observed campaign, victim, and pivot linked to actors named in this story.
Malware, exploits, and IOCs connected to the activity described here.
YARA, Sigma, and Snort rules deployed to your SIEM as soon as they’re published.
Get matching new stories delivered to your team as they break — not the next morning.
Ask questions about this story and take action on the answers.


