Skip to content

gguf-radar 0.1.3

Latest

Choose a tag to compare

@Root0ne Root0ne released this 28 Nov 21:01
4e10c41

This release fixes two security problems in scan, makes the template check recognise templates that download their payload, and adds the compare-template command.

Upgrade with:

pip install --upgrade git+https://github.com/Root0ne/gguf-radar@v0.1.3

Added

  • The compare-template command compares the chat template of a GGUF file or of a Hugging Face repository with the template of the original model, without depending on attack patterns. The original model must be named with --base, because the metadata of a file cannot vouch for itself. It reports IDENTICAL, OLDER or DIFFERENT, prints a diff and the findings of the template check for both sides, and exits with 0, 2 or 1. OLDER means that the template equals an earlier revision of the base. The command reads every GGUF file of a repository, repeats failed requests and writes control characters of the model file in a visible form. Comparing a chat template with the original model describes it.
  • A check against clean public models. scripts/check_clean_models.py scans 19 pinned Hugging Face repositories without a download and 7 pinned GGUF files that it downloads completely, and it fails if any of them is not CLEAN. The Clean models workflow runs it every week and in pull requests that change src/. Contributing describes how to run it.

Security

  • The template check recognises templates that download their payload from another host. Commands such as iwr, irm, certutil -urlcache, bitsadmin /transfer, mshta, curl -o and wget -O, and text that is piped into a shell or a script interpreter, now give MALICIOUS. Before, several of these forms gave only SUSPICIOUS because of the web address, and a command without http:// could pass as CLEAN.
  • scan checks every GGUF file in a Hugging Face repository. Before, it skipped files named like the second or third part of a split model, so a file could be hidden from the scan by its name.
  • Text from model files and repositories is written with control characters in a visible form in the output of scan, sanitize and compare-template. A file name, a template or a metadata value could contain escape sequences that changed what the terminal showed. The JSON reports escape all non-ASCII characters.

Changed

  • --max-files of scan has no limit by default. When a limit leaves files out, the output and the JSON report list them, and the repository is reported as ERROR and not as CLEAN.

Fixed

  • A chat template that uses the generation, break or continue tag is no longer reported as SUSPICIOUS for a syntax error. These tags belong to the Jinja2 setup of the Transformers library, and real templates use them. The model ggml-org/SmolLM3-3B-GGUF was affected. Everything inside a generation tag is still inspected.