Skip to content

scripts: refresh scan_packages allowlist baseline - #7078

Merged
danielhanchen merged 1 commit into
mainfrom
scan-baseline-refresh-2
Jul 11, 2026
Merged

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

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Why

All three blocking pip scan-packages CI 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:

  • studio: 1 new CRITICAL
  • hf-stack: 1 new CRITICAL
  • extras: 3 new CRITICAL

What

Regenerated scripts/scan_packages_baseline.json with scan_packages.py --write-baseline, run once per CI shard with the exact same requirements groupings and --with-deps as security-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:

Package File Finding Why it is a false positive
huggingface-hub 1.23.0 huggingface_hub/hf_api.py L4677 C2 polling/beaconing loop create_repo retry 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 2.45.0 openai/resources/beta/threads/runs/runs.py L1053 C2 polling/beaconing loop Documented create_and_poll run-status helper polling api.openai.com until a terminal state, honoring the server's openai-poll-after-ms header. Hash refresh of the existing entry (Assistants deprecation refactor).
openai 2.45.0 openai/resources/beta/responses/responses.py L3999 C2 polling/beaconing loop New beta websocket client: __aiter__ yields server events until the connection closes, with bounded reconnect handling. Standard event-stream iterator. New entry.
openai 2.45.0 openai/resources/responses/responses.py (line shift only) Evidence line number refreshed from L3803 to L3950; evidence hash unchanged, so this entry never reopened. Review-metadata update only.

Nothing 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.py L4613, openai beta/threads/runs/runs.py L1074). 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:

  • hf-stack: exit 0, 120 suppressed (82 CRITICAL, 38 HIGH)
  • studio: exit 0, 151 suppressed (97 CRITICAL, 54 HIGH)
  • extras: exit 0, 99 suppressed (64 CRITICAL, 35 HIGH)

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).
@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +162 to +163
"evidence": "L4677: while True: sha256:04afb38843e4125d1476f3f04bdad0edf1f63f8d75ad49a713b13e4bc68612fb",
"evidence_hash": "18877a2502c862b46a5d7e33fa7c39ab4ef32da7e1b07f596fd455f4376770c6"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

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

@danielhanchen
danielhanchen merged commit 9fa6fd4 into main Jul 11, 2026
22 of 23 checks passed
@danielhanchen
danielhanchen deleted the scan-baseline-refresh-2 branch July 11, 2026 15:15
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