GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix CVEs by removing unused OS packages and updating dependencies by moshemorad · Pull Request #545 · robusta-dev/krr

Conversation

@moshemorad

@moshemorad moshemorad commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR addresses multiple CVEs in the krr container image and its dependencies by removing unused OS packages and updating vulnerable transitive dependencies to patched versions.

Key Changes

Dockerfile

  • Remove unused OS packages with unfixed CVEs that are not required at runtime:
    • perl-base (8 CVEs including CRITICAL severity)
    • util-linux, bsdutils, mount, and related libraries (3+ CVEs each)
    • Verification logic ensures packages are actually removed and core functionality (Python imports, bash) still works
  • Preserve essential packages despite CVEs:
    • ncurses - required by bash for debugging via kubectl exec/docker exec
    • login - dpkg-protected package that cannot be removed

pyproject.toml

  • setuptools: ^80.9.0 → ^83.0.0 (fixes CVE-2026-23949, CVE-2026-24049, CVE-2026-59890)
  • pillow: Added pinned version ^12.3.0 (fixes 10 HIGH severity CVEs)
  • pyasn1: Added pinned version ^0.6.4 (fixes 2 HIGH severity CVEs)

requirements.txt

  • Updated transitive dependency versions to match pyproject.toml changes:
    • pillow: 12.2.0 → 12.3.0
    • pyasn1: 0.6.3 → 0.6.4
    • setuptools: 80.9.0 → 83.0.0

Implementation Details

  • The Dockerfile purge operation uses --force-remove-essential --force-depends flags since dpkg exits non-zero on essential package warnings even when removals succeed
  • Explicit verification loop confirms each package was actually removed before proceeding
  • Post-removal sanity checks verify Python imports and bash functionality remain intact

https://claude.ai/code/session_01HB2xE7yTmsQWues52YDqw6

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@claude
Patch CRITICAL/HIGH CVEs in krr image and dependencies
e8a5422
Scanned both images with Trivy and remediated per policy: all CRITICAL and
HIGH findings, plus MEDIUM findings older than 60 days. 50 of the 69 in-policy
findings are resolved; the krr image goes from 4 CRITICAL / 33 HIGH / 191 total
to 0 CRITICAL / 7 HIGH / 86 total. The enforcer image already scanned clean
(0 findings across 39 Alpine and 64 Python packages) and is unchanged.

Dependency bumps (requirements.txt, pyproject.toml, poetry.lock):

