fix(security): resolve PYSEC-2026-161 (starlette) and suppress PYSEC-2026-139 (torch)#44
Conversation
…2026-139 (torch) Unblocks CI on PRs #39, #40, and #41. Both pip-audit and osv-scanner were flagging the same two CVEs, cascading into Code Quality, OSV Scanner, Security Gate, and CI Gate failures on every open PR. - Bump fastapi>=0.133.0 in [audio] extras and regenerate uv.lock; fastapi 0.136.3 + starlette 1.1.0 resolve PYSEC-2026-161. - Add PYSEC-2026-139 (torch/CVE-2026-4538) to osv-scanner.toml and [tool.pip-audit] ignore-vuln; no upstream fix exists. Torch is an optional [ml] extra absent from the production container. - Document PYSEC-2026-139 in docs/known-vulnerabilities.md per project CVE policy; reassess-by 2026-07-26. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 55 minutes and 42 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (4)
WalkthroughThis PR documents and suppresses a deferred torch vulnerability (PYSEC-2026-139 / CVE-2026-4538) applicable only to local authenticated scenarios since torch is not in production, and upgrades fastapi to address a separate vulnerability (PYSEC-2026-161). ChangesSecurity and Dependency Vulnerability Management
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✅ FIPS Compatibility Check
Status: ✅ PASSED What is FIPS?FIPS 140-2/140-3 is a US government standard for cryptographic modules. Common issues:
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Dependency ReviewThe following issues were found:
License Issuesuv.lock
OpenSSF Scorecard
Scanned Files
|
✅ Mutation Testing Results
What is Mutation Testing?Mutation testing introduces small changes (mutations) to your code and checks if your tests detect them. A high mutation score indicates your tests are effective at catching bugs.
|
There was a problem hiding this comment.
Pull request overview
This PR aims to unblock CI by resolving a Starlette vulnerability via dependency upgrades and suppressing an unpatched Torch advisory across the repo’s security scanners, with corresponding documentation.
Changes:
- Bumped
fastapiin the[audio]optional dependency group to pull in a patchedstarletteversion viauv.lockregeneration. - Added
PYSEC-2026-139suppression to bothpip-auditconfiguration andosv-scanner.toml. - Documented the Torch advisory and compensating controls in
docs/known-vulnerabilities.md.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
uv.lock |
Regenerates the lockfile to update fastapi and starlette (plus incidental wheel metadata changes). |
pyproject.toml |
Raises the [audio] extra’s fastapi constraint and adds PYSEC-2026-139 to pip-audit ignores. |
osv-scanner.toml |
Adds an OSV ignore entry for PYSEC-2026-139 with justification. |
docs/known-vulnerabilities.md |
Adds a tracked entry for the Torch advisory with reassessment date and mitigation narrative. |
| # PYSEC-2026-139 / CVE-2026-4538: local-only (AV:L) vulnerability in torch 2.9.1. | ||
| # No patched version available upstream. torch is an optional [ml] extra and is | ||
| # not installed in the production container. Documented in | ||
| # docs/known-vulnerabilities.md with reassess-by 2026-07-26. | ||
| "PYSEC-2026-139", |
There was a problem hiding this comment.
Fixed in 17ce021. Updated the comment to reflect that torch enters via both the [ml] extra (direct) and the [audio] extra (transitive via silero-vad), and corrected the Dockerfile mechanism: the production image runs uv sync --frozen --no-dev with no --extra flags so neither extra is installed at runtime.
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
docs/known-vulnerabilities.md (1)
25-25:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winUpdate stale document review metadata.
Line 25 still shows
Last reviewed: 2026-05-18, but this file now includes new content dated 2026-05-27. Please update the review date to match this change set.As per coding guidelines, "
**/*.md: Use 120-character line length for Markdown documentation files".🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/known-vulnerabilities.md` at line 25, Update the "Last reviewed: 2026-05-18" metadata in docs/known-vulnerabilities.md to "Last reviewed: 2026-05-27" (look for the exact string "Last reviewed: 2026-05-18"), and reflow any modified Markdown lines to respect the project's 120-character line length limit so no line exceeds 120 characters.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/known-vulnerabilities.md`:
- Around line 302-320: Wrap all long Markdown lines in the given vulnerability
block to a 120-character maximum by breaking at word boundaries while preserving
paragraph breaks and inline code/quotes (e.g., `torch`, `torch>=`, `grep -rn
"import torch" src/`, `osv-scanner.toml`, and the section headings "Exploitation
scenario", "Why deferred", "Compensating control", "Planned resolution"); ensure
no content or meaning is changed, links and code fragments remain intact, and
lines are wrapped consistently to not exceed 120 characters.
---
Outside diff comments:
In `@docs/known-vulnerabilities.md`:
- Line 25: Update the "Last reviewed: 2026-05-18" metadata in
docs/known-vulnerabilities.md to "Last reviewed: 2026-05-27" (look for the exact
string "Last reviewed: 2026-05-18"), and reflow any modified Markdown lines to
respect the project's 120-character line length limit so no line exceeds 120
characters.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 5590ebc8-319f-4871-adaf-bd614abb5d6d
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lock,!**/*.lock
📒 Files selected for processing (3)
docs/known-vulnerabilities.mdosv-scanner.tomlpyproject.toml
PR Review (Claude Code)BUILD FAILING: SonarCloud Analysis is failing — do not merge until CI is green. Critical (must fix before merge)
Important (should fix)
PositiveThe starlette fix ( Copilot review requested; see Reviewers section for results. 🤖 Generated with Claude Code |
…ntrols The PYSEC-2026-139 / CVE-2026-4538 suppression in three files contained two false claims: 1. "torch is never imported by the deployed service" - vad.py:16 has an unconditional top-level `import torch`, refuting the grep verification. 2. "not installed in the production container (which installs only the audio extra)" - the Dockerfile runs `uv sync --frozen --no-dev` with no --extra flags; no optional extras are installed at all. The compensating control (torch absent from production) remains valid. Update all three files to state the accurate mechanism: the Dockerfile installs no optional extras, so neither [ml] (direct) nor [audio] (transitive via silero-vad) entries for torch reach the runtime image. Remove the false grep verification claim from compensating controls. Also corrects: - Package field: adds the silero-vad transitive path in [audio] extra - Patched version row: shortened to fit 120-char Markdown line limit - pyproject.toml fastapi comment: "starlette<1.0.0" -> "starlette 0.x"; "starlette 1.x" -> "starlette>=1.1.0" (1.1.0 is the specific fix version) - osv-scanner.toml: replaces -- double-dash with comma (writing rule PC-011) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Per CLAUDE.md CVE Citation Policy: any CHANGELOG entry that fixes a security vulnerability must include the CVE ID if one has been assigned. - PYSEC-2026-161 (starlette < 1.1.0): resolved by fastapi>=0.133.0 - CVE-2026-4538 / PYSEC-2026-139 (torch 2.9.1, AV:L HIGH): deferred with reassess-by 2026-07-26; no upstream fix available Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Fix SummaryAll Critical and Important findings from the Commits
Issues ResolvedCritical: False factual claims in torch CVE suppression (three files) The PYSEC-2026-139 / CVE-2026-4538 suppression contained two false claims that were corrected across
The compensating control remains valid: torch is absent from the production image because no extras are installed. The justification is now factually accurate. Important: Missing CHANGELOG entries (CLAUDE.md CVE Citation Policy) Added two entries under
Additional corrections (pyproject.toml)
Writing rule (osv-scanner.toml) Replaced VerificationAll pre-commit hooks passed (27/27), including |
|



Summary
Unblocks CI on PRs #39, #40, and #41. All three PRs share the same locked dependency tree from
main, so both pip-audit and osv-scanner were flagging the same two CVEs on every PR. Merging this fix branch intomainfirst will allow those PRs to pass CI cleanly.fastapi>=0.133.0in[audio]extras;uv lockresolved fastapi to 0.136.3 and starlette to 1.1.0 (patched). The starlette CVE is fully resolved by the version upgrade.osv-scanner.tomland[tool.pip-audit] ignore-vuln. torch is an optional[ml]extra absent from the production container. Documented indocs/known-vulnerabilities.mdwith reassess-by 2026-07-26.Failure chain (before this fix)
Files changed
pyproject.tomlfastapi>=0.133.0in[audio]extras; addedPYSEC-2026-139to[tool.pip-audit] ignore-vulnuv.lockosv-scanner.tomlPYSEC-2026-139suppression with full justificationdocs/known-vulnerabilities.mdTest plan
Closes #42 (partially — starlette CVE was one of the root causes surfaced by the failing CI)
Generated with Claude Code
Summary by CodeRabbit