Repository navigation
fix: accept advisories vendored by pip - #386
Conversation
Add CVE-2026-97688 (urllib3 2.7.0), CVE-2026-59890 and GHSA-xmj3-9gf7-h52w (setuptools 70.3.0) to .trivyignore.yaml, limited to the package versions, with the expiry of the neighbouring entries (2027-01-31). The image has no such installed packages: uv.lock and the base image have urllib3 2.8.0 and no setuptools; Trivy reports the copies vendored by pip 26.2.2 (latest), which only runs at build time. Dropping pip stays with #336. Closes #383 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThe PR updates the Trivy ignore configuration to suppress three advisories that apply only to pip 26.2.2’s vendored setuptools 70.3.0 and urllib3 2.7.0 copies, while preserving scan coverage through package/version-specific entries, rationale statements, and an expiration date; application dependencies and image contents are unchanged. File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #386 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 23 23
Lines 2217 2217
=========================================
Hits 2217 2217 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Hey - I've found 2 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path=".trivyignore.yaml" line_range="45" />
<code_context>
+ statement: Vendored by pip, not used by the app (Windows path escape in legacy wheel installation; the image runs Linux)
+ expired_at: 2027-01-31
- id: CVE-2026-97687
purls: ["pkg:pypi/[email protected]"]
statement: Vendored by pip, not used by the app (pip only runs at build time)
</code_context>
<issue_to_address>
**Vulnerable app packages pass scans**
When the image contains setuptools 70.3.0 or urllib3 2.7.0 as installed application dependencies, the `purls` filters match only package and version, so Trivy suppresses the findings for installed application copies too and the CI image scan passes with a vulnerable runtime package.
Change the ignores so they do not suppress findings for installed application dependencies.
Also at `.trivyignore.yaml:29`, `.trivyignore.yaml:33`.
</issue_to_address>
### Comment 2
<location path=".trivyignore.yaml" line_range="46" />
<code_context>
expired_at: 2027-01-31
+ - id: CVE-2026-97688
+ purls: ["pkg:pypi/[email protected]"]
+ statement: Vendored by pip, not used by the app (infinite loop in chunked Deflate decoding; pip only runs at build time)
+ expired_at: 2027-01-31
- id: GHSA-6v7p-g79w-8964
</code_context>
<issue_to_address>
**Builds hang on crafted index responses**
When the package index or an intermediary returns a chunked Deflate response that triggers CVE-2026-97688, pip uses its vendored urllib3 to fetch dependencies, and the vulnerable Deflate decoder loops indefinitely on the crafted response. The Docker build then stalls until the CI job timeout, blocking image publication.
Use a pip version with a fixed vendored urllib3, or otherwise prevent vulnerable pip from processing untrusted index responses during builds.
</issue_to_address>Linked issues
#383 fix: update urllib3 and setuptools in the image · 2 of 4 met · 1 to check by hand
| # | Requirement | Status | Notes |
|---|---|---|---|
| 1 | Update urllib3 to 2.8.0 or later in uv.lock | ✅ Met | uv.lock already pins urllib3 2.8.0. |
| 2 | Find out where setuptools 70.3.0 comes from | ✅ Met | The change identifies it as pip's vendored copy, not an installed application package. |
| 3 | Remove setuptools from the image or update it; if it comes with pip, do this together with #336 | ❌ Not addressed | The image's pip and its vendored setuptools remain; this change only adds Trivy ignores for the advisories. |
| 4 | Check that the code scanning alerts close after the next dev scan | 👀 Check by hand (external system) | Confirm that the three alerts close in code scanning after the next dev image scan. |
Sourcery assessment
Needs a human reviewer. 2 findings to address first, the security scan did not finish, and these entries make Trivy silently stop reporting the named advisories for the specified package versions; if the vendoring or non-use assumptions are wrong, affected code can remain unpatched without the scan signaling it. Reverting restores future findings, but it cannot undo exposure or any compromise that occurred while they were suppressed.
Blocking findings: .trivyignore.yaml:45, .trivyignore.yaml:46
Summary
Closes #383
The three alerts do not come from installed packages.
uv.lockalready has urllib3 2.8.0 and no setuptools is installed (the base imageelixircloud/foca:0.19.0-py3.13has urllib3 2.8.0 and no setuptools either). Trivy reports the copies vendored by pip 26.2.2 (latest release): urllib3 2.7.0 and setuptools 70.3.0 (pip/_vendor/vendor.txt). pip only runs at build time. Neither can be updated while keeping pip, and dropping pip is #336 (deferred by the maintainer).This PR adds the three advisories to
.trivyignore.yaml, as the neighbouring entries (and foca#562), limited to the vendored versions, expiring 2027-01-31:The entries are grouped by package. No docs change: behaviour and image contents are unchanged.
Verification
docker buildof the image, thenpip listandfindin it: urllib3 2.8.0, no setuptools, only pip's vendored copies..trivyignore.yaml: no Python package finding left (only unfixed Debian OS findings, which the CI scan does not fail on).Lane: regular. Adversarial and quality review: no high or medium findings. Declined: none; the two low findings (grouping by package, shorter statement) were applied.
Open questions
None.
🤖 Generated with Claude Code
Summary by Sourcery
Enhancements: