Repository navigation
scripts: refresh scan_packages allowlist baseline - #7078
Conversation
New releases of huggingface-hub (1.23.0) and openai (2.45.0) shifted or added polling loops that the C2 polling/beaconing check flags, failing all three pip scan-packages shards (studio 1, hf-stack 1, extras 3 new CRITICAL findings) org-wide including on main. Regenerated with scan_packages.py --write-baseline per CI shard (same shard-to-requirements mapping and --with-deps as security-audit.yml) and merged. All entries were manually reviewed at the resolved versions: - huggingface-hub hf_api.py: create_repo 409-concurrency retry loop body changed in 1.23.0; refreshed evidence hash. The loop POSTs to the canonical Hub endpoint and retries only on a specific conflict error. Benign client retry. - openai beta/threads/runs/runs.py: create_and_poll run-status helper refactored in 2.45.0 (Assistants deprecation annotations); refreshed evidence hash. Documented polling helper against api.openai.com. - openai beta/responses/responses.py: new beta websocket client whose __aiter__ yields server events until the connection closes. New entry; standard event-stream iterator, not beaconing. - openai resources/responses/responses.py: evidence line number refreshed only, hash unchanged. The two dropped entries are the pre-refactor hashes of the same two loops above; they no longer occur at the resolved versions. Verified locally: all three shards exit 0 with 0 unsuppressed CRITICAL/HIGH (hf-stack 120, studio 151, extras 99 suppressed).
|
@codex review |
There was a problem hiding this comment.
Code Review
This pull request updates the package scanning baseline configurations in scripts/scan_packages_baseline.json by updating line numbers and hashes for existing C2 polling/beaconing loop detections in the huggingface-hub and openai packages, and adding a new baseline entry for openai/resources/beta/responses/responses.py. There are no review comments, and 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.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0153ba06d8
ℹ️ 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": "L4677: while True: sha256:04afb38843e4125d1476f3f04bdad0edf1f63f8d75ad49a713b13e4bc68612fb", | ||
| "evidence_hash": "18877a2502c862b46a5d7e33fa7c39ab4ef32da7e1b07f596fd455f4376770c6" |
There was a problem hiding this comment.
Keep the pinned Hugging Face baseline entry
This replaces the only huggingface_hub/hf_api.py allowlist key for the older loop, but the enforced pip scan-packages :: studio shard still scans studio overrides extras-no-deps and studio/backend/requirements/studio.txt pins huggingface-hub==0.36.2. That shard will still resolve the pre-refresh L4613 evidence from the parent baseline, so dropping it leaves a non-baselined CRITICAL finding and makes the SCAN_ENFORCE=1 CI job fail even though the new latest-version hash is valid for the hf-stack shard.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
The studio pin is still covered: the baseline keeps a distinct hf_api.py entry for the 0.36.2-era loop (evidence L3746, hash 0c73ed1a...) alongside the new 1.23.0 entry (L4677). The dropped L4613 key was a third, intermediate-version hash that no longer occurs at any version the shards resolve. Empirically: the enforced 'pip scan-packages :: studio' job passed on exactly this commit (0153ba0, job 86555572894, 0 unsuppressed CRITICAL/HIGH), as did hf-stack and extras.
|
@codex review |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Why
All three blocking
pip scan-packagesCI shards (studio, hf-stack, extras) fail org-wide, including on main (e.g. run 29152277211). New releases of huggingface-hub (1.23.0) and openai (2.45.0) shifted or added polling loops that the scanner's "C2 polling/beaconing loop" check flags:What
Regenerated
scripts/scan_packages_baseline.jsonwithscan_packages.py --write-baseline, run once per CI shard with the exact same requirements groupings and--with-depsassecurity-audit.yml, then merged with the same ordering convention as the previous refresh (#7032). Net diff: 1 entry added, 2 evidence hashes refreshed, 1 evidence line number refreshed, 191 -> 192 entries.Triage of every new suppression
Each finding was reviewed at the resolved version by reading the cited code:
huggingface_hub/hf_api.pyL4677create_reporetry loop: POSTs to the canonical Hub endpoint and retries only on a specific 409 "conflicting operation in progress" error, otherwise breaks. Hash refresh of the existing entry (loop body changed upstream).openai/resources/beta/threads/runs/runs.pyL1053create_and_pollrun-status helper polling api.openai.com until a terminal state, honoring the server'sopenai-poll-after-msheader. Hash refresh of the existing entry (Assistants deprecation refactor).openai/resources/beta/responses/responses.pyL3999__aiter__yields server events until the connection closes, with bounded reconnect handling. Standard event-stream iterator. New entry.openai/resources/responses/responses.pyNothing suspicious was found: no unknown or typosquatted packages, no secret exfiltration to non-canonical hosts, no obfuscation. All flagged code is upstream first-party client behavior in mainstream libraries.
Dropped entries
Two entries were dropped because they no longer occur at the resolved versions; they are the pre-refactor evidence hashes of the same two loops refreshed above (huggingface-hub
hf_api.pyL4613, openaibeta/threads/runs/runs.pyL1074). All other 189 existing suppressions are retained and still fire.Verification
All three shards replicated locally on Python 3.12 with the same input transform as CI (pyproject extraction + git+ stripping,
--with-deps). The known descript-audio-codec bulk-resolve conflict fell back to per-spec resolution as in CI. With the new baseline every shard exits 0 with 0 unsuppressed CRITICAL/HIGH: