This is a fine article, but if there’s truly only 5 out of 3273389 that are malicious that’s an incredibly low number. I’d bet there’s more malicious google ads people click on every day than use these models.
IMO, any system that was exploited by this was already insecure. It's not exploiting bugs in the inference engine or attempting any kind of sandbox escape. Here the exploit was in the chat template, but it's possible to encode the same thing directly in the weights. Unless the model is truly Open Source (not just open weight), there's no way to know what malicious instructions might be encoded in the weights. The only defense is to sandbox the agent sufficiently strongly that it can't do harm no matter what tokens it generates. In such a sandbox, it doesn't matter that the payload was stored directly in the GGUF file, because it won't be able to do anything with it anyway.
Glad I have a stupidly paranoid setup for llama-cpp where I run it in a vm only able to be connected to. not that this is the only possible issues and stuff like malicious models quantized models (IE models that are secretly trained to do something malicious but posed as a simple quantization) is another issue people sleep on. I think securing agents is a nightmare, but those who think about them will be ahead.
Lots of words to just explain this simple thing here.
The GUFF's jinja template can be used to suppress your system prompt conditionally or append or modify it. Binary blobs or malicious code can be packed with the model to be written and executed.
Shenanigans can occur through just markdown output if it can render anything remote. Data exfiltration through uri://domain.tld/collector.ext?query=<all-your-data-in-context-belongs-to-hacker>
Having your inference isolated is great and all, but it's not going to protect you from your model having some side channel to Internet access in this scenario.
llama.cpp (and other tools) should perform a basic metadata sanity check. (It took me two minuted to create a python script for doing this. So it's not hard to do.)
Also, only ever use trusted sources (like unsloth, etc).
This is a fine article, but if there’s truly only 5 out of 3273389 that are malicious that’s an incredibly low number. I’d bet there’s more malicious google ads people click on every day than use these models.
IMO, any system that was exploited by this was already insecure. It's not exploiting bugs in the inference engine or attempting any kind of sandbox escape. Here the exploit was in the chat template, but it's possible to encode the same thing directly in the weights. Unless the model is truly Open Source (not just open weight), there's no way to know what malicious instructions might be encoded in the weights. The only defense is to sandbox the agent sufficiently strongly that it can't do harm no matter what tokens it generates. In such a sandbox, it doesn't matter that the payload was stored directly in the GGUF file, because it won't be able to do anything with it anyway.
Glad I have a stupidly paranoid setup for llama-cpp where I run it in a vm only able to be connected to. not that this is the only possible issues and stuff like malicious models quantized models (IE models that are secretly trained to do something malicious but posed as a simple quantization) is another issue people sleep on. I think securing agents is a nightmare, but those who think about them will be ahead.
Lots of words to just explain this simple thing here.
The GUFF's jinja template can be used to suppress your system prompt conditionally or append or modify it. Binary blobs or malicious code can be packed with the model to be written and executed.
Shenanigans can occur through just markdown output if it can render anything remote. Data exfiltration through uri://domain.tld/collector.ext?query=<all-your-data-in-context-belongs-to-hacker>
Having your inference isolated is great and all, but it's not going to protect you from your model having some side channel to Internet access in this scenario.
llama.cpp (and other tools) should perform a basic metadata sanity check.
(It took me two minuted to create a python script for doing this. So it's not hard to do.)
Also, only ever use trusted sources (like unsloth, etc).
If these files can be scanned, wtf is hugging face not the one scanning them?! Otherwise they’re just blindly hosting malware
nowadays we tend to think files created by LLMs are safe - we still need to be cautious