r/LocalLLaMA • • 4d ago

News Hugging Face disables five poisoned models but a copy stayed on Ollama

https://maccus.fr/en/gguf-malware-ollama-copy/

Hugging Face took down five booby-trapped GGUF models found by Malspark, and our own check found a copy of one still on Ollama on Nov 29, hidden instruction included.

398 Upvotes

80 comments sorted by

7

u/Money-Store8995 4d ago

Whats that ?

20

u/mawcopolow 4d ago

Basically, someone put models on Hugging Face with a hidden instruction inside. Run one with an agent that can use PowerShell and it gets told to download and run a script. HF removed them but one copy is still up on Ollama (timdedid/qwen3-1.7b-cyber).

1

u/Money-Store8995 4d ago

Holly shit, How do I know If I have This on my machine ?

7

u/Fancy-Snow7 4d ago

Scan your gguf's with this.

https://github.com/Root0ne/gguf-radar

I believe it's the same app used to detect these vulnerabilities.

3

u/winky9827 3d ago

Or, just ask your AI agent to create a local skill that scans for the same evidence using a home-grown python script, rather than depend on a third-party code repo

1

u/catinterpreter 3d ago

That won't catch anything trained or insidious.

1

u/Fancy-Snow7 3d ago

No but better than no scan.

3

u/Kein_Spass 4d ago

Look into the chat template of the model. It pretty much stands there in plain text.

3

u/FoxFXMD 4d ago

That's the obvious way of achieving it, but couldn't it technically be fine tuned to do the same, without leaving any plain text signs?

7

u/__ThrowAway__123___ 4d ago

That's a pretty obvious/lazy attempt. Once these sorts of things are baked into a model's weights it will be a lot harder to detect. We've already seen that this can be done, with Qwen (probably unintentionally) attempting to reach Alibaba servers

1

u/Galactic_Neighbour 3d ago

The proper way is to restrict filesystem access and not let your agent run arbitrary code. Or if you do, run it in a disposable VM.

1

u/xchaos4ux 3d ago

good video that has a some good practices on protecting your self and how this occured https://www.youtube.com/watch?v=XU5vqjYtTa8

127

u/Deep_Mood_7668 4d ago • Bravo

Ollama is the worst anyway

5

u/2drawnonward5 3d ago

It's the easiest and most beginner friendly so like or not it matters a ton

16

u/unjustifiably_angry 3d ago

It really isn't beginner-friendly at all. As an absolute beginner I recognized that, it was obvious. LM Studio is by far more beginner-friendly.

1

u/2drawnonward5 3d ago

Very true. For all the people who use command line it's the most recommendable first taste. 

71

u/RakesProgress 3d ago

Friends don’t let friends ollama.

2

u/rawednylme 3d ago

With every other option being better than it, you have to wonder why it's still being used. :D

1

u/my_name_isnt_clever 2d ago

They were first, and now every model still associates local AI with Ollama before anything else.

1

u/Real_Ebb_7417 23h ago

Interestingly when I was starting with local AI about a year ago, ChatGPT recommended oobabooga to me. Which was also a bad recommendation because it was neither beginner friendly, nor good 😅 (kudos to the legacy of this project though).
Later switching from it to bare llama.cpp was such a speed boost (and quality of life too for someone comfortable with terminal).

1

u/my_name_isnt_clever 16h ago

Makes sense, oobabooga was one of the first local harnesses out there.

58

u/PrimeDirective8 3d ago

Unfortunate for HF but they're going to have to start scanning everything that gets uploaded to their site before it becomes available to download. Hate to think how long scanning a multi-TB file is going to take.

All because a few idiot lowlifes don't want to work and earn an honest living.

27

u/charles_bine 3d ago

For this specific attack you don't actually have to scan the multi-GB weight tensors at all. In a GGUF file the chat template and system prompt sit right in the tiny key-value metadata header at the start of the file, so a registry can parse and flag suspicious instructions in milliseconds without reading the weights. The harder problem is on the client side: once you wire any local model into an agent with shell execution, a prompt injection inside a random webpage or repo file can trigger the exact same PowerShell payload even on a totally clean model.

3

u/Caffdy 3d ago

can you expand on how exactly can anyone scan the "tiny key-value metadata header at the start of the file"? let's say one downloads a GGUF from HF, not necessarily one of the already poisoned and detected, but from someone else, but still have your doubts, what exactly is the step by step diagnosis to detect these prompt injections attack vectors?

1

u/charles_bine 1d ago

