Skip to content

Releases

ModelSieve v0.3.0: hidden-tool detection

Choose a tag to compare

@redveil-industry redveil-industry released this 01 Dec 01:00

New check: template.injected_tool. It was suggested in the r/LocalLLM discussion of the top-400 study.

A chat template can't make network calls itself; rendering only produces a string. It can quietly add a tool to the system prompt, or tell the model to call one, and an agentic client that executes tool calls then does the exfiltration for it. ModelSieve now flags:

  • tool definitions hard-coded in the template's own text: JSON function schemas, and type fn = (…) => … signatures, including definitions split across many small string constants (vendor style, or an evader's);
  • instructions to call a specific named tool ("always call send_report(…");
  • HIGH when the hard-coded tool text carries a fixed URL, the exfiltration shape. MEDIUM otherwise, because vendor built-ins match too.

Tools rendered from the caller's own tools list are not flagged.

Measured on the 396 cached repos from the study: 5 findings in 3 unique templates, all MEDIUM, all a documented vendor built-in browser tool (search/open/find). No HIGH in real models.

87 tests; CI and action self-test green.

ModelSieve v0.2.0: GitHub Action, pre-commit hook, SARIF

Choose a tag to compare

@redveil-industry redveil-industry released this 30 Nov 05:59

Integrations: put ModelSieve in front of model files automatically.

GitHub Action

- uses: redveil-industry/modelsieve@v0.2.0
  with:
    path: models/
    fail-on: HIGH
- uses: github/codeql-action/upload-sarif@v4
  if: always()
  with:
    sarif_file: modelsieve.sarif

The action installs ModelSieve from its own checkout (the tag = the scanner version), passes inputs to the shell only as environment variables, and writes a job summary. It is tested on every push by running against a malicious and a benign fixture.

pre-commit

- repo: https://github.com/redveil-industry/modelsieve
  rev: v0.2.0
  hooks:
    - id: modelsieve

Runs only when a commit touches model artifacts or HF/MLX configs.

--sarif FILE

SARIF 2.1.0 output with security-severity for GitHub code scanning. CI validates it against the official OASIS schema.

76 tests; CI green on Python 3.9–3.13.

ModelSieve v0.1.1

Choose a tag to compare

@redveil-industry redveil-industry released this 30 Nov 05:27

False-positive fixes found by scanning the 400 most-downloaded GGUF and MLX repos on Hugging Face (header bytes only).

  • template.ssti_filter_arg: only dunder or name-mangled names (containing __) count as gadgets. Single-underscore dict keys such as '_order' are no longer CRITICAL.
  • Big-endian GGUF (s390x builds) is now reported as gguf.big_endian (LOW, not analysed) instead of CRITICAL gguf.malformed.
  • code.import_injection flags only values that can change the import path (., /, \, whitespace, non-ASCII). A hyphenated model_type only makes the import fail.
  • template.content_trigger lowered to MEDIUM, because vendor reasoning switches (/nothink, detailed thinking on) also match. Single-word identifiers such as ARRAY are treated as type checks.
  • Unknown or fork-local ggml type ids: one aggregated gguf.unknown_type finding per file, and the layout checks are skipped (new gguf.layout_unverified, LOW) instead of raising a false gguf.noncontiguous HIGH.

74 tests; CI green.

ModelSieve v0.1.0

Choose a tag to compare

@redveil-industry redveil-industry released this 30 Nov 04:11

First public release of ModelSieve: a static security scanner for GGUF and Hugging Face / MLX model artifacts. It parses model files and never loads them.

Install

pipx install modelsieve
pipx inject modelsieve numpy   # optional: enables --deep weight checks

What it checks

  • Chat templates (Jinja2 AST, never rendered): SSTI sandbox-escape gadgets (__class__, |attr, str.format references; CVE-2024-34359 / CVE-2024-56326 / CVE-2025-27516 patterns), one-hop {% set %} indirection, trigger-word branches on user content, hard-coded instructions, invisible/bidi/tag-unicode smuggling (decoded), divergent template sources, and baseline diff against an original model.
  • Containers: bounded GGUF and safetensors parsers for OOB offsets, integer-overflow counts, duplicate keys, overlaps, hidden gaps and trailing bytes, and llama.cpp layout differentials.
  • Code paths: pickle imports across protocols 0–5 (never unpickled), auto_map, mlx-lm model_file and import hooks, symlink escapes, tokenizer rewrite rules.
  • Weights (--deep): NaN/Inf, all-zero tensors, sibling-layer outliers, HF cache blob sha256 verification.

Output: text or --json. Exit codes: 0 = clean at threshold, 1 = findings, 2 = scan error. The verdict always lists what was not checked: static scanning cannot prove the absence of trained-in backdoors.

Quality

72 tests; CI on Python 3.10–3.13 (Ubuntu + macOS) and 3.9 (macOS); SHA-pinned Actions; published to PyPI via Trusted Publishing (no stored token).