Repository navigation
scripts: refresh scan_packages allowlist baseline - #7032
Conversation
Regenerate scripts/scan_packages_baseline.json against the current resolved dependency set so the blocking pip scan-packages gate matches what the scanner now finds. Refreshes evidence hashes for benign findings whose code shifted lines (unsloth-zoo mlx loader, gguf/mlx test /tmp fixtures) and adds two mainstream-library entries that were newly surfaced (torch inductor codecache base64+subprocess compile cache, torch testing common_utils socket import). Stale entries whose matching code changed and no longer triggers are dropped. All entries remain CRITICAL/HIGH findings manually judged benign; matched on (package, file, check, evidence_hash).
There was a problem hiding this comment.
Code Review
This pull request updates the package scanning baseline file scripts/scan_packages_baseline.json. It modifies line numbers, evidence, and hashes for several existing package checks, adds new baseline entries for packages such as fastapi, huggingface-hub, multiprocess, torch, unsloth-zoo, cffi, and tensorboard, and removes redundant entries at the end of the file. There are no review comments, so I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
The security-audit pull_request trigger listed the scanners but not their allowlist baselines, so a baseline-only edit never re-ran the scan that consumes it. A refreshed baseline could therefore merge without CI confirming its evidence hashes match what the scanner finds. Add scan_packages_baseline.json and scan_npm_packages_baseline.json to the paths filter so baseline changes are validated on their own PR.
What
Regenerate
scripts/scan_packages_baseline.jsonso the blockingpip scan-packagessecurity gate matches what the scanner currently finds against the resolved dependency set.The baseline had drifted: several allowlisted entries pointed at benign findings whose code had since shifted lines (so their
evidence_hashno longer matched), and a couple of mainstream-library findings were newly surfaced and never allowlisted. Because the gate runs withSCAN_ENFORCE=1, the drift made the scan-packages jobs fail on every PR, not just this one.How
Rebuilt the allowlist by running
scripts/scan_packages.py --with-deps --no-baseline --write-baselineover the same requirement shards the workflow uses (hf-stack, studio, extras), then unioned the results. Net delta versus the previous baseline is small (195 to 191 entries):Added (benign, newly surfaced):
torch/_inductor/codecache.py- torch.compile inductor cache: base64-decodes a cached compile artifact and invokes the compiler via subprocess.torch/testing/_internal/common_utils.py-import socketin torch's internal test utilities.unsloth-zootest fixtures writing to/tmp(gguf/mlx regression tests) andunsloth_zoo/mlx/loader.pydynamic__import__plus MLXmx.eval.Removed (stale): the same benign findings under old hashes whose code moved, plus a few whose matching code changed enough that they no longer trigger.
Every remaining entry is a CRITICAL/HIGH finding manually judged benign; matching is on
(package, file, check, evidence_hash), so version bumps and line shifts do not reopen an entry but genuinely changed code does.Validation
The scan-packages jobs in this PR's CI re-run the scanner against the same shards and enforce the refreshed baseline, so a green run here confirms the hashes line up with what CI resolves.