Repository navigation
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-templatecommand 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 reportsIDENTICAL,OLDERorDIFFERENT, prints a diff and the findings of the template check for both sides, and exits with 0, 2 or 1.OLDERmeans 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.pyscans 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 notCLEAN. TheClean modelsworkflow runs it every week and in pull requests that changesrc/. 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 -oandwget -O, and text that is piped into a shell or a script interpreter, now giveMALICIOUS. Before, several of these forms gave onlySUSPICIOUSbecause of the web address, and a command withouthttp://could pass asCLEAN. scanchecks 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,sanitizeandcompare-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-filesofscanhas no limit by default. When a limit leaves files out, the output and the JSON report list them, and the repository is reported asERRORand not asCLEAN.
Fixed
- A chat template that uses the
generation,breakorcontinuetag is no longer reported asSUSPICIOUSfor a syntax error. These tags belong to the Jinja2 setup of the Transformers library, and real templates use them. The modelggml-org/SmolLM3-3B-GGUFwas affected. Everything inside agenerationtag is still inspected.