Skip to content

Refresh the fastapi C2-loop scan baseline entry for the current release - #7223

Merged
danielhanchen merged 1 commit into
mainfrom
fix-fastapi-scan-baseline
Jul 19, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
fix-fastapi-scan-baseline

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

What

Refreshes the one stale entry in scripts/scan_packages_baseline.json that is failing the pip scan-packages :: studio shard on main and on every open PR.

Why

The baseline suppresses a reviewed, benign finding: the SSE keepalive while True: loop in fastapi/routing.py, which the scanner's C2-loop heuristic flags. The entry pins the evidence at L586 together with the span digest of the fastapi release that was current when it was baselined. The latest fastapi release shifts the loop to L587 and changes the span digest, so the stored evidence_hash no longer matches and the scanner reports the finding as a new unsuppressed CRITICAL, turning the shard red (see the Security-audit runs on main, e.g. 29631733699 and 29621709961, both studio-scan=failure on an untouched baseline).

Re-review of the flagged code

Before refreshing the suppression I re-read the flagged code in the current release: L587 of fastapi/routing.py is the same keepalive-comment loop inside the streaming response machinery as before (receive with anyio.fail_after, forward, emit a keepalive comment on timeout). It is not a polling beacon.

Verification

  • python scripts/scan_packages.py fastapi --no-baseline reproduces the exact evidence string CI prints, including the L587 marker and span digest.
  • With the updated baseline, the same scan exits 0: 1 finding(s) suppressed by baseline (1 CRITICAL, 0 HIGH, 0 MEDIUM).
  • The diff touches only the one entry's evidence and evidence_hash fields (2 lines).

…release

The pip scan-packages studio shard is red on main and on every open PR:
the baselined fastapi finding (the benign SSE keepalive `while True:`
loop in fastapi/routing.py, reviewed and suppressed long ago) records
its evidence at L586 with the span digest of the fastapi release current
at baseline time. The latest fastapi shifts that loop to L587 and its
span digest with it, so the evidence hash no longer matches and the
scanner reports the finding as new, failing the shard with one
unsuppressed CRITICAL.

Re-reviewed the flagged code in the current release before refreshing:
L587 is the same keepalive loop inside the streaming response machinery,
not a beacon. Only the one entry's evidence and evidence_hash change.

Verified with the scanner itself: `scan_packages.py fastapi
--no-baseline` reproduces the exact CI evidence string, and with the
updated baseline the same scan exits 0 with the finding suppressed as
1 CRITICAL baselined.
@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 baseline scan results in scripts/scan_packages_baseline.json to reflect a change in the line number (from L586 to L587) and the corresponding SHA256 hash/evidence hash for a critical check in fastapi/routing.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

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: f160f14bcf

ℹ️ 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 030524a into main Jul 19, 2026
15 checks passed
@danielhanchen
danielhanchen deleted the fix-fastapi-scan-baseline branch July 19, 2026 07:34
VectorCipher pushed a commit to VectorCipher/unsloth that referenced this pull request Jul 20, 2026
…release (unslothai#7223)

The pip scan-packages studio shard is red on main and on every open PR:
the baselined fastapi finding (the benign SSE keepalive `while True:`
loop in fastapi/routing.py, reviewed and suppressed long ago) records
its evidence at L586 with the span digest of the fastapi release current
at baseline time. The latest fastapi shifts that loop to L587 and its
span digest with it, so the evidence hash no longer matches and the
scanner reports the finding as new, failing the shard with one
unsuppressed CRITICAL.

Re-reviewed the flagged code in the current release before refreshing:
L587 is the same keepalive loop inside the streaming response machinery,
not a beacon. Only the one entry's evidence and evidence_hash change.

Verified with the scanner itself: `scan_packages.py fastapi
--no-baseline` reproduces the exact CI evidence string, and with the
updated baseline the same scan exits 0 with the finding suppressed as
1 CRITICAL baselined.
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