Skip to content

Re-approve the four unsloth-zoo findings that 2026.9.5 reopened - #11240

Merged
danielhanchen merged 1 commit into
mainfrom
refresh-zoo-scan-baseline
Sep 18, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
refresh-zoo-scan-baseline

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Security audit is red on main. pip scan-packages :: hf-stack reports 2 CRITICAL and 2 HIGH unbaselined, all of them first-party unsloth-zoo code that has been reviewed and approved before. Reproduced locally by scanning the package on its own, which gives the same four.

What the four actually are

Every one is the scanner matching our own defences and idioms:

File Check What it is
vision_utils.py Harvests env vars + network The env var is UNSLOTH_ALLOW_PRIVATE_URL_FETCH, the opt-in gate on the SSRF guard; the network line is the requests session the guard protects
vision_utils.py IMDS + network metadata.google.internal is in the guard's blocklist. The file is flagged for refusing to fetch IMDS
compiler.py Obfuscation + exec A dynamic __import__ of a model module, plus the training banner, whose chr(92) backslashes draw the sloth
mlx/loader.py Obfuscation + exec A dynamic __import__, plus mx.eval, which is MLX forcing evaluation of a lazy array and has nothing to do with Python eval

Two of them did not change at all

compiler.py and mlx/loader.py carry exactly the evidence hashes the baseline already holds, bdfae4c24572 and cf9c8ed7bf9c. They reopened because their file_sha256 pins stopped matching after the release touched those files elsewhere. Only the two vision_utils.py findings have genuinely new evidence hashes.

Pinned, not unpinned

I first added these without a digest, which is what scan_packages.py writes when it emits a fresh entry. tests/security/test_scan_packages.py rejected that, correctly:

test_context_dependent_unsloth_zoo_findings_are_digest_pinned
test_context_dependent_unsloth_zoo_pins_reopen_on_other_file_changes
test_the_shipped_baseline_has_no_duplicate_keys

The approval has to be for the file as it was reviewed rather than for the matched lines, because an unpinned entry would suppress the finding whatever the file later contains, and a payload added to the same file would ride it. So the four entries carry the digests of the files as they ship in the 2026.9.5 sdist.

That guard also documents why this matters: #10187 moved the baseline digest but left a duplicate copy in the test behind, and the disagreement took Repo tests (CPU) and workflow-trigger lint down on every open PR.

Verification

  • python scripts/scan_packages.py unsloth-zoo exits 0, nothing unbaselined, 12 findings suppressed.
  • tests/security/ has the same 12 failures on this branch as on main, and the diff between the two failure lists is empty. Those 12 are this environment's broken import unsloth, unrelated to the baseline.
  • The diff is 4 appended entries, 36 lines, and touches nothing else.

Security audit is red on main: pip scan-packages :: hf-stack reports 2 CRITICAL
and 2 HIGH unbaselined, all of them first-party unsloth-zoo code that has been
reviewed and approved before. Reproduced locally by scanning the package alone,
which gives the same four.

All four are the scanner matching our own defences and idioms:

  vision_utils.py  Harvests env vars + network. The env var is
                   UNSLOTH_ALLOW_PRIVATE_URL_FETCH, the opt-in gate on the SSRF
                   guard, and the network line is the requests session the guard
                   protects.
  vision_utils.py  IMDS + network. "metadata.google.internal" is in the guard's
                   BLOCKLIST. The file is flagged for refusing to fetch IMDS.
  compiler.py      Obfuscation + exec. A dynamic __import__ of a model module,
                   plus the training banner, whose chr(92) backslashes draw the
                   sloth.
  mlx/loader.py    Obfuscation + exec. A dynamic __import__, plus mx.eval, which
                   is MLX forcing evaluation of a lazy array and has nothing to
                   do with Python eval.

Two of them did not change at all. compiler.py and mlx/loader.py carry the same
evidence hashes the baseline already holds, bdfae4c24572 and cf9c8ed7bf9c; they
reopened because their file_sha256 pins no longer match a file the release
touched elsewhere. The two vision_utils findings do have new evidence hashes.

Pinned, not unpinned. I first added these without a digest, which is what the
scanner writes, and tests/security/test_scan_packages.py rejected it:
test_context_dependent_unsloth_zoo_findings_are_digest_pinned says the approval
has to be for the file as reviewed rather than for the matched lines, because an
unpinned entry would suppress the finding whatever the file later contains. The
digests are of the files as they ship in the 2026.9.5 sdist.

Verified: scan_packages.py unsloth-zoo exits 0 with nothing unbaselined, and
tests/security/ has the same 12 failures on this branch as on main, with an empty
diff between the two lists. Those 12 are this venv's broken `import unsloth`,
not related to the baseline.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 18, 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-18T00:51:30.591563Z f44f131 Manual request
🔒 Security Review ✅ Completed 2026-09-18T00:52:33.681548Z f44f131 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

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: f44f1314a9

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

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: f44f1314a9

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@danielhanchen
danielhanchen merged commit 16408b2 into main Sep 18, 2026
25 checks passed
@danielhanchen
danielhanchen deleted the refresh-zoo-scan-baseline branch September 18, 2026 01:07
shaojun pushed a commit to shaojun/unsloth that referenced this pull request Sep 29, 2026
…othai#11240)

Security audit is red on main: pip scan-packages :: hf-stack reports 2 CRITICAL
and 2 HIGH unbaselined, all of them first-party unsloth-zoo code that has been
reviewed and approved before. Reproduced locally by scanning the package alone,
which gives the same four.

All four are the scanner matching our own defences and idioms:

  vision_utils.py  Harvests env vars + network. The env var is
                   UNSLOTH_ALLOW_PRIVATE_URL_FETCH, the opt-in gate on the SSRF
                   guard, and the network line is the requests session the guard
                   protects.
  vision_utils.py  IMDS + network. "metadata.google.internal" is in the guard's
                   BLOCKLIST. The file is flagged for refusing to fetch IMDS.
  compiler.py      Obfuscation + exec. A dynamic __import__ of a model module,
                   plus the training banner, whose chr(92) backslashes draw the
                   sloth.
  mlx/loader.py    Obfuscation + exec. A dynamic __import__, plus mx.eval, which
                   is MLX forcing evaluation of a lazy array and has nothing to
                   do with Python eval.

Two of them did not change at all. compiler.py and mlx/loader.py carry the same
evidence hashes the baseline already holds, bdfae4c24572 and cf9c8ed7bf9c; they
reopened because their file_sha256 pins no longer match a file the release
touched elsewhere. The two vision_utils findings do have new evidence hashes.

Pinned, not unpinned. I first added these without a digest, which is what the
scanner writes, and tests/security/test_scan_packages.py rejected it:
test_context_dependent_unsloth_zoo_findings_are_digest_pinned says the approval
has to be for the file as reviewed rather than for the matched lines, because an
unpinned entry would suppress the finding whatever the file later contains. The
digests are of the files as they ship in the 2026.9.5 sdist.

Verified: scan_packages.py unsloth-zoo exits 0 with nothing unbaselined, and
tests/security/ has the same 12 failures on this branch as on main, with an empty
diff between the two lists. Those 12 are this venv's broken `import unsloth`,
not related to the baseline.
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