Repository navigation
fix: accept pip's vendored urllib3/setuptools - #326
Conversation
Trivy reports CVE-2026-97688 (urllib3 2.7.0), CVE-2026-59890 and GHSA-xmj3-9gf7-h52w (setuptools 70.3.0) in the image. These are the copies vendored by pip 26.2.2 of the base image, not installed packages: uv.lock installs urllib3 2.8.0, and setuptools 84.2.1 only in the build stage. pip 26.2.2 is the latest release and still vendors these versions, so they can't be bumped; pip only runs at build time. Accept them in .trivyignore.yaml, limited to the vendored versions, until 2027-01-31, as for the earlier advisories and as FOCA does. Removing pip from the image stays in #279. Closes #325 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011FSoqMUX3EU35poH13xMgG
Re-flow the comment of the vendored copies in .trivyignore.yaml, and word the release-notes bullet without "more" and without claiming the image has no setuptools at all (pip vendors its pkg_resources). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011FSoqMUX3EU35poH13xMgG
Reviewer's GuideThe PR addresses Trivy findings caused by pip 26.2.2’s build-time vendored urllib3 2.7.0 and setuptools 70.3.0, rather than runtime dependencies, by adding narrowly scoped, expiring vulnerability exceptions and documenting the decision in the release notes. Reviewers should verify the PURLs match the SBOM findings, the image does not install the vulnerable packages at runtime, and the exceptions remain appropriately limited. 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 #326 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 22 22
Lines 2368 2368
=========================================
Hits 2368 2368 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path=".trivyignore.yaml" line_range="30" />
<code_context>
+ # can't be limited with `paths`; they would also hide these versions if
+ # installed normally
- id: CVE-2025-47273
purls: ["pkg:pypi/[email protected]"]
statement: Vendored by pip, not used by the app (path traversal in PackageIndex, which pip doesn't use)
expired_at: 2027-01-31
</code_context>
<issue_to_address>
**Vulnerable runtime code passes CI**
When a later lock or image change adds either exact ignored version as an installed dependency, trivy matches these exclusions by PURL, not by whether the package is pip's vendored copy, so CI passes with vulnerable runtime code in the image.
Remove these package-wide PURL ignores or otherwise ensure installed copies remain scanned.
Also at `.trivyignore.yaml:34`, `.trivyignore.yaml:42`.
</issue_to_address>Linked issues
#325 fix: clear the urllib3 and setuptools image findings · 1 of 1 met
| # | Requirement | Status | Notes |
|---|---|---|---|
| 1 | Accept the three advisories in .trivyignore.yaml, limited to the vendored versions and expiring 2027-01-31. | ✅ Met | All three advisories have entries with the matching setuptools 70.3.0 or urllib3 2.7.0 purl, a statement, and the requested expiry. |
Sourcery assessment
Needs a human reviewer. 1 finding to address first, the security scan did not finish, and these entries suppress findings by package URL, not by vendored-file path, so an image containing the same urllib3 or setuptools version as a normal installed package could pass scans without reporting the advisory. Reverting restores the findings, but an artifact released while that version is present could already have shipped with the vulnerability.
Blocking findings: .trivyignore.yaml:30
Summary
Clears the three open Trivy code-scanning alerts on
dev(target "Python"): 167 (urllib3 2.7.0, CVE-2026-97688), 166 (setuptools 70.3.0, CVE-2026-59890) and 343 (setuptools 70.3.0, GHSA-xmj3-9gf7-h52w).Root cause: these are not installed packages but the copies vendored by pip 26.2.2 of the base image (
pip/_vendor/vendor.txt, SBOMpip/_vendor/bom.cdx.json).uv.lockalready installs urllib3 2.8.0, and setuptools 84.2.1 only in the build stage (the final image installs none). pip 26.2.2 is the latest release, and pip's main branch still vendors setuptools 70.3.0, so nothing can be bumped; pip only runs at build time, and nothing in site-packages imports pip or its vendored packages..trivyignore.yaml: accepts the three advisories, limited to the vendored versions (purls), with statements and the expiry 2027-01-31, as for the earlier vendored-copy advisories and identical to FOCA's entries (build: accept setuptools advisory vendored by pip foca#562). The block comment now names the actual SBOM path and today's check date.docs/releases/1.0.0rc1.md: Security bullet.Removing pip from the image, which clears all vendored findings, stays in #279 (untouched).
Closes #325
Verification
docker build, tagcr-trivy-fix-base:local):pip listshows urllib3 2.8.0 and no setuptools;pip/_vendor/vendor.txtlistsurllib3==2.7.0andsetuptools==70.3.0.aquasec/trivy:0.75.0, same flags as the sharedscan-imageaction:--ignorefile .trivyignore.yaml --ignore-unfixed): before, Python: 3 (MEDIUM 2, LOW 1: CVE-2026-59890, GHSA-xmj3-9gf7-h52w, CVE-2026-97688); after, 0 findings in all targets; the CRITICAL,HIGH gate exits 0.pre-commit run --all-files(ruff, mypy, semgrep, gitleaks, actionlint, ...): passed.scripts/release_notes.py check docs/releases/1.0.0rc1.md: passed.coverage run -m pytest: 1603 passed, 100% coverage; the 263 chart/config tests that failed locally only because the misehelmshim had no version set pass with it set (287 passed).Scan imageincluded,CI passedgreen.Declined review findings
.trivyignore.yamlcomment (low): they record when pip's latest release was checked, as the existing entries do.🤖 Generated with Claude Code
https://claude.ai/code/session_011FSoqMUX3EU35poH13xMgG
Summary by Sourcery
Accept pip's vendored urllib3 and setuptools advisories while distinguishing them from the application's installed dependencies.
Enhancements:
Documentation: