Skip to content

Scan baseline: re-review the seven unsloth-zoo sites 2026.11.4 moved - #17421

Merged
danielhanchen merged 1 commit into
mainfrom
scan-baseline-zoo-2026-11-4
Nov 10, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
scan-baseline-zoo-2026-11-4

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

pip scan-packages :: hf-stack fails on main since unsloth-zoo 2026.11.4 reached PyPI (run 42852360538, on the #17385 merge commit):

Summary: 2 CRITICAL, 5 HIGH, 173 MEDIUM
  7 of the 180 finding(s) above are at a site already reviewed in scripts/scan_packages_baseline.json. What differs from the reviewed entry:
    HIGH      unsloth-zoo  unsloth_zoo/compiler.py                     same matched code, file digest outside the pin
    HIGH      unsloth-zoo  unsloth_zoo/mlx/decision.py                 same matched code, file digest outside the pin
    HIGH      unsloth-zoo  unsloth_zoo/saving_utils.py                 1 matched line(s) gone, none added
    HIGH      unsloth-zoo  unsloth_zoo/temporary_patches/moe_utils.py  same matched code, file digest outside the pin
    CRITICAL  unsloth-zoo  unsloth_zoo/vision_utils.py (env + network) same matched code, file digest outside the pin
    CRITICAL  unsloth-zoo  unsloth_zoo/vision_utils.py (IMDS + network) same matched code, file digest outside the pin
    HIGH      unsloth-zoo  unsloth_zoo/vllm_utils.py                   same matched code, file digest outside the pin

This is the per-release re-review the digest pins are for, as in #16922 (2026.11.3), #16732 (2026.11.2) and #16624 (2026.11.1).

Review

I read the six files in the 2026.11.3 and 2026.11.4 wheels downloaded from PyPI.

  • Six of the seven new entries have the same evidence_hash as an already reviewed entry: the matched code is unchanged and only the file digest moved.
  • In saving_utils.py one of the two __import__("transformers", fromlist = [model_class_name]) lines is gone and nothing was added. Its entry was unpinned before and stays unpinned.
  • None of the changed lines add exec, eval, compile, marshal, zlib, __import__, environment reads, HTTP or socket calls, or the metadata address.
File What changed in 2026.11.4 Verdict
unsloth_zoo/compiler.py MHC projection rewrites become a tuple of (old, new) pairs instead of one source and replacement benign
unsloth_zoo/mlx/decision.py decision loads install the MLX model_file guard, so a repository config.json cannot run code benign, hardening
unsloth_zoo/saving_utils.py safetensors header reads reuse the mapped header, and previous export shards are snapshotted and kept; one duplicate __import__ removed. The "metadata" here is safetensors header metadata, not IMDS benign
unsloth_zoo/temporary_patches/moe_utils.py MoE backward pads the stored expert rows instead of the transposed view benign
unsloth_zoo/vision_utils.py data URI parsing accepts any parameter that prefixes base64, as FFmpeg does benign
unsloth_zoo/vllm_utils.py vLLM spawn and FlashInfer fallbacks pop VLLM_USE_FLASHINFER_SAMPLER / VLLM_USE_V2_MODEL_RUNNER and reword the standby hints benign

Change

scripts/scan_packages_baseline.json gains the seven entries for the 2026.11.4 files. Each one sits next to the entry it re-reviews. No entry is removed or widened, so 2026.11.3 installs still match their own pins.

Testing

  • scripts/scan_packages.py -r on unsloth-zoo==2026.11.4: exits 1 against main's baseline (2 CRITICAL, 5 HIGH) and 0 with this one (24 suppressed, 13 MEDIUM).
  • The baseline tests (git grep -l scan_packages_baseline -- tests): 218 passed.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-10T16:48:59.120568Z 29be73b Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 29be73b54d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen
danielhanchen merged commit a79e6d5 into main Nov 10, 2026
@danielhanchen
danielhanchen deleted the scan-baseline-zoo-2026-11-4 branch November 10, 2026 16:54
danielhanchen added a commit that referenced this pull request Nov 14, 2026
## Problem

`pip scan-packages :: studio` (Security audit) has failed since
fastmcp-slim 4.2.0 reached PyPI on 2026-11-13, on staging runs for
unrelated PRs (#17069, #17763):

```
CRITICAL  fastmcp-slim  fastmcp/cli/apps_dev.py  (Creates archive with sensitive data AND makes network calls)
Summary: 1 CRITICAL, 256 MEDIUM
```

`fastmcp>=4.1.5,<5` in `studio/backend/requirements/studio.txt` now
resolves 4.2.0, which pins `fastmcp-slim==4.2.0`. The site was reviewed
for 4.1.x, but 4.2.0 rewrote the matched code, so the evidence hash no
longer matches and the reviewed entry reopens. This is the same kind of
per-release re-review as #17421.

## Review

I diffed `fastmcp/cli/apps_dev.py` in the 4.1.8 and 4.2.0 wheels from
PyPI (64 diff lines):

| Change | Verdict |
|---|---|
| New `_local_http_client()` returning `httpx2.AsyncClient(timeout=...,
trust_env=False)`, passed to `streamable_http_client` for the dev
server's own MCP URL, so a proxy in the environment is not used for
localhost | benign |
| New `_npm_tarball_url(version)`: the ext-apps tarball URL honours
`npm_config_registry` / `NPM_CONFIG_REGISTRY`, defaulting to
`https://registry.npmjs.org` | benign, matches npm's own behaviour |
| `tarfile.open(fileobj=io.BytesIO(data), mode="r:gz")` and the
remaining `httpx2` / `socket` calls | unchanged |

No `exec`, `eval`, `compile`, `marshal`, credential paths or metadata
endpoints were added.

## Fix

Add the 4.2.0 evidence hash (`0a6a8112...`) as a new entry next to the
two reviewed `apps_dev.py` entries. The other 4.2.0 finding (`jwt.py`,
HIGH) already matches a reviewed entry. Nothing else in
`scripts/scan_packages_baseline.json` changes.

## Tests

- `python scripts/scan_packages.py fastmcp-slim==4.2.0`: exit 0 with
this baseline, exit 1 with main's.
- Tests that read `scripts/scan_packages_baseline.json`: 218 passed.
danielhanchen added a commit that referenced this pull request Nov 16, 2026
…17999)

## Summary

`pip scan-packages :: hf-stack` fails on main since unsloth-zoo
2026.11.5 reached PyPI (for example run 43918369724 on a push to main,
and on #17903):

```
9 of the 184 finding(s) above are at a site already reviewed in scripts/scan_packages_baseline.json. What differs from the reviewed entry:
  HIGH      unsloth_zoo/compiler.py                            same matched code, file digest outside the pin
  CRITICAL  unsloth_zoo/llama_cpp.py (env + network)           1 matched line(s) added and 1 gone: the flagged code was rewritten
  CRITICAL  unsloth_zoo/llama_cpp.py (archive + network)       1 matched line(s) added and 1 gone: the flagged code was rewritten
  HIGH      unsloth_zoo/mlx/loader.py                          same matched code, file digest outside the pin
  HIGH      unsloth_zoo/mlx/speculative.py                     3 matched line(s) added and 2 gone: the flagged code was rewritten
  HIGH      unsloth_zoo/temporary_patches/granitemoehybrid.py  same matched code, file digest outside the pin
  HIGH      unsloth_zoo/temporary_patches/moe_utils.py         same matched code, file digest outside the pin
  CRITICAL  unsloth_zoo/vision_utils.py (env + network)        same matched code, file digest outside the pin
  CRITICAL  unsloth_zoo/vision_utils.py (IMDS + network)       same matched code, file digest outside the pin
```

This is the per-release re-review the digest pins exist for, as in
#17421 (2026.11.4).

## Review

I diffed the seven files between the 2026.11.4 and 2026.11.5 wheels
downloaded from PyPI.

- Six of the nine new entries have the same `evidence_hash` as an
already reviewed entry: the matched code is unchanged and only the file
digest moved.
- None of the added lines in the seven files add `exec`, `eval`,
`compile` on code, `marshal`, `zlib`, `__import__`, HTTP or socket
calls, subprocesses, archives or the metadata address. The only new
environment reads are Unsloth's own `UNSLOTH_*` switches.

| File | What changed in 2026.11.5 | Verdict |
|---|---|---|
| `unsloth_zoo/llama_cpp.py` |
`_check_llama_cpp_appended_system_message` moves its existing
`requests.get(llama_cpp_chat_file, timeout = 5)` inside the `try` and
narrows the bare `except`; `add_llama_cpp_system_message` keeps the
message's other fields when it appends. Same URL constant, no new
network call | benign |
| `unsloth_zoo/mlx/speculative.py` | DFlash2 draft tree sizing and round
overhead. The rewritten matched lines are `mx.eval` / `mx.async_eval`
(MLX array evaluation, not Python `eval`); the one `__import__`
(`mlx_vlm.models.{family}.language`) is unchanged | benign |
| `unsloth_zoo/compiler.py` | SDPA `is_causal` symbolic-bool rewrite (a
new `re.compile` pattern), modeling-file unpatch keyed by the resolved
location | benign |
| `unsloth_zoo/vision_utils.py` | video reads fall back to PyAV when
torchvision or `io.read_video` is missing, plus a tensor resize helper |
benign |
| `unsloth_zoo/temporary_patches/moe_utils.py` | grouped GEMM / expert
cache policy, read from `UNSLOTH_MOE_*` switches | benign |
| `unsloth_zoo/temporary_patches/granitemoehybrid.py` | float16 patch
keeps the layer's gradient checkpointing | benign |
| `unsloth_zoo/mlx/loader.py` | MLX auto offload sizes the prefill step
to the working set and caps a requested `prefill_step_size`; the one
`__import__(module_name, fromlist=["_"])` is unchanged | benign |

## Change

Nine entries added to `scripts/scan_packages_baseline.json`, each next
to the reviewed entries of its site, written by `scan_packages.py
--write-baseline` over `unsloth-zoo==2026.11.5` with the current
baseline as the pin source. Pinned sites stay pinned to the new file
digests; the llama.cpp archive site was unpinned before and stays
unpinned. No other entry moves.

## Verification

- `scan_packages.py unsloth-zoo==2026.11.5`: exits 1 with main's
baseline (the nine sites above), exits 0 with this one (24 findings
suppressed, 15 MEDIUM left).
- `tests/security/test_scan_packages.py` and
`tests/studio/install/test_diffusers_pin.py`: 218 passed.
danielhanchen added a commit that referenced this pull request Nov 21, 2026
…the package scan baseline (#18724)

## Summary

`Security audit` / `pip scan-packages :: hf-stack` fails on `main` (push
runs on `755f6a3467`, `fe5340fc99` and `d7dbe6ffc0`) and on every PR
that runs it, for example #16729:

```
Summary: 3 CRITICAL, 4 HIGH, 175 MEDIUM
  7 of the 182 finding(s) above are at a site already reviewed in scripts/scan_packages_baseline.json. What differs from the reviewed entry:
    HIGH      unsloth-zoo  unsloth_zoo/compiler.py                     same matched code, file digest outside the pin
    CRITICAL  unsloth-zoo  unsloth_zoo/device_type.py                  same matched code, file digest outside the pin
    HIGH      unsloth-zoo  unsloth_zoo/mlx/speculative.py              same matched code, file digest outside the pin
    HIGH      unsloth-zoo  unsloth_zoo/temporary_patches/moe_utils.py  same matched code, file digest outside the pin
    CRITICAL  unsloth-zoo  unsloth_zoo/vision_utils.py (env + network) same matched code, file digest outside the pin
    CRITICAL  unsloth-zoo  unsloth_zoo/vision_utils.py (IMDS + network) same matched code, file digest outside the pin
    HIGH      unsloth-zoo  unsloth_zoo/vllm_utils.py                   same matched code, file digest outside the pin
```

## Root cause

unsloth-zoo 2026.11.8 was published on 2026-11-20 at 19:39 UTC. The
scanner pins each reviewed site to the file digest it was reviewed at,
so a new zoo release reopens its sites until they are re-reviewed. This
is by design and matches the earlier re-pins (#18551, #17999, #17421).

## Re-review

All seven sites have the same evidence hash as an already reviewed
entry, so the matched code is unchanged:

- `device_type.py`, `vision_utils.py` (both checks),
`temporary_patches/moe_utils.py`: evidence text is byte-identical to the
reviewed entry.
- `compiler.py`, `vllm_utils.py`, `mlx/speculative.py`: evidence text is
identical except for line numbers, because other code in the file moved.

## Changes

- `scripts/scan_packages_baseline.json`: seven new entries, one per
site, each pinned to the 2026.11.8 file digest and inserted after that
site's previous entries. No existing entry is changed or removed (63
lines added, 0 removed), so no reviewed pin is widened.

## Testing

- `python scripts/scan_packages.py unsloth-zoo==2026.11.8` against the
baseline on `main`: exit 1 with the seven findings above.
- The same scan against this branch's baseline: exit 0 (`Summary: 15
MEDIUM`, 23 findings suppressed by baseline).
- `tests/security/test_scan_packages.py`: 152 passed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant