A vulnerability exists in the handling of chat templates within open-weight Large Language Model (LLM) distribution formats, specifically GGUF files. Chat templates are executable Jinja2 programs stored as metadata (typically tokenizer.chat_template) alongside model weights. An attacker can modify a legitimate model's template to include conditional logic that detects specific trigger phrases in user input. When triggered, the template injects malicious system instructions or context into the…
Source: arXiv