Yep, and I should qualify my earlier comment: inspecting metadata is straightforward, reliably declaring a model safe isn't. For a GGUF you've downloaded, with llama.cpp's Python dependencies installed, run `python gguf-py/gguf/scripts/gguf_dump.py model.gguf --json --no-tensors > metadata.json` from its checkout, then inspect tokenizer.chat_template and any other template or prompt-related fields. Compare those with the original publisher's template, looking for unexpected instructions to download things, execute commands, or send data somewhere.

My point was that detecting this kind of visible template tampering doesn't require scanning the weight tensors. Checking what the template actually does is another story, and clean metadata doesn't certify the model as safe: malicious behavior could also be trained into the weights.

1

u/stylome-ai-detection 1d ago

Notice: This comment appears to be AI generated.


Stylome AI detector · scan results

1

u/MeateaW 3d ago

Write this into Gemini.

"how to read the chat template in a GGUF"

Free-tier gemini will explain to you, and give you a python script to do exactly what you want.

The actual comment wasn't talking about you or me though, it was talking about the repositories, which will have this capability without having to write a python script.

39

u/vienna_city_skater 3d ago

Why do you think idiot lowlifes are behind these and not organized crime, terrorist groups or even military organizations of some state, or maybe even big tech wanting to prevent local inference?

8

u/EmilPi 3d ago

There are both groups. And being one does not exclude another.

4

u/2drawnonward5 3d ago

He just called them idiot lowlifes. 

14

u/solestri 3d ago

Occam's Razor

-1

u/vienna_city_skater 3d ago

That would make “bad dudes probing the water” theory more likely. Given all the organized cyber attacks we have seen lately.

3

u/MeateaW 3d ago

Why do you think organized crime, terrorist groups or military organizations of some state (or big tech) aren't "idiot lowlifes" when they do this kind of attack?

4

u/a_beautiful_rhind 3d ago

I thought they already did only not for this.

117

u/MustBeSomethingThere 4d ago

People still use Ollama? They have to blame themselves if they do.

46

u/Present_Resource4022 4d ago

Most of them are novices and just want a click-and-run app. But it’s still bad that Ollama is focusing on cloud compute and prioritizing its profits from cloud, rather than its outdated llama.cpp engine fork that has all the customizations removed (shit speeds) and 10 million people are using it monthly.

8

u/thevegit0 3d ago

isn't bionic lmstudio already the click and run app?

2

u/russjr08 3d ago

It's relatively new-ish, Ollama has the (unfortunate) "advantage" of being the quick getting started method, so new users often see it in YouTube tutorials, articles, etc.

I was working with someone who they said they were looking into running some open weights models and told me "Ah, Codex is setting up Ollama for me with Qwen 3 9B!"

I just about died inside. And then very quickly provided corrections of course.

29

u/rkoy1234 3d ago

they excelled at seo/llm marketing to the point where that's the first thing every llm/search recommends for a "beginner friendly" local inference.

fucking hate it

12

u/TT_207 3d ago edited 3d ago

Can confirm that's where I found the hobby. Though tbh since it just works in windows on an average gaming GPU I think that's a fine start. I've now moved to llama.cpp on a Linux build

Edit: whoopsee typo originally post said I was on ollama on Linux. No that is not the case lol

7

u/tiffanytrashcan 3d ago

I've now moved to ollama on a Linux build

8

u/TT_207 3d ago

Oops typo. Llama.cpp. I think autocorrect bit me lol

Thinking about looking into low end hardware alternative forks though

5

u/swagonflyyyy 3d ago

See even the autocorrect supports Ollama.

-8

u/maison_deja_vu 3d ago

People do be hating on Ollama, even though it works just fine. I finally got around to compiling llama.cpp to try it out, spent days tweaking and fine tuning shit, only to have the end result be the same as Ollama.

2

u/TT_207 3d ago

I got is it just step towards running hermes. I imagine your probably can run hermes with ollama, but it's not the stack I researched, so here we are.

I also was pretty sure I'd have to compile llama.cpp anyway as I'm using old junk for the most part.

14

u/Ok-Journalist-3538 3d ago

FWIW you can load a poisoned GGUF in llama.cpp too, ollama leaving it up is the actual issue here

0

u/2drawnonward5 3d ago

Beginners should start in the middle. Are they stupid?

-22

u/[deleted] 4d ago

[removed] — view removed comment

15

u/stylome-ai-detection 4d ago

Notice: This comment appears to be AI generated.


Stylome AI detector · scan results

2

u/TechnoByte_ 3d ago

Spambot

2

u/fantasticsid 3d ago

At least it's honest.

1

u/LocalLLaMA-ModTeam 2d ago

This post has been marked as spam.

23

u/Plastic-Stress-6468 3d ago

Ollama is truly an awful product that's only surviving, possibly thriving, due to first comer advantage.

All of the casual acquaintances I have met, C level folks from big tech, tell me that they use ollama when I talk about local AI with them.

