Repository navigation
Baseline the unsloth-zoo 2026.10.6 and transformers 5.20.0 scan findings after review - #13949
Conversation
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b71ecb77cb
ℹ️ 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".
| "evidence": "Obfusc: L140: exec(compile(source, f\"<unsloth gdn replayssm: {cls.__name__}.{name}>\", \"exec\"), namespace, scope)\nExec: L140: exec(compile(source, f\"<unsloth gdn replayssm: {cls.__name__}.{name}>\", \"exec\"), namespace, scope)", | ||
| "evidence_hash": "af9bbd099e27249e8568608b434a0caab1be4b7da651826363c6d83cc5eab5ed" |
There was a problem hiding this comment.
Pin the new source-rewriting exec entry
Add a file_sha256 pin for this new site. Unlike the adjacent re-approved sites, this entry is unpinned, so _load_baseline records None and suppresses the finding regardless of the file digest. A future floating unsloth-zoo release could therefore change _apply_edit, the edit tables, or how source is obtained while retaining this exact exec(compile(source, ...)) line, and the security audit would remain green without reviewing the newly executed code. Pin the reviewed 2026.10.6 file bytes and include this site in the context-dependent pin regression test.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Agreed. The danger in that file is in the edit tables and the source lookup, not the matched exec line, so it is pinned now to the 2026.10.6 file digest (91d58e26). Both context-dependent pin tests include it, and dropping the pin makes both fail. Fixed in 57005f8.
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
## Summary `Security audit` on main fails in `pip scan-packages :: hf-stack` (run 39357543071 on 22a0bea) with 2 CRITICAL and 5 HIGH unbaselined findings, all in unsloth-zoo. unsloth-zoo 2026.10.7 reached PyPI yesterday at 15:39, and the scan installs the latest release. Nothing in this repo caused it; it is the expected churn of digest-pinned entries on a zoo release, same as #13143, #13472, #13701 and #13949. | File | Check | Why it reopened | |---|---|---| | `llama_cpp.py` | env + network | file digest changed, matched lines unchanged | | `compiler.py` | exec/eval | file digest changed, matched lines unchanged | | `vllm_utils.py` | exec/eval | file digest changed, matched lines unchanged | | `mlx/loader.py` | exec/eval | file digest changed, matched lines unchanged | | `mlx/speculative.py` | exec/eval | file digest changed, matched lines unchanged | | `temporary_patches/moe_utils.py` | exec/eval | file digest changed, matched lines unchanged | | `triton_kernels_compat.py` | downloads and executes remote code | new matched lines | ## Review I diffed each of the seven files between 2026.10.6 (last baselined) and 2026.10.7 and searched the added lines for network, subprocess, exec/eval/compile, encoding, pickle, ctypes and environment access. What they add: - `triton_kernels_compat.py`: the flagged lines are `importlib.import_module(self.name + ".topk")` and `".tensor_details.ragged_tensor"`, which import fixed submodules of an already installed `triton_kernels` package or vLLM's vendored copy. The new `UNSLOTH_TRITON_KERNELS_SOURCE` flag (`auto | triton_kernels | vllm`) only picks which of those two to import. Nothing is downloaded. - `vllm_utils.py`, `temporary_patches/moe_utils.py`: feature flags (`UNSLOTH_VLLM_SUFFIX_DECODING`, `UNSLOTH_VLLM_FP32_LM_HEAD`, `UNSLOTH_MOE_DEQUANT_CHUNK_EXPERTS`, `UNSLOTH_MOE_SELECTIVE_DEQUANT`). - `mlx/loader.py`: on MLX >= 0.32.4, imports the mlx-vlm modules named in a fixed table (`_EXACT_VERIFY_SUM_SOURCES`) and uses two regexes to promote their verify-kernel sums to float32. - `llama_cpp.py`, `compiler.py`, `mlx/speculative.py`: no added line touches any of those patterns. None adds network access, subprocess use, encoded payloads or a new destination. ## Change Seven entries added to `scripts/scan_packages_baseline.json`, taken from `scan_packages.py --write-baseline` over `unsloth-zoo==2026.10.7` and filtered to the unbaselined keys. Each is pinned to its 2026.10.7 file digest, as the previous entries for these files were, and sits next to them. Nothing is removed, so older releases stay covered. ## Testing - `scan_packages.py unsloth-zoo==2026.10.7`: exits 0 with this baseline; with main's baseline it exits 1 with the same seven findings as CI. - `scan_packages.py unsloth-zoo==2026.10.6` still exits 0. - `tests/security/test_scan_packages.py`: 152 passed.
Summary
Security auditon main fails inpip scan-packages :: hf-stackandpip scan-packages :: studio(run 38811240332 on 565630c). Two new upstream releases moved reviewed findings out of the baseline:vision_utils.py,compiler.py,vllm_utils.py,mlx/speculative.py,temporary_patches/moe_utils.py), changed the matched lines inmlx/decision.pyandmlx/loader.py, and added a new site invllm_gdn_replayssm.py.while True:generator intesting_utils.py, which the scanner reads as a polling loop.No product change caused this; it is the expected churn of evidence-hash and file-digest keyed entries on a new release, same as #13143, #13472 and #13701.
Review
I diffed every flagged zoo file between 2026.10.5 (last baselined) and 2026.10.6. The added lines that touch the matched patterns are:
mx.eval(...)MLX array evaluation calls andmodel.eval()(decision.py, loader.py, speculative.py)UNSLOTH_MOE_LORA_PAD_ALWAYS,VLLM_MLA_DISABLE,UNSLOTH_VLLM_ONLINE_FP8,UNSLOTH_VLLM_REPLAYSSM,VLLM_USE_V2_MODEL_RUNNER,UNSLOTH_VLLM_MERGED_ROLLOUT_RESTORE)unsloth_fsdp_unshardimport and calls in the compiler header (zoo Unexpected error when calling standardize_sharegpt #1766)mask_out_tokensargument invision_utils.py; the env and IMDS hits there are still the SSRF guard that lists metadata hosts in order to block themvllm_gdn_replayssm._edit_method, which recompiles a vLLM method from its owninspect.getsourcetext after a textual edit, the same pattern as the other vLLM patchersNone adds network access, subprocess use, encoded payloads or a new destination.
The transformers hit is
evaluate_side_effect_factoryintesting_utils.py, a test helper that yields the last value forever (while True: yield side_effect_values[-1]). It was baselined at three earlier line numbers already.Change
Ten entries appended to
scripts/scan_packages_baseline.json, taken fromscan_packages.py --write-baselineover the two failing shards and filtered to the flagged keys. Nothing is removed, so the older releases stay covered, and pins carry over: every entry whose site was pinned before is pinned to the 2026.10.6 file digest. The newvllm_gdn_replayssm.pysite is pinned too, since what it execs is decided by the edit tables and source lookup elsewhere in the file, andtests/security/test_scan_packages.pynow requires that pin in both context-dependent pin tests.Excluded on purpose: the local run also flagged
multiprocess, which comes from a Python-version-specific wheel this host resolves and CI does not.Testing
tests/security/test_scan_packages.py: 152 passed. Removing the new pin makestest_context_dependent_unsloth_zoo_findings_are_digest_pinnedandtest_context_dependent_unsloth_zoo_pins_reopen_on_other_file_changesfail.