mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #5303] [Other] packaging: swap the Terminal bundle's stale pip-vendored copies and re-align its SBOM (the last CVE carriers) #5377
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#5377
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/5303
Author: @didlawowo
Created: 11/5/2026
Status: 🔄 Open
Base:
main← Head:docker-cve-overlay📝 Commits (1)
e432958fix(packaging): swap the Terminal bundle's stale pip-vendored copies and re-align its SBOM📊 Changes
1 file changed (+98 additions, -0 deletions)
View changed files
📝
packaging/package_terminal.py(+98 -0)📄 Description
Problem and result: The published
strata-cuda13container images carry the Terminal archive, whose bundled pip vendors its own dependency copies insidepip/_vendor/. Those vendored copies are not upgraded when pip upgrades itself, so the bundle shippedpip/_vendor/certifi@2026.6.17(GHSA-6q48 CRITICAL, revoked emSign roots — reachable by pip during first-start downloads),pip/_vendor/msgpack@1.1.2,pip/_vendor/urllib3@2.7.0andpip/_vendor/pkg_resources@70.3.0. Scanner reports therefore stay red even on a bundle whose requirements are already fixed. Result: at archive build time the vendored copies are replaced with the fixed versions of the same interpreter, pip'svendor.txtmanifest and its embedded CycloneDX BOM are re-aligned with the files actually shipped, and a Trivy-grade scan of the image reports the remaining carriers only.Related discussion: #5284 (our Trivy scan of the published
0.2.9-cuda13image, digest83e37db8: 37 HIGH/CRITICAL findings). #4220 already fixed Pillow; the current locks pincertifi 2026.10.19,urllib3 2.8.0,pillow 13.0.0. In a rebuild of the 0.2.9 image with the requirements fixed but nothing else, Trivy still reported 8 findings and all but two of them attributed to thepip/_vendorcopies listed above — this change is the remaining piece.Approach:
packaging/package_terminal.py, afterinstall_locked()and before the probe:msgpack>=1.2.3,<2,setuptools>=78.1.1,<79) into the bundled interpreter — packaging internals, not runtime deps of the bundle;pip/_vendor/{certifi,msgpack,urllib3,pkg_resources}with the site-packages copies of the same interpreter (unmodified upstream versions, ABI-compatible);pip/_vendor/vendor.txtwith the swapped versions (pkg_resourcesswap also updates thesetuptoolsline) and drop the redundant vendored source trees pip ships under its owndist-info/licenses/src/pip/_vendor/;pip/_vendor/bom.cdx.jsonso component versions and purls match the shipped files;pip --versionas a check that pip still works with the swapped copies.pip itself is deliberately not upgraded (the interpreter's pip stays, as documented in the module docstring). The manifest records the swap under
pip_vendored_swapped.Validation:
Passed: end-to-end terminal packaging on darwin-arm64 (
python3 packaging/package_terminal.py --out ... --cache ..., commite4329584of this branch): exit 0, archive built,pip_vendored_swapped=[certifi, msgpack, pkg_resources, urllib3]; unpacking the produced archive showsvendor.txt=certifi==2026.10.19, msgpack==1.2.4, urllib3==2.8.0, setuptools==78.1.1and the BOM components showing the same versions.Passed:
unittest tests/terminal/test_packaging_pins.py(9/9),test_bundle_imports.py,test_terminal_commit.py,test_bundle_tools_paths.py,test_tuiqa_version.py— all OK on this branch.Failed:
test_archive_gaps.pyhas 1 failure andtest_docker_files.py1 error — reproduced identically on a pristine checkout ofmain(commitc3b3f503), so both are pre-existing and unrelated to this change.Not run: a full rebuild of the published docker image from
mainplus a Trivy re-scan (the evidence for the swap chain comes from our 0.2.9 rebuilds, where the same steps took the scan from 37 findings to 2); thewindows-x86_64andlinux-aarch64targets (the swap code is target-independent, but only the darwin-arm64 path was exercised end to end).Limits: pip's vendored
setuptoolsshipsjaraco.contextandwheelinternally that scanners still flag (build-time only, never executed at first start); the two installed "fix" versions are outside the hash lock by design (they are packaging internals; the lock-match check ininstall_locked()runs before this step, so the bundle's runtime packages stay exactly the lock's); if a future lock dropscertifiorurllib3from site-packages, the corresponding vendored copy is left untouched (the swap skips missing sources).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.