Repository navigation
Security audit: re-approve the unsloth-zoo compiler.py finding after 2026.8.14 - #9674
Merged
Merged
Conversation
…2026.8.14
unsloth-zoo 2026.8.14 (PyPI, 2026-08-25T04:00:39Z) replaced
exec(f"import {model_location}", globals())
modeling_file = eval(model_location)
in unsloth_zoo/compiler.py with
modeling_file = importlib.import_module(model_location)
exec("import transformers", globals())
That is the only change to the code the scanner matches on, and it is a
reduction in dynamic-code surface: an interpolated import and an eval of an
interpolated name become an importlib call plus one constant-string exec.
The baseline keys each approved finding on a hash of the matched code, so a
changed body correctly reopens it. It reopened as 1 HIGH and, with
SCAN_ENFORCE=1, has failed 'pip scan-packages :: hf-stack' on every run since
04:10Z: main pushes, the nightly schedule and unrelated pull requests alike.
The last green run started at 04:00:07Z, 32 seconds before the release.
Re-approves the new body only. Verified against unsloth-zoo 2026.8.14: exit 1
with 1 HIGH before, exit 0 with it suppressed after. Pinning the entry to any
other body puts the HIGH straight back, so this is not a blanket waiver on the
file or the check.
danielhanchen
added a commit
that referenced
this pull request
Aug 25, 2026
…2026.8.14 (#9674) unsloth-zoo 2026.8.14 (PyPI, 2026-08-25T04:00:39Z) replaced exec(f"import {model_location}", globals()) modeling_file = eval(model_location) in unsloth_zoo/compiler.py with modeling_file = importlib.import_module(model_location) exec("import transformers", globals()) That is the only change to the code the scanner matches on, and it is a reduction in dynamic-code surface: an interpolated import and an eval of an interpolated name become an importlib call plus one constant-string exec. The baseline keys each approved finding on a hash of the matched code, so a changed body correctly reopens it. It reopened as 1 HIGH and, with SCAN_ENFORCE=1, has failed 'pip scan-packages :: hf-stack' on every run since 04:10Z: main pushes, the nightly schedule and unrelated pull requests alike. The last green run started at 04:00:07Z, 32 seconds before the release. Re-approves the new body only. Verified against unsloth-zoo 2026.8.14: exit 1 with 1 HIGH before, exit 0 with it suppressed after. Pinning the entry to any other body puts the HIGH straight back, so this is not a blanket waiver on the file or the check.
This was referenced Sep 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pip scan-packages :: hf-stackhas been failing on main, on the nightly schedule and on every open pull request since 04:10Z today. It is not any one PR's doing.What happened
unsloth-zoo
2026.8.14went to PyPI at2026-08-25T04:00:39Z. The last green run of that job started at04:00:07Z, 32 seconds earlier, and resolved2026.8.13. The next run started at04:10:05Z, resolved2026.8.14, and went red. Every run since has been red.The scanner's baseline keys each approved finding on a hash of the code it matched, so that a version bump does not silently re-approve changed code.
2026.8.14changedunsloth_zoo/compiler.py, so the entry stopped matching and the finding reopened as 1 HIGH. WithSCAN_ENFORCE=1that fails the job.What actually changed in the flagged code
Diffing the approved evidence against the new evidence, 85 matched lines against 84, the entire delta is:
In context,
2026.8.14now does:An interpolated
execimport and anevalof an interpolated name became animportlib.import_modulecall plus one exec of a constant string. That is strictly less dynamic-code surface than the body already approved, so this re-approves it rather than treating it as a new finding.Verification
Against
unsloth-zoo==2026.8.14, offline, no CI needed:1 HIGH, 7 MEDIUM, 5 HIGH suppressed7 MEDIUM, 6 HIGH suppressedexec(base64.b64decode(...))1 HIGHagainThe last row is the one that matters: the entry suppresses exactly one reviewed body of code. It is not a waiver on
unsloth_zoo/compiler.pyor on the obfuscation check, and the next release that touches these lines will reopen it, which is the intended behaviour.Note
This is the third entry for this same finding, after
2026.8.12and2026.8.13. The hash covers indentation and line wrapping, so a reformat of benign code reopens it and hard-fails main until someone re-approves. Worth deciding separately whether that tradeoff is right; this PR only unblocks the queue.