Unofficial Hacker News companion — get notified on comment replies, and more.

GGUF LLM Models with Hidden Malware on Hugging Face Reached 2400 Victims (opens external site)

323 points by homarp 3 days ago | malspark.com | 99 comments on HN | Vote on HN (opens Hacker News) |

View full thread · View on Hacker News

Comment thread (5)

  1. 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.

    Replies (2)
    1. Thank you for that.

      Having the jinja being able to uncompress and run an .exe embedded in it is the problem.

      Replies (1)
      1. Think there's some confusion about how this works. The template can't decompress or run the binary.
    2. Here's a quote from the article:

      > The attacks found in this study do not need to escape that engine. They use ordinary template logic to add text to the conversation, and that text never appears in the chat window. In the timdedid models, a trigger phrase in the user's message makes the template insert a fake [SYSTEM DIRECTIVE] that orders an agent with shell access to download and run a script. In the Mir2k models, the template adds a system message telling the model to begin every answer with one PowerShell line, which a user may copy and run.

      The way I read is that the initial attack vector is adding PowerShell commands into the response. Which user "may copy and run" (why???)

      (EDIT clarification: these PowerShell commands copy part of the GGUF that's been loaded into an EXE file, as that part of GGUF actually has an executable code, starting from MZ and everything. That EXE then gets executed and proceeds to do whatever shady stuff it's supposed to do).

      I would expect this attack to work when the model is used to run AI Agent so that the inserted command gets executed (probably). So even though the change affects the output of the inference engine, no actions are taken by the inference engine itself; it should be either user or agent.

      Replies (1)
      1. > I would expect this attack to work when the model is used to run AI Agent so that the inserted command gets executed (probably). So even though the change affects the output of the inference engine, no actions are taken by the inference engine itself; it should be either user or agent.

        This same methodology can be used to attack via renderer without any exec type tools available at all.