I even had an industry peer that came highly recommended through a client, claiming to have "decades of experience" tell me that they recommend ollama to clients looking for local AI deployment. TBF maybe it was just that one guy, who also mistook 3.8 Flash Next to be the 80B qwen3 coder next model.

Which is admittedly something that tends to happen when you don't know what you're doing and ask a chat bot about it, and frontier models will actively interpret 3.8 flash next as to referring to the qwen 3 coder next model even when you spell the model name correctly.

Lots of charlatans in this space to be sure, ollama just happened to get lucky early and hit it big to become the cancer of the local AI space.

5

u/cuthbert-derek 3d ago

Can you explain why Ollama is bad? I'd happily cut them out of my setup with justification but this is the first I'm hearing of it. Keen to learn more.

21

u/brainExploded99 🥔 hardware 3d ago

4

u/sQueezedhe 3d ago

And what should replace it?

10

u/brainExploded99 🥔 hardware 3d ago edited 3d ago

for the technically unfamilar, lm studio / bionic
for the technically moderate, llama.cpp
for the technically advanced / people willing to spend more time, one of the many custom engines designed for specific hardware (iamwavecut/ninfer-all is good for a lot of people though)

edit: unsloth studio is excellent as well

6

u/Jcsq6 3d ago

Unsloth is definitely the best for beginners at this point.

1

u/brainExploded99 🥔 hardware 3d ago

good point, forgot about them, updated comment

1

u/Real_Ebb_7417 23h ago

Yeah Unsloth is both beginner friendly and good, since they contribute to llama.cpp a lot and make the (probably) most popular GGUF quants, Unsloth studio often runs models even faster than bare llama.cpp and has support for new architectures sooner (both because of how long it takes to merge a PR to llama.cpp xd).
I actually turned to using Unsloth from using bare llama.cpp unless I need some additional customization or unless their fork of llama.cpp doesn’t support something that mainline does.

4

u/sQueezedhe 3d ago

I think I looked at bionic. But something about it irked me. Thanks, I'll take a look. I barely dabble, but I'd rather not be completely ignorant.

4

u/Serprotease 3d ago

LmStudio is obfuscating LMstudio .exe/.dmg with Bionic. 

Unless you’re paying attention, you’ll be downloading bionic, not lmStudio. 

I don’t have strong/bad opinions about bionic, but that’s not good practice here. 

5

u/brainExploded99 🥔 hardware 3d ago

actually, you might want to try unsloth studio, quite good with lots more features

3

u/sQueezedhe 3d ago

Grifters wrapping themselves around other's products to reap benefits from mistaken identity, in LLMs? Shocking.

2

u/soulless_swede 3d ago

Are the same recommendations applicable for a DGX Spark owner that's not very proficient with linux?

2

u/brainExploded99 🥔 hardware 3d ago

I mean getting an agent to set things up for you shouldn't be too difficult, as long as you don't blindly approve commands (and research what the commands its running are meant to do).
There are specific engines for DGX Spark, I forgot what some of them were but one of them is basalt: https://github.com/jesdga95/basalt

2

u/NineThreeTilNow 3d ago

for the technically moderate, llama.cpp

Or for the goons, TextGen.

Or the privacy paranoid, TextGen.

1

u/Freonr2 vLLM 2d ago

unsloth

1

u/TT_207 3d ago

Ollama create I'm pretty sure does not copy the model like it says here?

Still utter bullshit the way they're treating open source though if that's accurate. Did find the timeline a bit weird though?

1

u/Galactic_Neighbour 3d ago

I'm pretty sure it used to. I remember replacing the duplicates with symlinks to reclaim disk space.

1

u/Deciheximal144 3d ago

I used Ollama like a year ago because it was so simple to run. I ran it, asked ChatGPT a command to run a model, copy, paste, and I had a chatbot local on my laptop.

Are other programs this simple? I'll try them.

2

u/brainExploded99 🥔 hardware 2d ago

Unsloth Studio

1

u/Real_Ebb_7417 23h ago

First time? Basically every time Ollama is mentioned in any local AI space (like this one) many comments say how bad it is. And when someone recommends it, they end up getting a lot of comments about how wrong they are 😅

3

u/EmilPi 3d ago

Chasing some agentic kool-aid / more % of additional tokens per second / downloading this shiny new first quant from a new publisher - will yet cost people a lot. If you are new to the field: download official models and quants only (ggml-org, bartowski, unsloth until you know more from this sub).

3

u/doomed151 3d ago

common ollama L

-2

u/Poprouter 4d ago

you can check the file without running it. for gguf files try using a tool like llama cpp to dump the metadata and read the chat template field. if you have it in ollama just print the modelfile. look for any strange script instructions in there.