• News/
  • darkreading-20260512140000

Hugging Face Packages Weaponized With a Single File Tweak

Dark Reading
·
Alexander Culafi
·
Published May 12, 2026
·
Updated

Hugging Face, an open source store for AI models and components, is open to an attack via the "tokenizer" layer that AI models use to make their outputs human readable. A cyberattacker could use the threat vector to implement a man-in-the-middle (MitM) approach where a .json file is used to intercept tool call arguments to redirect URL tokens through attacker infrastructure; this gives the threat actor "visibility into every URL the model accesses, API parameters, and any credentials embedded in those requests," HiddenLayer security researcher Divyanshu Divyanshu explained in a blog post released today. Hidden Layer tested its attack on Hugging Face models run locally using the SafeTensors, ONNX, and GGUF formats. SafeTensors is a model created by Hugging Face and is considered the de facto model standard for the platform; all three are supported by Hugging Face, and all three are popular for a variety of use cases. That said, this is a problem that could impact any platform used for running open source models like LlamaCPP and Ollama. It also only affects models run locally, as the attack relies on modifying local files. As such, models run through Hugging Face's Inference API, for example, are not impacted. Hugging Face did not respond to a request for comment. A tokenizer is a kind of translator between human language and computer language for AI models. A model's output starts as a sequence of integer IDs that is then decoded through the tokenizer before the output reache...

Read full article

Affected Software

3 affected components
Hugging Face tokenizer.json
Hugging Face SafeTensors
Hugging Face models (local)
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the main topic of this article?

The article discusses a security vulnerability in Hugging Face packages that can be weaponized through a small file modification.

2

What security implications are discussed?

The vulnerability allows cyberattackers to execute a man-in-the-middle attack via the tokenizer layer of AI models.

3

What products or software are affected?

The affected software includes Hugging Face's tokenizer.json, SafeTensors, and local models.

4

Who is the vendor related to the affected software?

The vendor related to the affected software is Hugging Face.

5

How could attackers exploit this vulnerability?

Attackers could exploit this vulnerability by tampering with the tokenizer layer, compromising the integrity of AI model outputs.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203