- pillow 12.2.0 -> 12.3.0, clearing 10 HIGH and 3 MEDIUM
- pyasn1 0.6.3 -> 0.6.4, clearing CVE-2026-59885 and CVE-2026-59886 (HIGH)
- setuptools 80.9.0 -> 83.0.0. setuptools >=81 vendors jaraco.context 6.1.0 and
  wheel 0.46.3, which clears CVE-2026-23949 and CVE-2026-24049 (both HIGH,
  reachable only through setuptools' bundled copies) plus CVE-2026-59890

pillow and pyasn1 are transitive (via matplotlib and google-auth), so they are
now pinned explicitly in pyproject.toml to hold the fixed floors. poetry.lock
was regenerated with Poetry 1.8.5 to keep lock-version 2.0, matching the
existing file; only these three package entries change.

Dockerfile: the remaining OS findings all sit in Debian trixie packages with no
fixed version published, and apt-get upgrade is a verified no-op, so the only
remedy is to stop shipping the packages. perl-base (4 CRITICAL, 4 HIGH,
4 MEDIUM) and the util-linux family (CVE-2026-53615 HIGH plus 2 MEDIUM each)
are unused by this pure-Python app and are now purged. dpkg exits non-zero on
essential-package warnings even when every removal succeeds, so the layer
verifies each removal explicitly and then smoke-tests the interpreter and bash
rather than trusting the exit code.

ncurses is deliberately kept: bash links libtinfo.so.6, and removing it leaves
the image without a working shell for kubectl/docker exec. login cannot be
removed at all (dpkg protected). Those account for 5 of the 7 remaining HIGH
findings; gzip and libacl1 are the other two.

Verified on linux/amd64: 55/55 tests pass, image builds, krr version and
--help run, and numpy/pandas/matplotlib/pillow import and render. The purge
layer and the three bumped packages were checked on linux/arm64 as well.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HB2xE7yTmsQWues52YDqw6
@coderabbitai

coderabbitai Bot commented Jul 27, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c00cacd3-b093-4976-8a6a-a41fa003a819

📥 Commits

Reviewing files that changed from the base of the PR and between 66e05db and dd66618.

📒 Files selected for processing (1)
  • Dockerfile
🚧 Files skipped from review as they are similar to previous changes (1)
  • Dockerfile

Walkthrough

Updates Python dependency pins and adds a Docker build step that purges selected Debian packages, removes apt lists, verifies package removal, and runs runtime sanity checks.

Changes

Security hardening

Layer / File(s) Summary
Python dependency pin updates
pyproject.toml, requirements.txt
Updates pinned versions of setuptools, pillow, and pyasn1 across project dependency declarations.
Docker package purge and validation
Dockerfile
Purges selected Debian packages, removes apt lists, verifies removal, and checks robusta_krr, Python uuid, and Bash execution.

Estimated code review effort: 3 (Moderate) | ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: removing unused OS packages and updating dependencies to address CVEs.
Description check ✅ Passed The description is clearly related to the changeset and explains the Dockerfile and dependency updates in detail.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/krr-enforcer-cve-patching-rcvkxt

Comment @coderabbitai help to get the list of available commands.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

coderabbitai[bot]
coderabbitai Bot reviewed Jul 27, 2026
View reviewed changes

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 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 `@Dockerfile`:
- Around line 50-54: Update the package-state validation loop in the Dockerfile
to query each package with dpkg-query’s ${db:Status-Status} field and accept
only an absent or not-installed result. Reject installed, config-files-only,
unpacked, half-configured, and any other non-absent state, while preserving the
existing failure message and exit behavior.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c1b6188b-7a54-45eb-94d1-63c4a6b35e8d

📥 Commits

Reviewing files that changed from the base of the PR and between 1e96b24 and e8a5422.

⛔ Files ignored due to path filters (1)
  • poetry.lock is excluded by !**/*.lock
📒 Files selected for processing (3)
  • Dockerfile
  • pyproject.toml
  • requirements.txt

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Dockerfile Resolved

Uh oh!

There was an error while loading. Please reload this page.

Avi-Robusta
Avi-Robusta previously approved these changes Jul 27, 2026
View reviewed changes

@Avi-Robusta Avi-Robusta left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reminder to test before next release

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@claude
Document uuid fallback and k8s mount semantics in purge layer
28a58e0
Removing libuuid1 disables CPython's optional _uuid C accelerator; the stdlib
uuid module falls back to its pure-Python implementation by design. Nothing in
krr or its dependencies calls uuid1()/generate_time_safe (the only paths _uuid
accelerates), and krr itself only imports the UUID class for parsing. The
build-time verification now exercises uuid4/uuid1/getnode through the fallback
so a future base-image change that breaks it fails the build instead of
shipping.

Also record why removing mount/util-linux cannot affect Kubernetes volume,
secret or configmap mounts: the container runtime performs them on the host
via mount(2) before the container rootfs starts, and never execs the in-image
mount binary. Verified by running the purged image with bind, tmpfs and
read-only-rootfs mounts.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HB2xE7yTmsQWues52YDqw6
@moshemorad
moshemorad dismissed Avi-Robusta’s stale review via 28a58e0 July 27, 2026 08:36
claude added 2 commits July 27, 2026 09:06
@claude
Trim verbose comments in Dockerfile and pyproject.toml
66e05db
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HB2xE7yTmsQWues52YDqw6
@claude
Use dpkg-query Status-Status for purge verification
dd66618
The previous grep on dpkg -l only matched ii/hi states, so a package left in
a partial state (half-installed, unpacked) after the intentionally-ignored
dpkg exit code could slip through. Query db:Status-Status and accept only
absent or not-installed. Addresses the review comment on PR #545.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HB2xE7yTmsQWues52YDqw6
Avi-Robusta
Avi-Robusta approved these changes Jul 27, 2026
View reviewed changes
@moshemorad
moshemorad merged commit d6baa74 into main Jul 27, 2026
3 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@moshemorad
moshemorad deleted the claude/krr-enforcer-cve-patching-rcvkxt branch July 27, 2026 09:40
@RoiGlinik RoiGlinik mentioned this pull request Nov 4, 2026
Fix release builds: retired macos-13 runner, crashing binaries, Homebrew update chain #560
Merged
RoiGlinik added a commit that referenced this pull request Nov 4, 2026
@RoiGlinik @claude
Fix release builds: retired macos-13 runner, crashing binaries, Homeb…
17c769d
…rew update chain (#560)

## Summary
Every release since v1.29.0 hung for 24h and was cancelled, and every
binary since v1.30.0 crashes on startup. The Homebrew formula is still
on v1.28.0.

**1. Retired `macos-13` runner.** `build (macos-13)` never got a runner
and was cancelled after 24h, which skipped `check-latest`, the hash jobs
and `update-formula`. The Intel binary is now built on `macos-15-intel`.
It still runs on macOS 10.13+ (highest `minos` across the bundle's
Mach-O files), because minimum versions come from the prebuilt Python,
wheels and PyInstaller bootloader, not the runner. The Intel asset is
now `krr-macos-15-intel-<tag>.zip`; nothing references the old name.

**2. Binaries crash since v1.30.0.**
```
AttributeError: module 'pkg_resources' has no attribute 'NullProvider'
[PYI-...:ERROR] Failed to execute script 'pyi_rth_pkgres' due to unhandled exception!
```
#545 bumped setuptools 80.9.0 → 83.0.0 (CVE fixes). setuptools 83 no
longer ships `pkg_resources`, but upgrading the runner's preinstalled
setuptools leaves an empty `pkg_resources/` dir. PyInstaller bundles it
as a namespace package plus its `pyi_rth_pkgres` hook, which crashes.
Builds now pass `--exclude-module pkg_resources` (nothing krr uses needs
it; setuptools stays on 83). A `Smoke test the binary` step runs `krr
version` after each build.

**3. Homebrew update chain.**
- Hash jobs use `$GITHUB_OUTPUT` instead of the deprecated
`::set-output`.
- `if: needs.check-latest.outputs.IS_LATEST` was always true (job
outputs are strings, and "false" is truthy). Now compares to `'true'`.
- `excludes: prerelease,draft`: get-latest-release v0.7.0 splits on `,`
without trimming, so `" draft"` never excluded drafts.
- New `brew-test` job (macOS + Linux): installs the new formula from a
local tap pointed at the zips just built, runs `brew test`, and checks
`krr version` prints the tag. `update-formula` needs it, so a formula
that doesn't install is never pushed.
- `update-formula` fails instead of writing a missing or malformed
sha256; the commit message includes the tag (`TAG_NAME` was never set
there).

**4. Dry-run support.** Release-only steps (asset upload, Apple
certificate, tap push) are guarded by `github.event_name == 'release'`
and the tag comes from `RELEASE_TAG`, so the workflow can run as a dry
run on a PR. The `pull_request` trigger was used to test this PR and
then removed; add it back to dry-run future workflow changes.

**5. Hardening.** `permissions: contents: read` by default, `contents:
write` only for `build`. `persist-credentials: false` on the build and
`brew-test` checkouts. `actions/checkout` v4, `actions/setup-python` v5
(actionlint flagged v2).

## Tests performed
- Published macOS (arm64) zips, `krr version`: v1.28.0 and v1.29.0 work;
v1.30.0, v1.31.0, v1.31.1, v1.31.2 crash with the error above.
- Local PyInstaller build (arm64 macOS, Python 3.11): clean venv works;
with an empty `site-packages/pkg_resources/` it crashes with the exact
CI error; `--exclude-module pkg_resources` fixes it.
- `actionlint` passes.
- Dry run 41858869705: all four builds got runners (incl.
`macos-15-intel`) and smoke tests printed `pr-560`; hash outputs match
the downloaded artifacts; `update-formula` printed the expected diff;
push, asset upload and certificate steps skipped; homebrew-krr
untouched; the CI-built macOS zip runs `krr version` / `krr simple
--help` locally.
- Dry run 41864839078: `brew-test` installed the formula on macOS and
Linux (`krr version: pr-560`). `update-formula` was not scheduled in
that run due to the GitHub Actions incident.
- Dry run 41867739161 (commit 303f31f, last one before removing the PR
trigger): all jobs passed; smoke tests and `brew-test` on macOS and
Linux printed `pr-560`; `update-formula` printed the expected diff and
skipped the push.
- `otool -l` on the `macos-15-intel` build: highest minimum macOS across
all Mach-O files is 10.13.
- Not covered: release-only steps (asset upload, certificate import, tap
push) will first run on the next release.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@coderabbitai coderabbitai[bot] coderabbitai[bot] left review comments
@Avi-Robusta Avi-Robusta Avi-Robusta approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@moshemorad @Avi-Robusta @claude
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.