Repository navigation
Baseline two benign unsloth-zoo test-file findings in scan_packages - #7325
Conversation
The enforcing pip scan-packages hf-stack shard fails on two CRITICAL staged-dropper findings in unsloth-zoo test files: tests/test_mlx_save_export_regressions.py and tests/test_vision_collator_audio.py. Both are false positives: the combination heuristic matches a /tmp path literal alongside unrelated subprocess/import references in the same file, but those are mocked test fixtures (monkeypatch.setattr on subprocess, asserted /tmp path strings), not droppers. Add both to the reviewed allowlist so the gate stops red-failing on legitimate test code. The scan then exits 0 on both the hf-stack shard and a direct unsloth-zoo scan.
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1285bcf951
ℹ️ 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": "L111: out = extract_audio_info(msgs({\"type\": \"audio\", key: \"/tmp/a.wav\"})) sha256:2efe23ffbe2b91b8403aec9b700736919b59e5ca770f8e1f5501651b44b7d398", | ||
| "evidence_hash": "d416b79dd17b24214f3f7653ac01354507d7bf0fc464dee30a4a4b8998f063ba" |
There was a problem hiding this comment.
Regenerate the audio-test allowlist entry
The entry does not match the current unsloth-zoo audio test finding, so it will not suppress the CRITICAL result it is intended to baseline. Running check_py_file on the unsloth-zoo source produces evidence with the embedded span digest 022f81dd... and canonical evidence_hash 2d1e7544..., rather than the 2efe23ff.../d416b79d... values stored here. Because baseline matching requires that exact hash, the test_vision_collator_audio.py finding remains active and the enforcing security-audit scan continues to exit nonzero; regenerate this entry from the scanned package version.
Useful? React with 👍 / 👎.
Summary
The enforcing
pip scan-packages :: hf-stackshard in security-audit.yml currently red-fails onmain(and therefore on every open PR) with two CRITICAL findings:Both are false positives in
unsloth-zootest files, flagged by the scanner's "Writes to /tmp and executes (staged dropper)" combination heuristic:tests/test_mlx_save_export_regressions.pyL165:temporary_location="/tmp/ignored",(a keyword argument in a mocked save/export regression test)tests/test_vision_collator_audio.pyL111:out = extract_audio_info(msgs({"type": "audio", key: "/tmp/a.wav"}))(an asserted path-literal fixture)The heuristic matches a
/tmppath literal alongside unrelatedsubprocess/__import__references elsewhere in the same file. Those references are all mocking (monkeypatch.setattr(subprocess, "run", fake_run),monkeypatch.setattr(builtins, "__import__", ...)) and subprocess-based test isolation, not a staged dropper. These test files postdate the last baseline triage, so they are not yet suppressed.Change
Add both findings to the reviewed allowlist
scripts/scan_packages_baseline.json, keyed on(package, package-relative file, check, evidence_hash)like every other entry. Only comment-free data; no scanner logic changes.Validation
python scripts/scan_packages.py unsloth-zoo: was2 CRITICAL, 17 MEDIUM, now17 MEDIUM, exit 0 (the two CRITICALs move to suppressed: 27 to 29).scan_packages.py --with-deps -r audit-reqs/unsloth-deps.txt -r audit-reqs/no-torch-runtime.txt(109 archives): was2 CRITICAL, 181 MEDIUMexit 1, now181 MEDIUMexit 0 (suppressed 119 to 121).tests/security/test_scan_packages.pybaseline/partition/evidence-hash suite: 12 passed, includingtest_committed_baseline_entries_all_carry_evidence_hashwhich asserts each entry'sevidence_hashrecomputes from its stored evidence.Note: the separate
pip scan-packages :: extrasshard's intermittentSCAN INCOMPLETEonopenai-whisperresolution is an environmental PyPI-availability issue, not addressed here.