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...
Hugging Face Packages Weaponized With a Single File Tweak
Dark Reading
·Alexander Culafi
·Published May 12, 2026
·Updated
Affected Software
3 affected components
Hugging Face tokenizer.json
Hugging Face SafeTensors
Hugging Face models (local)
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.