Skip to content

Baseline the thirteen unsloth-zoo 2026.9.8 findings after review - #12292

Merged
danielhanchen merged 2 commits into
mainfrom
fix/baseline-zoo-2026.9.8
Sep 29, 2026
Merged

danielhanchen merged 2 commits into
mainfrom
fix/baseline-zoo-2026.9.8

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

pip scan-packages :: hf-stack has been red on main and on every PR since unsloth-zoo 2026.9.8 reached PyPI (2026-09-28 14:04 UTC). The scanner reports 13 unsloth-zoo findings that the baseline does not cover:

  • 8 at sites already reviewed, reopened because the file changed (7 file-digest pins, 1 matched line moved).
  • 5 at sites never reviewed before: four new checks in converter_scan.py and one in temporary_patches/granitemoehybrid.py.

This PR adds 13 baseline entries for them after review. No existing entry is changed or removed, so older zoo versions stay covered.

Review

Provenance. The 2026.9.8 wheel matches unsloth-zoo main at f980552a byte for byte, apart from CRLF line endings. There are no .pth files, and the only non-Python file is the existing diffusion_studio/canvas_player.html. Everything flagged is merged source.

Files behind the reopened pins. I diffed each file against 2026.9.7 and grepped the added lines for network, subprocess, exec, encoding, /tmp, environment and metadata patterns:

File What changed
compiler.py a hub kernel wrapper regex
mlx/loader.py mlx-vlm processor and tokenizer repair
temporary_patches/moe_utils.py UNSLOTH_MOE_* env switches
vision_utils.py base64 image input, chat template adoption
vllm_utils.py a logits processor fast path

None adds a destination, a subprocess or a new exec.

converter_scan.py. This is zoo's own model-converter security scanner, so all six hits are regex strings in its detector tables:

  • the /tmp dropper pattern, now at L1768 (same code, moved);
  • the IOC string;
  • the new filesystem, IMDS, wallet and persistence patterns;
  • a list of network module names.

It never makes a network call itself.

granitemoehybrid.py L73. exec(compile(...)) of a rewritten copy of transformers' own GraniteMoeHybridDecoderLayer.forward. The source comes from inspect.getsource, with only a regex substitution applied. It is the same patching pattern as the other reviewed zoo sites.

Entries were generated with --write-baseline against the current baseline, so the file pins carried over and are set on the 7 re-reviewed entries.

Testing

  • python scripts/scan_packages.py unsloth-zoo==2026.9.8: exit 1 on main, exit 0 here (8 MEDIUM remain, as before).
  • python scripts/scan_packages.py unsloth-zoo==2026.9.7: still exit 0.
  • tests/security/test_scan_packages.py tests/studio/install/test_diffusers_pin.py: 183 passed.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 29, 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-09-29T18:10:08.520393Z 7782139 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 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: 2f5f06c81f

ℹ️ 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
"check": "Writes to /tmp and executes (staged dropper)",
"severity": "CRITICAL",
"evidence": "L1768: r\"/tmp/\\S+.*(?:subprocess|os\\.system|os\\.popen|Popen|chmod.*\\+x)\", | L1768: r\"/tmp/\\S+.*(?:subprocess|os\\.system|os\\.popen|Popen|chmod.*\\+x)\", sha256:8f6aa9a429370960eeaa339f9cbbc6069dfda34e6a9dc8e7c64689a74a42cf1a",
"evidence_hash": "2e35147c040613a5f7e8bdf6b4595b5a5ff1c7530425963f18f9b3f79a78d5f4"

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 converter approvals to the reviewed file

Add the reviewed 2026.9.8 file_sha256 to this entry and the four new combined converter findings below. Without it, _load_baseline treats each entry as unpinned and suppresses the same evidence for any future contents of converter_scan.py; because the evidence consists of benign detector-table regex literals rather than the surrounding behavior, a later unsloth_zoo release can retain those strings while changing the file maliciously, and the floating unsloth_zoo>=2026.9.8 audit will remain green. The earlier converter approvals are digest-pinned for this reason.

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.

Agreed. Pinned in 7782139: the six new entries (the moved /tmp detector line, the four new converter_scan.py checks and the granitemoehybrid.py exec) now carry the 2026.9.8 file digest. Setting a wrong digest on the granitemoehybrid entry reopens the finding and fails the scan.

Comment thread scripts/scan_packages_baseline.json Outdated
"check": "Advanced obfuscation (marshal/compile/zlib) + exec/eval",
"severity": "HIGH",
"evidence": "Obfusc: L73: exec(compile(source, f\"<unsloth granitemoehybrid float16 {module.__name__}>\", \"exec\"), namespace)\nExec: L73: exec(compile(source, f\"<unsloth granitemoehybrid float16 {module.__name__}>\", \"exec\"), namespace)",
"evidence_hash": "5daea207e575087c8cefc30b8d2d947a88640b3be52de1de592d365ab74e978f"

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 dynamic-exec approval to the reviewed file

Add the reviewed file digest here. This evidence records only the unchanged exec(compile(source, ...)) statement, while its benignity depends on surrounding code obtaining source from inspect.getsource and applying only the reviewed rewrite; with no file_sha256, a future floating zoo release can change where source comes from without changing this evidence, causing the HIGH finding to remain suppressed for arbitrary new file contents.

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.

Agreed. Pinned in 7782139: the six new entries (the moved /tmp detector line, the four new converter_scan.py checks and the granitemoehybrid.py exec) now carry the 2026.9.8 file digest. Setting a wrong digest on the granitemoehybrid entry reopens the finding and fails the scan.

@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: 2f5f06c81f

ℹ️ 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
"check": "Writes to /tmp and executes (staged dropper)",
"severity": "CRITICAL",
"evidence": "L1768: r\"/tmp/\\S+.*(?:subprocess|os\\.system|os\\.popen|Popen|chmod.*\\+x)\", | L1768: r\"/tmp/\\S+.*(?:subprocess|os\\.system|os\\.popen|Popen|chmod.*\\+x)\", sha256:8f6aa9a429370960eeaa339f9cbbc6069dfda34e6a9dc8e7c64689a74a42cf1a",
"evidence_hash": "2e35147c040613a5f7e8bdf6b4595b5a5ff1c7530425963f18f9b3f79a78d5f4"

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 converter approvals to the reviewed file

Add the reviewed 2026.9.8 file_sha256 to this entry and the four new combined converter findings below. Without it, _load_baseline treats each entry as unpinned and suppresses the same evidence for any future contents of converter_scan.py; because the evidence consists of benign detector-table regex literals rather than the surrounding behavior, a later unsloth_zoo release can retain those strings while changing the file maliciously, and the floating unsloth_zoo>=2026.9.8 audit will remain green. The earlier converter approvals are digest-pinned for this reason.

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.

Agreed. Pinned in 7782139: the six new entries (the moved /tmp detector line, the four new converter_scan.py checks and the granitemoehybrid.py exec) now carry the 2026.9.8 file digest. Setting a wrong digest on the granitemoehybrid entry reopens the finding and fails the scan.

Comment thread scripts/scan_packages_baseline.json Outdated
"check": "Advanced obfuscation (marshal/compile/zlib) + exec/eval",
"severity": "HIGH",
"evidence": "Obfusc: L73: exec(compile(source, f\"<unsloth granitemoehybrid float16 {module.__name__}>\", \"exec\"), namespace)\nExec: L73: exec(compile(source, f\"<unsloth granitemoehybrid float16 {module.__name__}>\", \"exec\"), namespace)",
"evidence_hash": "5daea207e575087c8cefc30b8d2d947a88640b3be52de1de592d365ab74e978f"

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 dynamic-exec approval to the reviewed file

Add the reviewed file digest here. This evidence records only the unchanged exec(compile(source, ...)) statement, while its benignity depends on surrounding code obtaining source from inspect.getsource and applying only the reviewed rewrite; with no file_sha256, a future floating zoo release can change where source comes from without changing this evidence, causing the HIGH finding to remain suppressed for arbitrary new file contents.

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.

Agreed. Pinned in 7782139: the six new entries (the moved /tmp detector line, the four new converter_scan.py checks and the granitemoehybrid.py exec) now carry the 2026.9.8 file digest. Setting a wrong digest on the granitemoehybrid entry reopens the finding and fails the scan.

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Sep 29, 2026
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 77821396ba

ℹ️ 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 c4a8135 into main Sep 29, 2026
15 of 21 checks passed
@danielhanchen
danielhanchen deleted the fix/baseline-zoo-2026.9.8 branch September 29, 2026 18:17
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